0

Expo EAS build fails on Android: run gradlew

1

Francesco - FL
  • 603
  • 1
  • 4
  • 25
Anicet
  • 49
  • 1
  • 6

3 Answers3

3

I found the error it was enough just to change gradle-7.3.3-all.zip by gradle-7.4-all.zip in yourappName\android\gradle\wrapper\gradle-wrapper.properties

ps : run npx expo prebuild --no-install --platform android before to have android folder

Anicet
  • 49
  • 1
  • 6
1

It looks like Expo EAS build use Gradle version 7.3.3 and some modules require Gradle version 7.4 at minimum.

EAS Build doesn't provide a direct way to change the Gradle version but it provides presets for building infrastructure images.

In the eas.json file, try to use latest image, which contains latest versions of build tools.

{
  "cli": {
    "version": ">= 0.38.2"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal",
      "ios": {
        "simulator": true
      }
    },
    "production": {
      "android": {
        "buildType": "app-bundle",
        "image": "latest"
      }
    }
  },
 
}


Fiston Emmanuel
  • 4,242
  • 1
  • 8
  • 14
0

I had the same problem: an error in "Run gredlew" in Android build (no problem with iOS build) when I upgraded to Expo SDK 47.

The good thing was that I already had a successful build with Expo SDK 47, so I began to downgrade one by one the third-party packages I am using to the same versions of that successful build.

In the end, the culprit was @stripe/stripe-react-native. The build was successful again reverting back to version 0.13.1 from 0.19.0.

In your case, it might be any other third-party package, so I suggest going through the same process.

EDIT 26/01/2023: Instead of downgrading @stripe/stripe-react-native, I followed Kudo's advice here:

the @stripe/stripe-react-native@0.19.0 requires android compileSdkVersion 33. you could use expo-build-properties to change the compileSdkVersion to 33 in a managed project: https://docs.expo.dev/versions/latest/sdk/build-properties/#pluginconfigtypeandroid

RdC1965
  • 412
  • 5
  • 8