React Native+Expo构建Android应用时CMake配置任务失败求助
Expo + React Native Android构建失败:expo-modules-core的CMake配置错误
我正在用React Native + Expo开发一款Android端简易登录应用,需要在模拟器上测试Firebase登录/注册配置,但Expo基础项目无法通过Gradle编译,这个问题必须解决才能推进开发。
复现步骤
npx create-expo-app login-test-app npx expo prebuild npx expo run:android
已尝试的解决方法
- 删除
node_modules\expo-modules-core\android下的.cxx文件夹 - 重装react-native-reanimated
- 将项目移动到更短的路径下
报错信息
PS C:\Users\Sofia\Desktop\Universidad\Memoria\login-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:\Users\Sofia\Desktop\Universidad\Memoria\login-test-app\node_modules\expo-modules-core\android\CMakeLists.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:\Users\Sofia\Desktop\Universidad\Memoria\login-test-app\android\gradlew.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:\Users\Sofia\Desktop\Universidad\Memoria\login-test-app\android\gradlew.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:\Users\Sofia\Desktop\Universidad\Memoria\login-test-app\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 cp.emit (C:\Users\Sofia\Desktop\Universidad\Memoria\login-test-app\node_modules\cross-spawn\lib\enoent.js:34:29) at maybeClose (node:internal/child_process:1105:16) at ChildProcess._handle.onexit (node:internal/child_process:305:5) ... at spawnAsync (C:\Users\Sofia\Desktop\Universidad\Memoria\login-test-app\node_modules\@expo\spawn-async\build\spawnAsync.js:7:23) at spawnGradleAsync (C:\Users\Sofia\Desktop\Universidad\Memoria\login-test-app\node_modules\@expo\cli\build\src\start\platforms\android\gradle.js:96:48) at assembleAsync (C:\Users\Sofia\Desktop\Universidad\Memoria\login-test-app\node_modules\@expo\cli\build\src\start\platforms\android\gradle.js:74:18) at runAndroidAsync (C:\Users\Sofia\Desktop\Universidad\Memoria\login-test-app\node_modules\@expo\cli\build\src\run\android\runAndroidAsync.js:45:37)
期望结果
成功编译项目并在模拟器上运行代码,顺利测试Firebase登录/注册功能。
内容的提问来源于stack exchange,提问作者Sofía Palet Cano
相关产品推荐
相关产品推荐

