expo / eas-cli

Fastest way to build, submit, and update iOS and Android apps
https://docs.expo.dev/eas/
MIT License
824 stars 84 forks source link

Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information. #2325

Closed aleksi-p closed 6 months ago

aleksi-p commented 6 months ago

Build/Submit details page URL

No response

Summary

I am trying to build the Android apk but it always fails with "Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.". I ran npx expo-doctor, it finishes with "Didn't find any issues with the project!". I checked all dependencies etc. but can find the error.

Any ideas?

Thank you guys

Managed or bare?

Managed

Environment

expo-env-info 1.2.0 environment info: System: OS: Windows 11 10.0.22631 Binaries: Node: 20.12.1 - C:\Program Files\nodejs\node.EXE npm: 10.5.0 - C:\Program Files\nodejs\npm.CMD SDKs: Android SDK: API Levels: 30, 31, 34 Build Tools: 30.0.3, 31.0.0, 32.0.0, 33.0.0, 34.0.0 System Images: android-30 | Intel x86_64 Atom, android-31 | Intel x86_64 Atom, android-33 | Intel x86_64 Atom, android-33 | Google Play Intel x86_64 Atom, android-34 | Google APIs Intel x86_64 Atom IDEs: Android Studio: AI-232.10300.40.2321.11567975 npmPackages: expo: ^50.0.0 => 50.0.15 react: 18.2.0 => 18.2.0 react-native: 0.73.6 => 0.73.6 Expo Workflow: bare

Error output

Running 'gradlew :app:assembleRelease' in /home/expo/workingdir/build/android Downloading https://services.gradle.org/distributions/gradle-8.3-all.zip 10% 20%. 30%. 40%. 50% 60%. 70%. 80%. 90%. 100% Welcome to Gradle 8.3! Here are the highlights of this release:

Reproducible demo or steps to reproduce from a blank project

eas build -p android --profile preview

eas.json { "cli": { "version": ">= 7.8.1" }, "build": { "development": { "developmentClient": true, "distribution": "internal" }, "preview": { "android": { "buildType": "apk" } }, "production": {} }, "submit": { "production": {} } }

aleksi-p commented 6 months ago

build.gradle was wrong. After re-install of the package @react-native-community/netinfo and adjusting the build.gradle, it finally worked.

buildscript { ext { buildToolsVersion = findProperty('android.buildToolsVersion') ?: '34.0.0' minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '23') compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '34') targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '34') kotlinVersion = findProperty('android.kotlinVersion') ?: '1.8.10'