Sebastian Labadie
Sebastian Labadie

Reputation: 161

Android build failed using eas build after upgrade SDK

Git Issue: https://github.com/expo/eas-cli/issues/1137

I upgraded my expo project to expo 44.0.0 from expo 41.0.0. While building the project using the command eas build --profile development --platform android , it fails with the above errors. Building with expo expo build:android -t apk --release-channel dev works fine.

Error output

Task :app:checkDebugAarMetadata FAILED
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:checkDebugAarMetadata'.
[stderr] > Multiple task action failures occurred:
[stderr] > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
[stderr] > The minCompileSdk (31) specified in a
[stderr] dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
[stderr] is greater than this module's compileSdkVersion (android-30).
[stderr] Dependency: androidx.camera:camera-view:1.1.0-beta02.
[stderr] AAR metadata file: /home/expo/.gradle/caches/transforms-3/12d1024712f31229ca58ab0bd8d21333/transformed/jetified-camera-view-1.1.0-beta02/META-INF/com/android/build/gradle/aar-metadata.properties.
[stderr] > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
[stderr] > The minCompileSdk (31) specified in a
[stderr] dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
[stderr] is greater than this module's compileSdkVersion (android-30).
[stderr] Dependency: androidx.camera:camera-extensions:1.1.0-beta02.
[stderr] AAR metadata file: /home/expo/.gradle/caches/transforms-3/b2e353b2c9ab37ded94a57d84d9c945e/transformed/jetified-camera-extensions-1.1.0-beta02/META-INF/com/android/build/gradle/aar-metadata.properties.
[stderr] > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
[stderr] > The minCompileSdk (31) specified in a
[stderr] dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
[stderr] is greater than this module's compileSdkVersion (android-30).
[stderr] Dependency: androidx.camera:camera-camera2:1.1.0-beta02.
[stderr] AAR metadata file: /home/expo/.gradle/caches/transforms-3/2675a37f413249dd4d5209666654efc4/transformed/jetified-camera-camera2-1.1.0-beta02/META-INF/com/android/build/gradle/aar-metadata.properties.
[stderr] > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
[stderr] > The minCompileSdk (31) specified in a
[stderr] dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
[stderr] is greater than this module's compileSdkVersion (android-30).
[stderr] Dependency: androidx.camera:camera-lifecycle:1.1.0-beta02.
[stderr] AAR metadata file: /home/expo/.gradle/caches/transforms-3/afe4b84723f7135b1bdead4bacd36e0e/transformed/jetified-camera-lifecycle-1.1.0-beta02/META-INF/com/android/build/gradle/aar-metadata.properties.
[stderr] > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
[stderr] > The minCompileSdk (31) specified in a
[stderr] dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
[stderr] is greater than this module's compileSdkVersion (android-30).
[stderr] Dependency: androidx.camera:camera-video:1.1.0-beta02.
[stderr] AAR metadata file: /home/expo/.gradle/caches/transforms-3/94888a47c690a5797cfc0500a21eeb39/transformed/jetified-camera-video-1.1.0-beta02/META-INF/com/android/build/gradle/aar-metadata.properties.
[stderr] > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
[stderr] > The minCompileSdk (31) specified in a
[stderr] dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
[stderr] is greater than this module's compileSdkVersion (android-30).
[stderr] Dependency: androidx.camera:camera-core:1.1.0-beta02.
[stderr] AAR metadata file: /home/expo/.gradle/caches/transforms-3/1d9440d353cb849104352a1a0b312396/transformed/jetified-camera-core-1.1.0-beta02/META-INF/com/android/build/gradle/aar-metadata.properties.
[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 3m 6s
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
45 actionable tasks: 45 executed
Error: Gradle build failed with unknown error. Please see logs for the "Run gradlew" phase.

Upvotes: 0

Views: 1330

Answers (2)

Alexander Obidiegwu
Alexander Obidiegwu

Reputation: 644

I had this error too and it took me days before I could figure it out. I installed the latest version of java which as of now is jdk 17. Seems the support of this wasn't readily available yet since it was still new. I had to uninstall it and download java version 11 (jdk 11). I equally had issues finding somewhere to download it from without paying or registering. If you need to download this, check out azul

Edit: Ensure to set it as your environment variable in your PC/mac. Control panel > system settings > system > advanced settings > environment variables > system variables > look for JAVA_HOME(or whatever you named yours) and change the path from your old installation folder to your new java 11 installation folder. You must exit from cmd or whatever terminal or version control you are using and restart it for it to get the new path. To check if the app has the new path, in your terminal, type echo %JAVA_HOME%. It should show you the new path of your java installation. Also check if the java version is set too by entering, java -version

Upvotes: 0

alia
alia

Reputation: 300

I've had this issue in one of my projects, I had to use ./gradlew build --warning-mode=all to check which deprecated features were giving me this issue, I believe I fixed it by upgrading one of the dependencies. You can also try to run cd android && ./gradlew clean to clean any cache ( sometimes this also may fix the issue)

Upvotes: 0

Related Questions