无法在 android studio 中构建 React Native 应用程序。 我试过了:
npx react-native init projectName
时,使用的是 Android 插件版本 4.1.2,但此版本不在此列表中。
也知道Gradle的区别,Android Gradle Plugin,
Gradle Wrapper,已阅读https://repo.jfrog.org/artifactory/libs-release-bintray/com/android/tools/build/gradle/。我尝试使用最新的 Gradle v. 6.8.2 和 Android Gradle Plugin v. 4.1.2,它也没有帮助构建项目。distributionUrl
更改为
项目名称/android/gradle/wrapper/gradle-wrapper.properties构建输出:
Could not find com.android.tools.build:gradle:4.1.1.
Searched in the following locations:
- https://jcenter.bintray.com/com/android/tools/build/gradle/4.1.1/gradle-4.1.1.pom
If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
Required by:
project :react-native-settings
Add google Maven repository and sync project
Open File
现在使用:
Gradle 版本 6.5
Android Gradle 插件 v. 4.1.2
gradle-wrapper 6.5-all
Android Studio 4.1.2
Android SDK 平台:Android 10、9、8.1、8.0、7.1.1、7.0
答案 0 :(得分:0)
您的 google Maven 库丢失。添加后重建项目