expo: Android internal distribution build fail for sdk45
Summary
I am trying to build an android preview using eas build -p android --profile preview, however, the build fails. The build fails in “run gradlew”. Here is the last thing that was outputted:
> Task :expo-manifests:compileReleaseKotlin
w: /home/expo/workingdir/build/node_modules/expo-manifests/android/src/main/java/expo/modules/manifests/core/BaseLegacyManifest.kt: (10, 86): 'getLegacyID(): String' is deprecated. Prefer scopeKey or projectId depending on use case
w: /home/expo/workingdir/build/node_modules/expo-manifests/android/src/main/java/expo/modules/manifests/core/BaseLegacyManifest.kt: (12, 72): 'getStableLegacyID(): String?' is deprecated. Overrides deprecated member in 'expo.modules.manifests.core.Manifest'. Prefer scopeKey or projectId depending on use case
w: /home/expo/workingdir/build/node_modules/expo-manifests/android/src/main/java/expo/modules/manifests/core/Manifest.kt: (28, 12): 'getRawJson(): JSONObject' is deprecated. Prefer to use specific field getters
> Task :expo-manifests:javaPreCompileRelease
> Task :expo-manifests:compileReleaseJavaWithJavac
> Task :expo-manifests:bundleLibCompileToJarRelease
> Task :expo-dev-menu:compileReleaseKotlin
[stderr] e: /home/expo/workingdir/build/node_modules/expo-dev-menu/android/src/main/java/expo/modules/devmenu/modules/internals/DevMenuInternalFontManagerModule.kt: (11, 20): Unresolved reference: loadFonts
> Task :expo-dev-menu:compileReleaseKotlin FAILED
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':expo-dev-menu:compileReleaseKotlin'.
[stderr] > A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
[stderr] > Compilation error. See log for more details
[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] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 12m 17s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!
managed
What platform(s) does this occur on?
Android
SDK Version (managed workflow only)
45
Environment
expo-env-info 1.0.3 environment info: System: OS: Windows 10 10.0.19044 Binaries: Node: 16.14.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD npm: 8.3.1 - C:\Program Files\nodejs\npm.CMD npmPackages: expo: ^45.0.0-beta.8 => 45.0.0-beta.8 react: 17.0.2 => 17.0.2 react-dom: 17.0.2 => 17.0.2 react-native: 0.68.1 => 0.68.1 react-native-web: 0.17.1 => 0.17.1 Expo Workflow: managed
Reproducible demo
It is a full on project. I am not sure I am able to provide a small reproducible. I hope the log from “run gradlew” is enough
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 25 (16 by maintainers)
A new version of the dev menu should be available today or tomorrow. I’m really sorry that you have to wait for that patch.
No, it does update Expo dependencies when you upgrade to a new SDK and prints out a list of the upgraded dependencies. But I think there were some things that were updated after the initial SDK 45 release to fix bugs, so if you ran the upgrade again after those fixes it would have updated to the fixed versions. I suspect that’s what happened.
expo doctor is what caught it, expo upgrade did not.
I haven’t got the expo doctor output any more right now sorry - we went back to Expo 44 for now due to the Android crash with https://github.com/expo/expo/issues/17478 once it had finally built 😃
Ack. I removed an old version of
expo-screen-capture(3.2.0) which relied on@unimodules/core@~7.1.1which was probably causing the above error and it’s now building fine on Android for Managed SDK 45. Probably the newer version of expo-screen-capture would work fine too, butexpo upgradedidn’t catch this. I can reproducibly get it to fail/succeed by putting back in and taking it out.Thank you for the awesome work and sorry to hijack the thread. Good luck everyone!
@nikodunk - the update is out - what version of expo-dev-client is installed in your project? the latest is 0.9.5
@ramiel1999 as a temporary workaround until a new version of
expo-dev-menuis released you can usepatch-package.Basically, put the following file in a
patchesdirectory:patches/expo-dev-menu+0.10.4.patch:Add a
post-installscript topackage.json:Then install
patch-packageand if you’re usingyarn, also installpostinstall-postinstall. I’d install these as dev dependencies.Then you should be able to build.
It gets installed automatically when you install
expo-dev-client:After it’s merged they still need to make a release of the
expo-dev-menupackage. Version0.10.4has the bug. I’m busy trying a build after applying the patch from that PR usingpatch-package. Will let you know if it works (as a temporary workaround).EDIT: Here’s the changelog showing that the fix is not yet part of a released version of
expo-dev-menu: https://github.com/expo/expo/blob/sdk-45/packages/expo-dev-menu/CHANGELOG.md