1

I’m trying to build my Expo project using npx eas build --platform android but the build keeps failing due to Android SDK version mismatches and native dependency compatibility issues.

The app runs perfectly fine in development using npx expo start but every time I try to create a production build EAS fails often showing errors related to android SDK version, and missing Android resources like:

Execution failed for task ':app:bundleReleaseResources'.> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2ProcessResourcesRunnable > Android resource linking failed ERROR:/home/expo/workingdir/build/android/app/build/intermediates/incremental/release/mergeReleaseResources/merged.dir/values-v34/values-v34.xml:3: AAPT: error: resource android:color/system_background_dark not found.

and many more similar missing android resource errors, this is just one to give idea.

Also it said this:

A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction 
> 7 issues were found when checking AAR metadata: 
1. Dependency 'androidx.activity:activity-ktx:1.8.0' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. 
:app is currently compiled against android-33. 
Also, the maximum recommended compile SDK version for Android Gradle plugin 7.4.2 is 33.
 
Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compileSdkVerion of at least 34.

It also recommends upgrading to Android SDK 34 or 35, but when I try to upgrade or prebuild (which creates the android folder), it leads to multiple Gradle and namespace-related issues.I want to avoid ejecting or dealing with native code (android/ios folders) and keep my project managed under Expo, but still produce a working Android build.

Versions:

 "expo": "^49.0.6",
 "react-native": "0.72.10",

compileSdkVersion, targetSdkVersion & buildToolsVersion = 33
gradle = 7.5

**NOTE: **
I checked these android versions, when i ejected the android folder.
Also i followed the expo documentation step by step to create the build - https://docs.expo.dev/build/setup/

Here’s what I tried so far:

  1. Ran expo-doctor and fixed version mismatches wherever possible.

  2. Tried cleaning the Gradle and build cache and rebuilding.

  3. Updated Android Gradle plugin and Gradle version manually to 8.1 when the build complained about compatibility.

  4. Tried setting compileSdkVersion, targetSdkVersion, and minSdkVersion manually to 34 after prebuild.

  5. Also tried running npx expo prebuild and adjusting the generated files but each time, more native-level issues appeared (namespace errors, AGP mismatches, etc.).

  6. After attempting to do all this even a simple ./gradle clean kept failing.

asked Oct 15 at 11:33
2
  • 1
    The RN and Expo versions you are using are pretty dated. Have you considered upgrading? Commented Oct 15 at 13:00
  • Updating the expo did seem to solve the issue, it automatically upgraded the reactnative and sdk versions as well. Although there were a few version conflicts in the dependancies but were easily solved. Commented 2 days ago

1 Answer 1

1

What happens if you update expo to the latest version (e.g. 54.0.13 ), run expo-doctor again to fix any issues, and then build?

I think that'd be a good first step, and it would also update your Android API to the latest version (36, I think) :)

answered Oct 15 at 22:17
Sign up to request clarification or add additional context in comments.

2 Comments

Updating the expo did seem to solve the issue, it automatically upgraded the reactnative and sdk versions as well. Although there were a few version conflicts in the dependancies but were easily solved.
Good to hear! :)

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.