I’ve been trying to create a simple login with react native in android, but gradle fails to compile the basic project that comes with expo. I need to test this on emulator for the Firebase login/singin configuration, and the compiling is essencial to build the app.
Steps to reproduce:
npx create-expo-app login-test-app
npx expo prebuild
npx expo run:android
I solved a lot of errors trying to build the app, but for this one I can´t seem to find the answer. I tried deleting the .cxx folder inside node_modulesexpo-modules-coreandroid, but didn´t work for me. Also tried reinstalling react-native-animated, changing the proyect to a shorter directory.
Here´s what i´ve got:
PS C:UsersSofiaDesktopUniversidadMemorialogin-test-app> npx expo run:android
› Building app...
Picked up _JAVA_OPTIONS: -Xmx2048M
Configuration on demand is an incubating feature.
> Configure project :expo
Using expo modules
- expo-asset (10.0.10)
- expo-constants (16.0.2)
- expo-file-system (17.0.1)
- expo-font (12.0.10)
- expo-keep-awake (13.0.2)
- expo-modules-core (1.12.24)
- expo-splash-screen (0.27.5)
- expo-system-ui (3.0.7)
- expo-web-browser (13.0.3)
> Configure project :react-native-reanimated
Android gradle plugin: 8.2.1
Gradle: 8.8
> 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] C:UsersSofiaDesktopUniversidadMemorialogin-test-appnode_modulesexpo-modules-coreandroidCMakeLists.txt debug|arm64-v8a : No compatible library foun
* 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 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.8/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD FAILED in 27s
301 actionable tasks: 88 executed, 205 from cache, 8 up-to-date
Error: C:UsersSofiaDesktopUniversidadMemorialogin-test-appandroidgradlew.bat app:assembleDebug -x lint -x test --configure-on-demand --build-cache -PreactNativeDevServerPort=8081 -PreactNativeArchitectures=x86_64,arm64-v8a exited with non-zero code: 1
Error: C:UsersSofiaDesktopUniversidadMemorialogin-test-appandroidgradlew.bat app:assembleDebug -x lint -x test --configure-on-demand --build-cache -PreactNativeDevServerPort=8081 -PreactNativeArchitectures=x86_64,arm64-v8a exited with non-zero code: 1
at ChildProcess.completionListener (C:UsersSofiaDesktopUniversidadMemorialogin-test-appnode_modules@expospawn-asyncbuildspawnAsync.js:42:23)
at Object.onceWrapper (node:events:634:26)
at ChildProcess.emit (node:events:519:28)
at cp.emit (C:UsersSofiaDesktopUniversidadMemorialogin-test-appnode_modulescross-spawnlibenoent.js:34:29)
at maybeClose (node:internal/child_process:1105:16)
at ChildProcess._handle.onexit (node:internal/child_process:305:5)
...
at spawnAsync (C:UsersSofiaDesktopUniversidadMemorialogin-test-appnode_modules@expospawn-asyncbuildspawnAsync.js:7:23)
at spawnGradleAsync (C:UsersSofiaDesktopUniversidadMemorialogin-test-appnode_modules@expoclibuildsrcstartplatformsandroidgradle.js:96:48)
at assembleAsync (C:UsersSofiaDesktopUniversidadMemorialogin-test-appnode_modules@expoclibuildsrcstartplatformsandroidgradle.js:74:18)
at runAndroidAsync (C:UsersSofiaDesktopUniversidadMemorialogin-test-appnode_modules@expoclibuildsrcrunandroidrunAndroidAsync.js:45:37)
What I’m expecting is to run the code on emulator and also that gradle compiles the project successfully.
0
I solved this finally! I had in Environment Variables -> System variables, a variable that I added trying to solve older problems I had Variable: _JAVA_OPTIONS, Valor: -Xmx2048m. Deleting this solved my problem. Hope it helps anyone who has this problem too.