Managed workflow
SDK: 44.0.0
Only Android is failing.
iOS works fine on EAS.
Development on Android using expo works fine.
Ninja EDIT for future readers: All of the below issues are caused by using npm
instead of using yarn
. Updates are in later posts. Updating the title to match. The TL;DR below is wrong.
TLDR - Kotlin is busted for some expo packages: [RN 0.66][SDK 44][Android] `expo` package no longer compatible with RN 0.66 (`expo-file-system` issue) · Issue #15632 · expo/expo · GitHub
Is this solvable for those of us on managed workflows?
Summary of other potential discoveries I’m investigating for my own project:
-
expo-sentry
not compatible with commonjs or something, see below. removed it and build moved forward. -
expo-splash-screen
needschalk
? installed chalk as a dependency and build moved forward. -
expo-google-app-aut
h deprecation happened and now it’s broken. Removed it and build moved forward. -
expo-file-system
breaks kotlin? downgraded. Still fails. Upgraded. Still fails.
Here is what I did to try and solve my own issues…
Logs from EAS build
This is where I started
Running './gradlew :app:bundleRelease' in /home/expo/workingdir/build/android
Downloading https://services.gradle.org/distributions/gradle-6.9-all.zip
Unzipping /home/expo/.gradle/wrapper/dists/gradle-6.9-all/dooywd8nv05k16orzxge2b1bs/gradle-6.9-all.zip to /home/expo/.gradle/wrapper/dists/gradle-6.9-all/dooywd8nv05k16orzxge2b1bs
Set executable permissions for: /home/expo/.gradle/wrapper/dists/gradle-6.9-all/dooywd8nv05k16orzxge2b1bs/gradle-6.9/bin/gradle
Welcome to Gradle 6.9!
Here are the highlights of this release:
- This is a small backport release.
- Java 16 can be used to compile when used with Java toolchains
- Dynamic versions can be used within plugin declarations
- Native support for Apple Silicon processors
For more details see https://docs.gradle.org/6.9/release-notes.html
To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/6.9/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build
[stderr] FAILURE: Build completed with 2 failures.
[stderr] 1: Task failed with an exception.
[stderr] -----------
[stderr] * Where:
[stderr] Build file '/home/expo/workingdir/build/android/app/build.gradle' line: 88
[stderr] * What went wrong:
[stderr] A problem occurred evaluating project ':app'.
[stderr] > String index out of range: 0
[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] ==============================================================================
[stderr] 2: Task failed with an exception.
[stderr] -----------
[stderr] * What went wrong:
[stderr] A problem occurred configuring project ':app'.
[stderr] > compileSdkVersion is not specified. Please add it to build.gradle
[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] ==============================================================================
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 1m 1s
Error: Gradle build failed with unknown error. Please see logs for the "Run gradlew" phase.
Debugging Steps:
git checkout master
git clean -fdx
npm install
expo run:android --variant release
Interestingly expo decides to use yarn to install packages… not sure why.
And we get our first failure:
» android: androidNavigationBar.visible: Property is deprecated in Android 11 (API 30) and will be removed from Expo SDK. https://expo.fyi/android-navigation-bar-visible-deprecated
(node:6384) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /Users/adamgross/dev/dealer_ui/node_modules/formik/node_modules/tslib/package.json.
Update this package.json to use a subpath pattern like "./*".
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:6384) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /Users/adamgross/dev/dealer_ui/node_modules/sentry-expo/node_modules/tslib/package.json.
Update this package.json to use a subpath pattern like "./*".
(node:6384) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /Users/adamgross/dev/dealer_ui/node_modules/@sentry/integrations/node_modules/tslib/package.json.
Update this package.json to use a subpath pattern like "./*".
(node:6384) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /Users/adamgross/dev/dealer_ui/node_modules/@sentry/react/node_modules/tslib/package.json.
Update this package.json to use a subpath pattern like "./*".
(node:6384) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /Users/adamgross/dev/dealer_ui/node_modules/@sentry/tracing/node_modules/tslib/package.json.
Update this package.json to use a subpath pattern like "./*".
Using node to generate images. This is much slower than using native packages.
› Optionally you can stop the process and try again after successfully running `npm install -g sharp-cli`.
✖ Config sync failed
[android.dangerous]: withAndroidDangerousBaseMod: Cannot find module 'chalk'
Require stack:
- /Users/adamgross/dev/dealer_ui/node_modules/@expo/image-utils/build/Image.js
- /Users/adamgross/dev/dealer_ui/node_modules/@expo/image-utils/build/index.js
- /Users/adamgross/dev/dealer_ui/node_modules/expo-splash-screen/node_modules/@expo/prebuild-config/build/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.js
- /Users/adamgross/dev/dealer_ui/node_modules/expo-splash-screen/node_modules/@expo/prebuild-config/build/plugins/unversioned/expo-splash-screen/withAndroidSplashScreen.js
- /Users/adamgross/dev/dealer_ui/node_modules/expo-splash-screen/plugin/build/withSplashScreen.js
- /Users/adamgross/dev/dealer_ui/node_modules/expo-splash-screen/app.plugin.js
- /Users/adamgross/.asdf/installs/nodejs/16.13.0/.npm/lib/node_modules/expo-cli/node_modules/@expo/config-plugins/build/utils/plugin-resolver.js
- /Users/adamgross/.asdf/installs/nodejs/16.13.0/.npm/lib/node_modules/expo-cli/node_modules/@expo/config-plugins/build/plugins/withStaticPlugin.js
- /Users/adamgross/.asdf/installs/nodejs/16.13.0/.npm/lib/node_modules/expo-cli/node_modules/@expo/config-plugins/build/plugins/withPlugins.js
- /Users/adamgross/.asdf/installs/nodejs/16.13.0/.npm/lib/node_modules/expo-cli/node_modules/@expo/config-plugins/build/index.js
- /Users/adamgross/.asdf/installs/nodejs/16.13.0/.npm/lib/node_modules/expo-cli/node_modules/@expo/config/build/plugins/withConfigPlugins.js
- /Users/adamgross/.asdf/installs/nodejs/16.13.0/.npm/lib/node_modules/expo-cli/node_modules/@expo/config/build/Config.js
- /Users/adamgross/.asdf/installs/nodejs/16.13.0/.npm/lib/node_modules/expo-cli/node_modules/@expo/config/build/index.js
- /Users/adamgross/.asdf/installs/nodejs/16.13.0/.npm/lib/node_modules/expo-cli/node_modules/@expo/metro-config/build/ExpoMetroConfig.js
- /Users/adamgross/.asdf/installs/nodejs/16.13.0/.npm/lib/node_modules/expo-cli/build/exp.js
- /Users/adamgross/.asdf/installs/nodejs/16.13.0/.npm/lib/node_modules/expo-cli/bin/expo.js
So something with expo-splash-screen breaks from the chalk
package? I do have "expo-splash-screen": "~0.14.1",
listed as a dependency in my package.json
. So maybe a transient dependency problem?
If I re-run the exact same command after taking no action, it goes farther:
❯ expo run:android --variant release
› Building app...
⚠️ Cannot resolve the path to "babel-loader" package.
Configuration on demand is an incubating feature.
> Configure project :expo-file-system
WARNING: Configuration 'testApi' is obsolete and has been replaced with 'testImplementation'.
It will be removed in version 5.0 of the Android Gradle plugin.
For more information, see http://d.android.com/r/tools/update-dependency-configurations.html.
> Configure project :expo-structured-headers
Warning: The 'kotlin-android-extensions' Gradle plugin is deprecated. Please use this migration guide (https://goo.gle/kotlin-android-extensions-deprecation) to start working with View Binding (https://developer.android.com/topic/libraries/view-binding) and the 'kotlin-parcelize' plugin.
> Configure project :expo
Using expo modules
- expo-app-auth (11.1.1)
- expo-application (4.0.2)
- expo-constants (13.0.2)
- expo-crypto (10.1.2)
- expo-device (4.1.1)
- expo-facebook (12.1.1)
- expo-file-system (13.1.4)
- expo-font (10.1.0)
- expo-haptics (11.1.1)
- expo-json-utils (0.2.1)
- expo-keep-awake (10.0.2)
- expo-linear-gradient (11.0.3)
- expo-localization (12.0.1)
- expo-manifests (0.2.4)
- expo-modules-core (0.6.5)
- expo-notifications (0.14.1)
- expo-screen-orientation (4.1.2)
- expo-splash-screen (0.14.2)
- expo-structured-headers (2.1.1)
- expo-updates (0.11.7)
- react-native-reanimated (2.3.3)
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileReleaseJavaWithJavac'.
> Cannot query the value of this provider because it has no value available.
So now I backtrack to the chalk problem:
❯ expo install chalk
Installing 1 other package using Yarn.
> yarn add chalk
yarn add v1.22.17
warning ../../package.json: No license field
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 🔨 Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
└─ chalk@5.0.1
info All dependencies
└─ chalk@5.0.1
✨ Done in 4.44s.
Looks like I got converted to yarn
❯ expo run:android --variant release
require() of ES Module /Users/adamgross/dev/dealer_ui/node_modules/chalk/source/index.js from /Users/adamgross/dev/dealer_ui/node_modules/sentry-expo/node_modules/@expo/config-plugins/build/plugins/withMod.js not supported.
Instead change the require of index.js in /Users/adamgross/dev/dealer_ui/node_modules/sentry-expo/node_modules/@expo/config-plugins/build/plugins/withMod.js to a dynamic import() which is available in all CommonJS modules.
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/adamgross/dev/dealer_ui/node_modules/chalk/source/index.js from /Users/adamgross/dev/dealer_ui/node_modules/sentry-expo/node_modules/@expo/config-plugins/build/plugins/withMod.js not supported.
Instead change the require of index.js in /Users/adamgross/dev/dealer_ui/node_modules/sentry-expo/node_modules/@expo/config-plugins/build/plugins/withMod.js to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (/Users/adamgross/dev/dealer_ui/node_modules/sentry-expo/node_modules/@expo/config-plugins/build/plugins/withMod.js:7:33)
at Object.<anonymous> (/Users/adamgross/dev/dealer_ui/node_modules/sentry-expo/node_modules/@expo/config-plugins/build/plugins/android-plugins.js:4:19)
at Object.<anonymous> (/Users/adamgross/dev/dealer_ui/node_modules/sentry-expo/node_modules/@expo/config-plugins/build/android/AllowBackup.js:4:27)
at Object.<anonymous> (/Users/adamgross/dev/dealer_ui/node_modules/sentry-expo/node_modules/@expo/config-plugins/build/android/index.js:23:34)
at Object.<anonymous> (/Users/adamgross/dev/dealer_ui/node_modules/sentry-expo/node_modules/@expo/config-plugins/build/index.js:29:36)
at Object.<anonymous> (/Users/adamgross/dev/dealer_ui/node_modules/sentry-expo/plugin/build/withSentry.js:4:26)
at Object.<anonymous> (/Users/adamgross/dev/dealer_ui/node_modules/sentry-expo/app.plugin.js:1:18)
at requirePluginFile (/Users/adamgross/.asdf/installs/nodejs/16.13.0/.npm/lib/node_modules/expo-cli/node_modules/@expo/config-plugins/build/utils/plugin-resolver.js:258:12)
at resolveConfigPluginFunctionWithInfo (/Users/adamgross/.asdf/installs/nodejs/16.13.0/.npm/lib/node_modules/expo-cli/node_modules/@expo/config-plugins/build/utils/plugin-resolver.js:192:14)
at resolveConfigPluginFunction (/Users/adamgross/.asdf/installs/nodejs/16.13.0/.npm/lib/node_modules/expo-cli/node_modules/@expo/config-plugins/build/utils/plugin-resolver.js:179:7)
at withStaticPlugin (/Users/adamgross/.asdf/installs/nodejs/16.13.0/.npm/lib/node_modules/expo-cli/node_modules/@expo/config-plugins/build/plugins/withStaticPlugin.js:108:70)
at /Users/adamgross/.asdf/installs/nodejs/16.13.0/.npm/lib/node_modules/expo-cli/node_modules/@expo/config-plugins/build/plugins/withPlugins.js:38:84
at Array.reduce (<anonymous>)
at withPlugins (/Users/adamgross/.asdf/installs/nodejs/16.13.0/.npm/lib/node_modules/expo-cli/node_modules/@expo/config-plugins/build/plugins/withPlugins.js:38:18)
at withConfigPlugins (/Users/adamgross/.asdf/installs/nodejs/16.13.0/.npm/lib/node_modules/expo-cli/node_modules/@expo/config/build/plugins/withConfigPlugins.js:45:47)
at fillAndReturnConfig (/Users/adamgross/.asdf/installs/nodejs/16.13.0/.npm/lib/node_modules/expo-cli/node_modules/@expo/config/build/Config.js:315:78)
at getConfig (/Users/adamgross/.asdf/installs/nodejs/16.13.0/.npm/lib/node_modules/expo-cli/node_modules/@expo/config/build/Config.js:378:12)
at actionAsync (/Users/adamgross/.asdf/installs/nodejs/16.13.0/.npm/lib/node_modules/expo-cli/build/commands/run/android/runAndroid.js:300:31)
So now maybe something with sentry-expo
? Sentry source-maps aren’t uploading right on this project, so maybe the two are related. For now, I’ll remove sentry-expo and see if this gets farther.
I removed the hooks and plugins list from my app.config.ts
(both specific only to sentry-expo on my project), removed it from package.json
, and removed usages of it from my codebase.
❯ expo run:android --variant release
› Building app...
⚠️ Cannot resolve the path to "babel-loader" package.
Configuration on demand is an incubating feature.
> Configure project :expo-file-system
WARNING: Configuration 'testApi' is obsolete and has been replaced with 'testImplementation'.
It will be removed in version 5.0 of the Android Gradle plugin.
For more information, see http://d.android.com/r/tools/update-dependency-configurations.html.
> Configure project :expo-structured-headers
Warning: The 'kotlin-android-extensions' Gradle plugin is deprecated. Please use this migration guide (https://goo.gle/kotlin-android-extensions-deprecation) to start working with View Binding (https://developer.android.com/topic/libraries/view-binding) and the 'kotlin-parcelize' plugin.
> Configure project :expo
Using expo modules
- expo-app-auth (11.1.1)
- expo-application (4.0.2)
- expo-constants (13.0.2)
- expo-crypto (10.1.2)
- expo-device (4.1.1)
- expo-facebook (12.1.1)
- expo-file-system (13.1.4)
- expo-font (10.1.0)
- expo-haptics (11.1.1)
- expo-json-utils (0.2.1)
- expo-keep-awake (10.0.2)
- expo-linear-gradient (11.0.3)
- expo-localization (12.0.1)
- expo-manifests (0.2.4)
- expo-modules-core (0.6.5)
- expo-notifications (0.14.1)
- expo-screen-orientation (4.1.2)
- expo-splash-screen (0.14.2)
- expo-structured-headers (2.1.1)
- expo-updates (0.11.7)
- react-native-reanimated (2.3.3)
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileReleaseJavaWithJavac'.
> Cannot query the value of this provider because it has no value available.
* Try:
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.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 9s
/Users/adamgross/dev/dealer_ui/android/gradlew exited with non-zero code: 1
Error: /Users/adamgross/dev/dealer_ui/android/gradlew exited with non-zero code: 1
at ChildProcess.completionListener (/Users/adamgross/.asdf/installs/nodejs/16.13.0/.npm/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:65:13)
at Object.onceWrapper (node:events:510:26)
at ChildProcess.emit (node:events:390:28)
at maybeClose (node:internal/child_process:1064:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
...
at spawnAsync (/Users/adamgross/.asdf/installs/nodejs/16.13.0/.npm/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:26:19)
at spawnGradleAsync (/Users/adamgross/.asdf/installs/nodejs/16.13.0/.npm/lib/node_modules/expo-cli/src/commands/run/android/spawnGradleAsync.ts:83:18)
at assembleAsync (/Users/adamgross/.asdf/installs/nodejs/16.13.0/.npm/lib/node_modules/expo-cli/src/commands/run/android/spawnGradleAsync.ts:57:16)
at actionAsync (/Users/adamgross/.asdf/installs/nodejs/16.13.0/.npm/lib/node_modules/expo-cli/src/commands/run/android/runAndroid.ts:143:9)
Off to google I go. Was missing an env var:
export ANDROID_HOME=/Users/adamgross/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
❯ expo run:android --variant release
#....
#....
#....
> Task :app:processReleaseMainManifest FAILED
[:react-native-reanimated] /Users/adamgross/dev/dealer_ui/node_modules/react-native-reanimated/android/build/intermediates/library_manifest/release/AndroidManifest.xml Warning:
Package name 'com.swmansion.reanimated' used in: :react-native-reanimated, react-native-reanimated-64-jsc.aar.
/Users/adamgross/dev/dealer_ui/android/app/src/main/AndroidManifest.xml Error:
Attribute data@scheme at AndroidManifest.xml requires a placeholder substitution but no value for <appAuthRedirectScheme> is provided.
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processReleaseMainManifest'.
Ok, been doing all the things… let’s clean gradle and try again.
❯ cd android
❯ ./gradlew clean
❯ expo run:android --variant release
#....
#....
#....
> Task :app:processReleaseMainManifest FAILED
[:react-native-reanimated] /Users/adamgross/dev/dealer_ui/node_modules/react-native-reanimated/android/build/intermediates/library_manifest/release/AndroidManifest.xml Warning:
Package name 'com.swmansion.reanimated' used in: :react-native-reanimated, react-native-reanimated-64-jsc.aar.
/Users/adamgross/dev/dealer_ui/android/app/src/main/AndroidManifest.xml Error:
Attribute data@scheme at AndroidManifest.xml requires a placeholder substitution but no value for <appAuthRedirectScheme> is provided.