android - 无法在 React Native 的 android 模拟器中安装应用程序
问题描述
我正在尝试在 android 模拟器中运行我的 react native CLI 应用程序,但在模拟器中安装时出现错误。
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
E:\Program Files\React Native CLI\testDemo\android\CLI\testDemo\node_modules\react-native-image-crop-picker\android\build\intermediates\library_manifest\debug\AndroidManifest.xml:10:5-14:15: AAPT: error: unexpected element <queries> found in <manifest>.
并且已经在 react native 中安装了这个依赖react-native-image-crop-picker
项,我已经完美地设置了 Facebook 提到的环境变量。这个错误正在出现
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
解决方案
根据此处,它看起来像已知问题。尝试升级 gradle 并重建。
buildscript
{
...
dependencies {
// classpath 'com.android.tools.build:gradle:4.0.0'
classpath 'com.android.tools.build:gradle:4.0.1'
}
...
}