Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I encounter an error when running eas build --platform android --local, but there is no error if it's not a local build. #2132

Closed
x007xyz opened this issue Nov 24, 2023 · 3 comments
Labels
needs review Issue is ready to be reviewed by a maintainer

Comments

@x007xyz
Copy link

x007xyz commented Nov 24, 2023

Build/Submit details page URL

No response

Summary

I encounter an error when running eas build --platform android --local, but there is no error if it's not a local build.

Managed or bare?

bare

Environment

[RUN_EXPO_DOCTOR] Running "expo doctor"
[RUN_EXPO_DOCTOR] Running 10 checks on your project...
[RUN_EXPO_DOCTOR] ✔ Check Expo config for common issues
[RUN_EXPO_DOCTOR] ✔ Check package.json for common issues
[RUN_EXPO_DOCTOR] ✔ Check dependencies for packages that should not be installed directly
[RUN_EXPO_DOCTOR] ✔ Check for common project setup issues
[RUN_EXPO_DOCTOR] ✔ Check npm/ yarn versions
[RUN_EXPO_DOCTOR] ✔ Check for legacy global CLI installed locally
[RUN_EXPO_DOCTOR] ✔ Check that native modules do not use incompatible support packages
[RUN_EXPO_DOCTOR] ✔ Check Expo config (app.json/ app.config.js) schema
[RUN_EXPO_DOCTOR] ✔ Check that packages match versions required by installed Expo SDK
[RUN_EXPO_DOCTOR] ✔ Check that native modules use compatible support package versions for installed Expo SDK
[RUN_EXPO_DOCTOR] Didn't find any issues with the project!

Error output

[PREBUILD] Running "npm install" in /var/folders/yx/ss8k_ymj7z9cxkgk1vdrdmxr0000gn/T/eas-build-local-nodejs/d1396930-e426-4c3b-9feb-e2e54f322e5e/build directory
[PREBUILD] up to date in 3m
[PREPARE_CREDENTIALS] Writing secrets to the project's directory
[PREPARE_CREDENTIALS] Injecting signing config into build.gradle
[RUN_GRADLEW] Running 'gradlew :app:bundleRelease' in /var/folders/yx/ss8k_ymj7z9cxkgk1vdrdmxr0000gn/T/eas-build-local-nodejs/d1396930-e426-4c3b-9feb-e2e54f322e5e/build/android
[RUN_GRADLEW] > Task :gradle-plugin:pluginDescriptors
[RUN_GRADLEW] > Task :gradle-plugin:processResources
[RUN_GRADLEW] > Task :gradle-plugin:compileKotlin
[RUN_GRADLEW] > Task :gradle-plugin:compileJava NO-SOURCE
[RUN_GRADLEW] > Task :gradle-plugin:classes
[RUN_GRADLEW] > Task :gradle-plugin:jar
[RUN_GRADLEW] > Task :gradle-plugin:inspectClassesForKotlinIC
[RUN_GRADLEW] FAILURE: Build completed with 2 failures.
[RUN_GRADLEW] 1: Task failed with an exception.
[RUN_GRADLEW] -----------
[RUN_GRADLEW] * Where:
[RUN_GRADLEW] Script '/private/var/folders/yx/ss8k_ymj7z9cxkgk1vdrdmxr0000gn/T/eas-build-local-nodejs/d1396930-e426-4c3b-9feb-e2e54f322e5e/build/node_modules/expo-modules-autolinking/scripts/android/autolinking_implementation.gradle' line: 356
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] A problem occurred evaluating project ':expo'.
[RUN_GRADLEW] > A problem occurred configuring project ':expo-modules-core'.
[RUN_GRADLEW] > Failed to notify project evaluation listener.
[RUN_GRADLEW] >
[RUN_GRADLEW] com.android.builder.errors.EvalIssueException: SDK location not found. Define a valid SDK location with an ANDROID_HOME environment variable or by setting the sdk.dir path in your project's local properties file at '/private/var/folders/yx/ss8k_ymj7z9cxkgk1vdrdmxr0000gn/T/eas-build-local-nodejs/d1396930-e426-4c3b-9feb-e2e54f322e5e/build/android/local.properties'.
[RUN_GRADLEW] >
[RUN_GRADLEW] Could not get unknown property 'release' for SoftwareComponentInternal set of type org.gradle.api.internal.component.DefaultSoftwareComponentContainer.
[RUN_GRADLEW] * Try:
[RUN_GRADLEW] > Run with --stacktrace option to get the stack trace.
[RUN_GRADLEW] > Run with --info or --debug option to get more log output.
[RUN_GRADLEW] > Run with --scan to get full insights.
[RUN_GRADLEW] ==============================================================================
[RUN_GRADLEW] 2: Task failed with an exception.
[RUN_GRADLEW] -----------
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] A problem occurred configuring project ':expo'.
[RUN_GRADLEW] > com.android.builder.errors.EvalIssueException: compileSdkVersion is not specified. Please add it to build.gradle
[RUN_GRADLEW] * Try:
[RUN_GRADLEW] > Run with --stacktrace option to get the stack trace.
[RUN_GRADLEW] > Run with --info or --debug option to get more log output.
[RUN_GRADLEW] > Run with --scan to get full insights.
[RUN_GRADLEW] ==============================================================================
[RUN_GRADLEW] * Get more help at https://help.gradle.org
[RUN_GRADLEW] BUILD FAILED in 8s
[RUN_GRADLEW] 5 actionable tasks: 5 executed
[RUN_GRADLEW] Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

Build failed
Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
npx exited with non-zero code: 1
Error: build command failed.

Reproducible demo or steps to reproduce from a blank project

run:

eas build --platform android --local
@x007xyz x007xyz added the needs review Issue is ready to be reviewed by a maintainer label Nov 24, 2023
@szdziedzic
Copy link
Member

Hi, it seems like your local setup is broken. Do you have the ANDROID_HOME env var set?

@x007xyz
Copy link
Author

x007xyz commented Nov 25, 2023

After setting the CMake version to 3.22.1 and configuring the environment variable ANDROID_HOME, everything should be good.

@x007xyz x007xyz closed this as completed Nov 25, 2023
@TomasSestak
Copy link

Im getting this error even tho npx expo run:android works fine and is having the corrects env and sdk path...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review Issue is ready to be reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

3 participants