androidreact-nativeexpo

npx expo run:android fails


I am trying to make an app in expo and end up getting an error even if I don't change any code. Default boilerplate and tried changing versions.

  1. I run `npx expo create-expo-app@latest ./'
  2. Then I connect my android device adb connect ip:5555`
  3. Then I run npx expo run:android

And I get this error. Note: I changed nothing here


> Task :expo-modules-core:configureCMakeDebug[arm64-v8a] FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':expo-modules-core:configureCMakeDebug[arm64-v8a]'.
> [CXX1210] /home/balpreet/Projects/ledgo-expo/node_modules/expo-modules-core/android/CMakeLists.txt debug|arm64-v8a : No compatible library found

* 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.

BUILD FAILED in 2m 16s
299 actionable tasks: 160 executed, 139 from cache
Error: /home/balpreet/Projects/ledgo-expo/android/gradlew app:assembleDebug -x lint -x test --configure-on-demand --build-cache -PreactNativeDevServerPort=8081 -PreactNativeArchitectures=arm64-v8a,armeabi-v7a exited with non-zero code: 1
Error: /home/balpreet/Projects/ledgo-expo/android/gradlew app:assembleDebug -x lint -x test --configure-on-demand --build-cache -PreactNativeDevServerPort=8081 -PreactNativeArchitectures=arm64-v8a,armeabi-v7a exited with non-zero code: 1
    at ChildProcess.completionListener (/home/balpreet/Projects/ledgo-expo/node_modules/@expo/spawn-async/build/spawnAsync.js:42:23)
    at Object.onceWrapper (node:events:634:26)
    at ChildProcess.emit (node:events:519:28)
    at maybeClose (node:internal/child_process:1105:16)
    at ChildProcess._handle.onexit (node:internal/child_process:305:5)
    ...
    at spawnAsync (/home/balpreet/Projects/ledgo-expo/node_modules/@expo/spawn-async/build/spawnAsync.js:7:23)
    at spawnGradleAsync (/home/balpreet/Projects/ledgo-expo/node_modules/@expo/cli/build/src/start/platforms/android/gradle.js:96:48)
    at assembleAsync (/home/balpreet/Projects/ledgo-expo/node_modules/@expo/cli/build/src/start/platforms/android/gradle.js:74:18)
    at runAndroidAsync (/home/balpreet/Projects/ledgo-expo/node_modules/@expo/cli/build/src/run/android/runAndroidAsync.js:45:37)

Please tell me how to fix it. I used expo-go but later on I have to build this. Please help

Please help me solve this problem


Solution

  • Run below command

    npm i -g eas-cli
    expo install expo@^52.0.0 --fix
    npx expo-doctor@latest
    

    then in your app.json or app.config.js file in the web object field

    web: {
          bundler: "metro",
          output: "static",
          favicon: "./assets/images/favicon.png",
        },
    

    if you still encounter issues visit below url https://github.com/expo/expo/issues/33263