Expo 45 build fail on Android with EAS

Please provide the following:

  1. SDK Version:45
  2. Platforms(Android/iOS/web/all): Android
  3. Add the appropriate “Tag” based on what Expo library you have a question on.

Hi All,

I’ve upgraded the SDK version to 45 recently.
Everything works well except it doesn’t build either on Android or IO.
However, I’d like to take a step at a time and I’m needing some help to resolve Android build first.
expo build or eas build all fails at gradlew stage with below error log

Running 'gradlew :app:bundleRelease' in /home/expo/workingdir/build/android
Downloading https://services.gradle.org/distributions/gradle-7.3.3-all.zip
10%
20%.
30%.
40%.
50%.
60%.
70%.
80%.
90%.
100%
Welcome to Gradle 7.3.3!
Here are the highlights of this release:
 - Easily declare new test suites in Java projects
 - Support for Java 17
 - Support for Scala 3
For more details see https://docs.gradle.org/7.3.3/release-notes.html
To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.3.3/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build
> Task :react-native-gradle-plugin:compileKotlin
'compileJava' task (current target is 1.8) and 'compileKotlin' task (current target is 11) jvm target compatibility should be set to the same Java version.
> Task :react-native-gradle-plugin:pluginDescriptors
> Task :react-native-gradle-plugin:processResources
> Task :react-native-gradle-plugin:compileKotlin
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (10, 37): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (119, 30): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (135, 26): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (155, 32): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (161, 31): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (169, 36): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt: (100, 48): 'reactRoot: DirectoryProperty' is deprecated. reactRoot was confusing and has been replace with rootto point to your root project and reactNativeDir to point to the folder of the react-native NPM package
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (10, 37): 'ApplicationVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (11, 37): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (12, 37): 'LibraryVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (28, 51): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (131, 12): 'ApplicationVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (132, 12): 'LibraryVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (252, 14): 'BaseVariant' is deprecated. Deprecated in Java
> Task :react-native-gradle-plugin:compileJava
[stderr] Note: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/java/com/facebook/react/codegen/generator/SchemaJsonParser.java uses or overrides a deprecated API.
[stderr] Note: Recompile with -Xlint:deprecation for details.
> Task :react-native-gradle-plugin:classes
> Task :react-native-gradle-plugin:inspectClassesForKotlinIC
> Task :react-native-gradle-plugin:jar
> Configure project :app
Unable to detect AGP versions for included builds. All projects in the build should use the same AGP version. Class name for the included build object: org.gradle.composite.internal.DefaultIncludedBuild$IncludedBuildImpl_Decorated.
[stderr] FAILURE: Build completed with 2 failures.
[stderr] 1: Task failed with an exception.
[stderr] -----------
[stderr] * Where:
[stderr] Build file '/home/expo/workingdir/build/node_modules/expo-dev-client/android/build.gradle' line: 95
[stderr] * What went wrong:
[stderr] A problem occurred evaluating project ':expo-dev-client'.
[stderr] > Project with path ':expo-dev-menu-interface' could not be found in project ':expo-dev-client'.
[stderr] * Try:
[stderr] > Run with --stacktrace option to get the stack trace.
[stderr] > Run with --info or --debug option to get more log output.
[stderr] > Run with --scan to get full insights.
[stderr] ==============================================================================
[stderr] 2: Task failed with an exception.
[stderr] -----------
[stderr] * What went wrong:
[stderr] A problem occurred configuring project ':expo'.
[stderr] > compileSdkVersion is not specified. Please add it to build.gradle
[stderr] * Try:
[stderr] > Run with --stacktrace option to get the stack trace.
[stderr] > Run with --info or --debug option to get more log output.
[stderr] > Run with --scan to get full insights.
[stderr] ==============================================================================
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 2m 5s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings
6 actionable tasks: 6 executed
Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

What I’ve tried so far

clean install of node modules
expo doctor (no issue found)
upgrading to SDK 46 (upgrade crashes)
upgrading expo-dev-client
importing expo-dev-client in the App.js file

I’m desperate to get this build out since upgrading to SDK 45 finally fixed flat list bugs which caused my app unusable.
Any help will be greatly appreciated.

Thanks in advance.

Hi @ksi9302

Could you post a link to one of the failed eas builds in case one of the Expo team members has a chance to investigate?

Also, if you create a new Expo app (e.g. with npx create-expo-app -t blank@sdk-45 or yarn create expo-app -t blank@sdk-45) and then install all of the dependencies that your real app is using, does that build?

Hi @wodin

Thanks for the suggestion.
I’ll give creating a blank app with SDK 45 a go.

In the meantime, below is the link for the failed build.

I’m actually having a similar issue with Android on eas local which was working before. I’m trying a few things as well. But it is odd since the previous builds were working and the yarn.lock wasn’t updated.

In my case I get an error here Unresolved reference: DefaultNativeModuleCallExceptionHandler

2022-11-08T17:04:50.4144493Z [RUN_GRADLEW] e: /home/vsts/work/_temp/57860/build/node_modules/expo-updates/android/src/main/java/expo/modules/updates/errorrecovery/ErrorRecovery.kt: (7, 34): Unresolved reference: DefaultNativeModuleCallExceptionHandler
2022-11-08T17:04:50.4145988Z [RUN_GRADLEW] e: /home/vsts/work/_temp/57860/build/node_modules/expo-updates/android/src/main/java/expo/modules/updates/errorrecovery/ErrorRecovery.kt: (19, 41): Unresolved reference: DefaultNativeModuleCallExceptionHandler
2022-11-08T17:04:50.4147455Z [RUN_GRADLEW] e: /home/vsts/work/_temp/57860/build/node_modules/expo-updates/android/src/main/java/expo/modules/updates/errorrecovery/ErrorRecovery.kt: (67, 60): Unresolved reference: DefaultNativeModuleCallExceptionHandler
2022-11-08T17:04:50.4148847Z [RUN_GRADLEW] e: /home/vsts/work/_temp/57860/build/node_modules/expo-updates/android/src/main/java/expo/modules/updates/errorrecovery/ErrorRecovery.kt: (68, 7): 'handleException' overrides nothing
2022-11-08T17:04:50.4150259Z [RUN_GRADLEW] e: /home/vsts/work/_temp/57860/build/node_modules/expo-updates/android/src/main/java/expo/modules/updates/errorrecovery/ErrorRecovery.kt: (77, 35): Unresolved reference: DefaultNativeModuleCallExceptionHandler

My current attempt now is to remove expo-updates since I don’t actually use the update mechanism in production, but I guess we need it for Expo Go.

I’m trying the same I am only going to add one dep that’s expo-updates

npx create-expo-app -t blank@sdk-45 sample-update
cd sample-update
npx expo install expo-updates
eas build --platform android

Build Details — c885844f-f7f6-4c61-9994-9bc4749808eb — @trajano/sample-update — Expo

Ran successfully.

Actually it’s not needed for Expo Go.

Can you compare the versions of expo-updates in the packago-lock.json/yarn.lock files from the real app and the new test app?

e.g.:

git checkout package.lock yarn.lock
npm why expo-updates

Shortly after the test build I did ran successfully I just decided to revert my code back to the way it was before I was trying to resolve the build issues. Now it’s building again with no code changes.

1 Like

Ok, I fixed the problem.
It actually turned out to be dependency issue.

What I did,

  1. disabled, took out Sentry from package.json, app.json
  2. took out expo-updates
  3. installed expo-dev-client and then uninstalled (since this was the package that gradlew was complaining about, I have no idea how installing and uninstalling did the trick)

Now, I gotta fix IOS build failing LOL

Using Expo modules

2

Auto-linking React Native modules for target `app`: RNCAsyncStorage, RNCPicker, RNDateTimePicker, RNGestureHandler, RNReanimated, RNSVG, RNScreens, RNSentry, react-native-safe-area-context, react-native-slider, and react-native-webview

3

[Codegen] Generating ./build/generated/ios/React-Codegen.podspec.json

4

Analyzing dependencies

5

Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`

6

[Codegen] Found FBReactNativeSpec

7

Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`

8

Fetching podspec for `boost` from `../node_modules/react-native/third-party-podspecs/boost.podspec`

9

Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`

10

Adding spec repo `trunk` with CDN `https://cdn.cocoapods.org/`

11

[!] Unable to find a specification for `EXImageLoader` depended upon by `EXBarCodeScanner`

12

You have either:

13

 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.

14

 * mistyped the name or version.

15

 * not added the source repo that hosts the Podspec to your Podfile.

16pod exited with non-zero code: 1

Honestly, there was not a single instance where I could smoothly upgrade the SDK…

you can try reverting your code back to a previous commit. That’s what ended up working for me since it appeared to be something that is not in my control.

This looks similar to another dependency version issue I saw recently.

What are your dependencies and devDependencies?

Hi @wodin,

I had to add Expo-image-loader dependency to fix it.
Eventually, both ios and android is working.
Thanks for your help.

@trajano My previous commit is before the upgrade this doesn’t help.

1 Like

Hi @ksi9302

I’m glad you have it working, but it still seems you have some dependency issues.

As you can see here, expo-image-loader is a dependency of expo-barcode-scanner, so it should not be necessary to manually install it in your app:

Can you run npm why expo-image-loader and paste the output here?

Hi Wodin,

Sure, attached below.

expo-image-loader@3.2.0
node_modules/expo-image-loader
  expo-image-loader@"~3.2.0" from the root project
  expo-image-loader@"~3.2.0" from expo-barcode-scanner@11.3.0
  node_modules/expo-barcode-scanner
    expo-barcode-scanner@"~11.3.0" from the root project
  expo-image-loader@"~3.2.0" from expo-image-picker@13.1.1
  node_modules/expo-image-picker
    expo-image-picker@"~13.1.1" from the root project

However, this is after I manually installed the package.
If you need, I can revert and try the command again.

Ok, for someone struggling with similar issue, I got it working with expo updates and sentry as well.

I had to manually install the following version of expo-updates and its peer dependency expo-updates-interface.

"expo-updates": "~0.14.4",
"expo-updates-interface": "^0.7.0",

Turned out sentry expo was not the issue but it requires expo-updates as peer dependency.

Before trying, delete npm cache, package-lock.json and node-modules folder.

Thanks, so from the npm why expo-image-loader output it looks like expo-barcode-scanner does depend on expo-image-loader version 3.2.x, so unless that was slightly out of date and there was a buggy version, it looks like it should have worked fine without you needing to install it manually.

hmmm…

If I create a new Expo SDK 45 project and expo install expo-updates, it installs the following (amongst others):

├─ expo-updates-interface@0.6.0
└─ expo-updates@0.13.4

So I’m not sure you should be installing ~0.14.4 of expo-updates and you shouldn’t have to install expo-updates-interface yourself either.

I agree, I don’t understand why exactly but I’m just glad it’s now working.
Well, I’ll soon have to update to SDK 47 anyway once native-base fix their compatibility issues.