我无法打开现有的 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
失败:构建失败,出现异常。
出了什么问题:
在项目“:app”中找不到任务 installDebug。
尝试:
运行 gradlew tasks 获取可用任务列表。 运行 使用 --stacktrace 选项获取堆栈跟踪。 运行 使用 --info 或 --debug 选项以获得更多日志输出。 运行 使用 --scan 以获得完整的见解。
获取更多帮助
此版本中使用了已弃用的 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 以获取更多详细信息。
首先检查这些:
- 检查您是否正确安装了所有依赖项。
- react-native-webview 和其他插件给出错误然后尝试修复它。
- Gradle 版本对于特定的插件使用很重要,因此还要检查您使用的是受支持的 Gradle 版本。
按照以下步骤操作:
关闭所有地铁捆绑包
watchman watch-del-all && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
打开 Android Studio 和 打开 yourprojectname/android
让 Android Studio 同步 如果有任何同步 问题然后修复它.
转到文件菜单 -> 使缓存无效并重新启动
在react-native 运行-android之前尝试检查你是否打开了设备或模拟器
用adb devices
检查一下
现在试一次。
当我 运行 这个命令
时,我得到以下错误 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
失败:构建失败,出现异常。
出了什么问题: 在项目“:app”中找不到任务 installDebug。
尝试: 运行 gradlew tasks 获取可用任务列表。 运行 使用 --stacktrace 选项获取堆栈跟踪。 运行 使用 --info 或 --debug 选项以获得更多日志输出。 运行 使用 --scan 以获得完整的见解。
- 获取更多帮助
此版本中使用了已弃用的 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 以获取更多详细信息。
首先检查这些:
- 检查您是否正确安装了所有依赖项。
- react-native-webview 和其他插件给出错误然后尝试修复它。
- Gradle 版本对于特定的插件使用很重要,因此还要检查您使用的是受支持的 Gradle 版本。
按照以下步骤操作:
关闭所有地铁捆绑包
watchman watch-del-all && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
打开 Android Studio 和 打开 yourprojectname/android
让 Android Studio 同步 如果有任何同步 问题然后修复它.
转到文件菜单 -> 使缓存无效并重新启动
在react-native 运行-android之前尝试检查你是否打开了设备或模拟器
用adb devices
检查一下
现在试一次。