expo run:android error

I have a managed expo project with expo-dev-client. I got the following error when running expo run:android. Could anyone points me to the right direction? I don’t know which part of error is causing the development build to fail…

> Configure project :expo-application
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.

> Configure project :expo-av
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* Where:
Script '/Users/hayatasuenaga/Job/personal-projects/eisuke-mobile-app/node_modules/expo-modules-autolinking/scripts/android/autolinking_implementation.gradle' line: 272

* What went wrong:
A problem occurred evaluating project ':expo'.
> A problem occurred configuring project ':expo-av'.
   > Failed to notify project evaluation listener.
      > com.android.builder.errors.EvalIssueException: SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/hayatasuenaga/Job/personal-projects/eisuke-mobile-app/android/local.properties'.
      > Could not get unknown property 'release' for SoftwareComponentInternal set of type org.gradle.api.internal.component.DefaultSoftwareComponentContainer.

* Try:
> 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':expo'.
> com.android.builder.errors.EvalIssueException: compileSdkVersion is not specified. Please add it to build.gradle

* Try:
> 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.
==============================================================================

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 10s
6 actionable tasks: 6 up-to-date
Error: /Users/hayatasuenaga/Job/personal-projects/eisuke-mobile-app/android/gradlew exited with non-zero code: 1
Error: /Users/hayatasuenaga/Job/personal-projects/eisuke-mobile-app/android/gradlew exited with non-zero code: 1
    at ChildProcess.completionListener (/Users/hayatasuenaga/Job/personal-projects/eisuke-mobile-app/node_modules/@expo/spawn-async/build/spawnAsync.js:52:23)
    at Object.onceWrapper (events.js:483:26)
    at ChildProcess.emit (events.js:376:20)
    at maybeClose (internal/child_process.js:1055:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
    ...
    at Object.spawnAsync [as default] (/Users/hayatasuenaga/Job/personal-projects/eisuke-mobile-app/node_modules/@expo/spawn-async/build/spawnAsync.js:17:21)
    at spawnGradleAsync (/Users/hayatasuenaga/Job/personal-projects/eisuke-mobile-app/node_modules/@expo/cli/build/src/start/platforms/android/gradle.js:72:46)
    at Object.assembleAsync (/Users/hayatasuenaga/Job/personal-projects/eisuke-mobile-app/node_modules/@expo/cli/build/src/start/platforms/android/gradle.js:52:18)
    at runAndroidAsync (/Users/hayatasuenaga/Job/personal-projects/eisuke-mobile-app/node_modules/@expo/cli/build/src/run/android/runAndroidAsync.js:31:24)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

Did you figure this out?

If you have a managed setup with dev client, you’ll generally want to run npx expo start --dev-client. expo run:android is for building and running a local build of your android version. It requires that the Android SDK and build tools be setup on your system. This can be done for a dev client, but usually is not necessary. You’ll generally want to follow the “With EAS” instructions here.

1 Like

Ah ok, so run an eas build, then install it on the emulator and run dev-client?

that’s correct!

1 Like