注意:错误可能不同,但如果您在过去两天内获取Android构建时没有对代码进行任何更改并且遇到任何错误
我的错误 - 无法安装应用程序。 错误:命令失败:./gradlew app:installDebug -PreactNativeDevServerPort=8081
error Failed to install the app. Make sure you have the Android development environment set up:
Error: Command failed: ./gradlew app:installDebug
-PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* Where: Build file '/Users/....../node_modules/react-native-month-year-picker/android/build.gradle' line: 115
* What went wrong: A problem occurred configuring project ':react-native-month-year-picker'.
> Could not resolve all files for configuration ':react-native-month-year-picker:implementation'.
> Could not resolve com.facebook.react:react-native:+.
Required by:
project :react-native-month-year-picker
> Cannot choose between the following variants of com.facebook.react:react-native:0.71.0-rc.0:
- debugVariantDefaultRuntimePublication
- releaseVariantDefaultRuntimePublication
All of them match the consumer attributes:
- Variant 'debugVariantDefaultRuntimePublication' capability com.facebook.react:react-native:0.71.0-rc.0:
+
吗?android/app/build.gradle
中的代码如下:implementation "com.facebook.react:react-native:+"
- Mathias Bradiceanubuild.gradle
文件中的compileSdkVersion
为31
来重新构建...... 如果这不起作用,请撤销更改并将react-native
降级到之前正常工作的版本0.66.3
,然后应用此处提到的解决方案并重试。 - ZFLOC TECHNOLOGIES