当我在android studio更新gradle时我发现了这个输入错误无法加载类'org.gradle.api. public. maven.internal. mavenpommetainfoprovider '。他犯了一个意想不到的错误。请将包含idea.log文件的bug归档。
在我的例子中,问题在这一行:
apply plugin: 'com.github.dcendents.android-maven'
在此之前,我使用的是Gradle插件4.2.2,今天我更新到7.0.0,得到了和你一样的错误。我通过从build.gradle中删除这一行来解决这个问题。
我在使用jitpack.io上推送的库时遇到了这个问题jitpack的医生。我没有提到在根build.gradle
文件
allprojects {
repositories {
....
maven { url 'https://jitpack.io' }
}
}
随着最新的更新,这已经改变了。Android Studio不再在根build.gradle
文件中包含一个allprojects块。
要使此工作,您现在需要将maven { url 'https://jitpack.io' }
包含在settings.gradle
文件中。
下面是我的设置。Gradle看起来像:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
}
rootProject.name = "<App Name>"
include ':app'
日期:04/11/2021(2021年11月4日)日期更新每次我得到UPVOTE,因为我知道它仍然有效
在更新到gradle 7.0.0时收到错误后,我尝试了@Alex解决方案,但是,它不适合我,
我删除了两行,现在可以工作了。
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'android-maven'
检查其他模块是否有此插件:
apply plugin: 'com.github.dcendents.android-maven'
在我的例子中是在countrycodepicker
我把它从那里移走了,它工作了。
我在2023年7月将项目迁移到最新版本时遇到了同样的问题.
我在countrycodepicker
中遇到过这个问题。
在文件中:
../../countrycodepicker/build.gradle
行:
apply plugin: 'com.github.dcendents.android-maven'
解决方案(2023年7月工作):
删除线路后,组件现在正常工作。
apply plugin: 'com.github.dcendents.android-maven'
将gradle版本降级到6.7.1。