eas build -p android failed with message Unresolved reference: ModulePriorities

I had run “eas build” in managed workflow and build successfully previously, but after update my eas-cli version to 0.45.1, I having this issue when running cmd “eas build -p android” and “eas build -p ios”

expo build is success, but eas build -p ios will be failed with following message:

Installing pods
[!] Invalid Podfile file: cannot load such file – /Users/expo/workingdir/build/node_modules/expo-modules-autolinking/scripts/ios/react_import_patcher.

from /Users/expo/workingdir/build/ios/Podfile:1

-------------------------------------------

require File.join(File.dirname(node --print "require.resolve('expo/package.json')"), “scripts/autolinking”)

require File.join(File.dirname(node --print "require.resolve('react-native/package.json')"), “scripts/react_native_pods”)

-------------------------------------------

pod exited with non-zero code: 1

while eas build -p android error message as below:

Task :expo:compileReleaseKotlin FAILED
[stderr] e: /root/workingdir/build/node_modules/expo/android/src/main/java/expo/modules/ExpoModulesPackage.kt: (11, 26): Unresolved reference: ModulePriorities
[stderr] e: /root/workingdir/build/node_modules/expo/android/src/main/java/expo/modules/ExpoModulesPackage.kt: (26, 33): Unresolved reference: ModulePriorities
[stderr] e: /root/workingdir/build/node_modules/expo/android/src/main/java/expo/modules/ReactActivityDelegateWrapper.kt: (26, 14): Type mismatch: inferred type is Unit but Iterable<TypeVariable(R)> was expected
[stderr] e: /root/workingdir/build/node_modules/expo/android/src/main/java/expo/modules/ReactActivityDelegateWrapper.kt: (26, 19): Unresolved reference: createReactActivityHandlers
[stderr] e: /root/workingdir/build/node_modules/expo/android/src/main/java/expo/modules/ReactActivityDelegateWrapper.kt: (37, 21): Unresolved reference: it
[stderr] e: /root/workingdir/build/node_modules/expo/android/src/main/java/expo/modules/ReactActivityDelegateWrapper.kt: (120, 8): Not enough information to infer type variable R
[stderr] e: /root/workingdir/build/node_modules/expo/android/src/main/java/expo/modules/ReactActivityDelegateWrapper.kt: (120, 44): Unresolved reference: onBackPressed
[stderr] e: /root/workingdir/build/node_modules/expo/android/src/main/java/expo/modules/ReactActivityDelegateWrapper.kt: (128, 17): Unresolved reference: onNewIntent
[stderr] e: /root/workingdir/build/node_modules/expo/android/src/main/java/expo/modules/ReactActivityDelegateWrapper.kt: (129, 47): Type mismatch: inferred type is Unit but Boolean was expected
[stderr] e: /root/workingdir/build/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt: (28, 15): Unresolved reference: onWillCreateReactInstanceManager
[stderr] e: /root/workingdir/build/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt: (36, 15): Unresolved reference: onDidCreateReactInstanceManager
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ‘:expo:compileReleaseKotlin’.
[stderr] > Compilation error. See log for more details
[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
[stderr] * Get more help at https://help.gradle.org
[stderr] to get full insights.
[stderr] BUILD FAILED in 5m 55s

I have tried delete the node_modules folder and package.json.lock, and then npm install for few times, still having same error, any caching or configuration I should clear or change?

can you share a link to your build pages?

also, see Troubleshooting build errors and crashes - Expo Documentation

Hi, below is the Build Details link I encounter failed when build android:

it looks like you have @unimodules/react-native-adapter installed in your project - this library was replaced by the expo package in sdk 43 (more info). see this warning in the logs:

[stderr] warn Package @unimodules/react-native-adapter has been ignored because it contains invalid configuration. Reason: "dependency.platforms.android" must be of type object

you can look in your npm lockfile to see which package is pulling this in. it may not be directly installed in your project but instead installed via some other library. in addition to that, run expo doctor to see if any of the expo sdk packages are outdated.

hi, yes you are right, I remove the @unimodules/react-native-adapter and run “expo upgrade 44” solve the issue

1 Like

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