EAS build using eas build -p android fails due to a gradle error and it seems to be related to @react-native-async-storage/async-storage and com.facebook.react.module.annotations. Building using expo build works fine though. Any ideas?
Related issue in github
Related issue in stackoverflow
My Environment
“expo”: “44.0.0”
“@react-native-async-storage/async-storage”: “1.16.1”,
Task :react-native-async-storage_async-storage:compileReleaseJavaWithJavac
[stderr] /home/expo/workingdir/build/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageModule.java:27: error: package com.facebook.react.module.annotations does not exist
[stderr] import com.facebook.react.module.annotations.ReactModule;
[stderr] ^
[stderr] /home/expo/workingdir/build/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageModule.java:35: error: cannot find symbol
[stderr] @ReactModule(name = AsyncStorageModule.NAME)
[stderr] ^
[stderr] symbol: class ReactModule
[stderr] Note: /home/expo/workingdir/build/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageModule.java uses or overrides a deprecated API.
[stderr] Note: Recompile with -Xlint:deprecation for details.
[stderr] Note: /home/expo/workingdir/build/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStoragePackage.java uses unchecked or unsafe operations.
[stderr] Note: Recompile with -Xlint:unchecked for details.
[stderr] 2 errors
Task :react-native-async-storage_async-storage:compileReleaseJavaWithJavac FAILED
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ‘:react-native-async-storage_async-storage:compileReleaseJavaWithJavac’.
[stderr] > Compilation failed; see the compiler error output for 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 to get full insights.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 4m 41s
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 Command-Line Interface
232 actionable tasks: 232 executed
Error: Gradle build failed with unknown error. Please see logs for the “Run gradlew” phase.