Expo build:android fails for Expo 33.0.0 SDK

Hi, I am having a trouble in building my project. To comply with Google Playstore new rule to support 64-bit codes, I upgraded my SDK from 32 to 33. But then I got errors in building it now.

No assets to upload, skipped.
Processing asset bundle patterns:
- C:\Workspace\ReactNativeProjects\hkshopu-app\**\*
Webpack is not running.
Cannot read property 'forEach' of undefined

I changed my

    "assetBundlePatterns": [
      "**/*"
    ],

to

    "assetBundlePatterns": [
      "assets/*"
    ],

And it proceeds to app building. But still it failed in the middle of the process with this error:

> Task :app:mergeReleaseResources FAILED
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:mergeReleaseResources'.
[stderr] > java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.3.2-5309881-linux Daemon #4: Unexpected error during compile '/app/turtle/workingdir/android/sdk33/android-shell-app/app/src/main/res/drawable-mdpi/shell_launch_background_image.png', attempting to stop daemon.
[stderr]   This should not happen under normal circumstances, please file an issue if it does.
[stderr] * Try:
[stderr] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 36s
17 actionable tasks: 17 executed
Error: ./gradlew exited with non-zero code: 1
    at ChildProcess.completionListener (/app/turtle/node_modules/@expo/xdl/node_modules/@expo/spawn-async/build/spawnAsync.js:52:23)
    at Object.onceWrapper (events.js:317:30)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:915:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
    ...
    at spawnAsync (/app/turtle/node_modules/@expo/xdl/node_modules/@expo/spawn-async/build/spawnAsync.js:17:21)
    at /app/turtle/node_modules/@expo/xdl/build/detach/ExponentTools.js:78:71
    at Generator.next (<anonymous>)
    at step (/app/turtle/node_modules/@expo/xdl/build/detach/ExponentTools.js:261:191)
    at /app/turtle/node_modules/@expo/xdl/build/detach/ExponentTools.js:261:437
    at new Promise (<anonymous>)
    at /app/turtle/node_modules/@expo/xdl/build/detach/ExponentTools.js:261:99
    at spawnAsyncThrowError (/app/turtle/node_modules/@expo/xdl/build/detach/ExponentTools.js:89:18)
    at /app/turtle/node_modules/@expo/xdl/build/detach/AndroidShellApp.js:466:13
    at Generator.next (<anonymous>)
    at step (/app/turtle/node_modules/@expo/xdl/build/detach/AndroidShellApp.js:656:191)
    at /app/turtle/node_modules/@expo/xdl/build/detach/AndroidShellApp.js:656:361
    at <anonymous>

Can someone please help me?

Thank you!

Hi @mahine! What version of expo-cli are you using? Just run expo diagnostics and share the output here :slight_smile:

(Also if you share your buildID with me I can take a deeper look at the logs!

Here is the output of expo diagnostics
image

for the build ID, if I am not mistaken, this is it: https://expo.io/builds/638112da-5bcd-4aae-816d-13baed2c7b98

thank you so much!

And you have all the necessary prerequisites for using expo-cli? Specifically Node v10 or a newer stable version?

Yes. I was able to successfully build standalone apps before with sdk32.

Could you share your package.json with me?

here is my package.json:

{
  "name": "empty-project-template",
  "main": "node_modules/expo/AppEntry.js",
  "private": true,
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "eject": "expo eject"
  },
  "dependencies": {
    "axios": "^0.18.0",
    "expo": "^33.0.4",
    "expo-ads-admob": "^5.0.1",
    "expo-codemod": "^1.0.1",
    "expo-font": "^5.0.1",
    "moment": "^2.24.0",
    "os": "^0.1.1",
    "prop-types": "^15.6.2",
    "react": "16.8.3",
    "react-native": "https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz",
    "react-native-datepicker": "^1.7.2",
    "react-native-dialog": "^5.5.0",
    "react-native-elements": "^0.19.1",
    "react-native-flexi-radio-button": "^0.2.2",
    "react-native-modal": "^7.0.2",
    "react-native-radio-buttons-group": "^1.0.7",
    "react-native-star-rating": "^1.1.0",
    "react-native-tab-view": "^1.3.1",
    "react-native-vector-icons": "^6.1.0",
    "react-native-whc-loading": "^1.0.3",
    "react-navigation": "^2.17.0",
    "react-redux": "^5.0.7",
    "redux": "^4.0.0",
    "redux-persist": "^5.10.0",
    "redux-promise-middleware": "^5.1.1",
    "redux-thunk": "^2.3.0",
    "styled-components": "^4.0.2",
    "supports-color": "^5.5.0"
  }
}

Nothing in there is glaringly off… I’ve seen some build issues like this before where react-native wasn’t pinned to the expo version.

Did you make any changes to splashscreens?

Well, when I upgraded the app from sdk32 to sdk33, I did not do any changes. But if you are asking if the splash screen was changed before the upgrade, YES. I changed the image but the filename remains the same.

What do you by react native not pinned to expo?

But you had already made other SDK32 builds with the new splash screen that worked correctly?

What do you by react native not pinned to expo?

Sometimes, users will change the react-native version in their package.json file to a specific version, rather than “https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz

Yes. Multiple times. I had already published it in playstore

I am using sdk32 before. But 64bit version will be required in Playstore by August and my Application needs to comply. Any suggestion?

We’ll be releasing SDK 34 before the August deadline, and that will be the SDK you need to upgrade to in order to comply with the 64bit requirements

Okay. Noted on that. Hopefully sdk34 would work for me smoothly. I downgraded my app to sdk32 for now as I need to publish a new version.

I have images folder with .jpg images within src folder. Could that be a reason for :app:mergeReleaseResources error?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.