我无法打开现有的 react-native 项目

I can't open an existing react-native project

当我 运行 这个命令

时,我得到以下错误
 react-native run-android

Configure project :react-native-onesignal WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'. It will be removed soon. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html WARNING: Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation'. It will be removed soon. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

Configure project :react-native-webview :react-native-webview:reactNativeAndroidRoot C:\Users\VO\Desktop\xxxx\xxxx\node_modules\react-native\android

失败:构建失败,出现异常。

此版本中使用了已弃用的 Gradle 功能,使其与 Gradle 6.0 不兼容。 使用“--warning-mode all”来显示各个弃用警告。 参见 https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings

4 秒内构建失败 错误无法在设备上安装应用程序,请阅读上面的错误以了解详细信息。 确保你有一个 Android 模拟器 运行ning 或连接的设备并且有 设置您的 Android 开发环境: https://facebook.github.io/react-native/docs/getting-started.html 错误 命令失败:gradlew.bat app:installDebug。 运行 带有 --verbose 标志的 CLI 以获取更多详细信息。

首先检查这些:

  1. 检查您是否正确安装了所有依赖项。
  2. react-native-webview 和其他插件给出错误然后尝试修复它。
  3. Gradle 版本对于特定的插件使用很重要,因此还要检查您使用的是受支持的 Gradle 版本。

按照以下步骤操作:

  1. 关闭所有地铁捆绑包

  2. watchman watch-del-all && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache

  3. 打开 Android Studio打开 yourprojectname/android

  4. Android Studio 同步 如果有任何同步 问题然后修复它.

  5. 转到文件菜单 -> 使缓存无效并重新启动

  6. react-native 运行-android之前尝试检查你是否打开了设备或模拟器

  7. adb devices

  8. 检查一下
  9. 现在试一次。