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

我尝试构建android项目,但我有一个配置错误,

我已经删除了node_nodules,并尝试了"yarn install",但错误仍然存在。


 D:ReactNativeMapinandroid>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:ReactNativeMapinnode_modules@react-native-communitycli-platform-androidnative_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:ReactNativeMapinandroid, reactNativePath:D:ReactNativeMapinnode_modulesreact-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



时间: 作者:

按以下修复问题:


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可在以下位置找到:


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



作者:
...