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

标签 android reactjs react-native android-studio

我正在尝试构建我的 android 项目,但我遇到了配置错误。
以前我构建了一个应用程序包,但在那之后,我收到了以下错误。

我已经删除了 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

最佳答案

固定如下:

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

关于android - React Native CLI 无法确定 Android 项目配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59959039/

相关文章:

android - 在裸机 react native 项目中安装 expo 后,我收到此错误

android - 在 Android 模拟器中启动 meteor 应用程序时出错

android - 在一个 Android 应用程序中有多个 SQLiteOpenhelper

reactjs - Formik 提交错误 : Can't perform a React state update on an unmounted component

javascript - 无法使用React显示API请求的结果

json - 如何在React Native中解析json数据

java - 如何将 EditText 字段中的文本添加到 android studio 中的不同 TextView

android - 找不到资源 : Theme. Leanback

reactjs - 错误 : PostCSS plugin autoprefixer requires PostCSS 8. 更新 PostCSS 或降级此插件

javascript - 我无法使用 React Native 的 axios API 登录