简体   繁体   English

React Native CLI 无法确定 Android 项目配置

[英]React Native CLI failed to determine Android project configuration

I'm trying to build my android project but I'm facing a configuration error.我正在尝试构建我的 android 项目,但我遇到了配置错误。 Previously I built an app bundle, but after that, I'm receiving the following error.以前我构建了一个应用程序包,但在那之后,我收到以下错误。

I already deleted node_nodules and tried "yarn install" but the error persist.我已经删除了 node_nodules 并尝试了“yarn install”,但错误仍然存​​在。

    D:\ReactNative\Mapin\android>gradlew assembleRelease
Starting a Gradle Daemon, 10 stopped Daemons could not be reused, use --status for details

FAILURE: Build failed with an exception.

* Where:
Script 'D:\ReactNative\Mapin\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' line: 206

* What went wrong:
A problem occurred evaluating script.
> React Native CLI failed to determine Android project configuration. This is likely due to misconfiguration. Config output:
  [root:D:\ReactNative\Mapin\android, reactNativePath:D:\ReactNative\Mapin\node_modules\react-native, dependencies:[:], commands:[], assets:[], platforms:[:], haste:[providesModuleNodeModules:[], platforms:[]], project:[:]]

* 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 15s

Fixed follow the following:固定如下:

yarn add @react-native-community/cli-platform-android@3.0.3
yarn add react-native@0.61.5
Removed "--quiet" from npx.cmd in native_modules.gradle
cd android && gradlew clean

native_modules.gradle can be found in: native_modules.gradle 可以在以下位置找到:

${PROJECT_FOLDER}/node_modules/@react-native-community/cli-platform-android/native_modules.gradle

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 react native cli run android 上的任务“:app:packageDebug”执行失败 - Execution failed for task ':app:packageDebug' on react native cli run android react-native-cli-无法运行android项目 - react-native-cli - Fails to run the android project React-native 项目构建失败:找不到 com.android.tools.lint ,无法确定任务 ':app:lintVitalRelease' 的依赖关系 - React-native project Build failed: Could not find com.android.tools.lint , Could not determine the dependencies of task ':app:lintVitalRelease' React Native 构建在 android 中失败,@react-native-community/cli-platform-android /native_modules.gradle' line: 130 - React Native build failed in android, @react-native-community/cli-platform-android /native_modules.gradle' line: 130 React Native Sqlite for android配置 - React Native Sqlite for android configuration 尝试运行 android 项目时找不到模块“@react-native-community/cli” - Cannot find module '@react-native-community/cli' when trying to run the android project React Native + Android:transformClassesWithDexForDebug失败 - React Native + Android: transformClassesWithDexForDebug FAILED 使用React Native的Android库项目 - Android Library Project with React Native 将android项目集成到React Native中 - Integrate android project into React Native React Native项目不在Android上启动 - React native project not starting on android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM