欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

The Gradle failure may have been because of AndroidX ...flutter迁移AndriodX库问题

程序员文章站 2022-06-08 11:11:03
...

方法一:将使用到AndroidX库的插件降级到他没有迁移AndroidX的版本
方法二:打开as,The Gradle failure may have been because of AndroidX ...flutter迁移AndriodX库问题在flutter的Android文件夹右键打开如图,等待build条加载完,然后
The Gradle failure may have been because of AndroidX ...flutter迁移AndriodX库问题
点击Migrate to AndroidX,弹出框(勾选是否备份)确认之后点击The Gradle failure may have been because of AndroidX ...flutter迁移AndriodX库问题
点击Do Refactor就可以 因为我迁移过了 所以会按钮灰色,ok!
这时候打包 如果出现Android dependency ‘androidx.core:core’ has different version for the compile (1.0.0) and r… 你在你的Andriod/build.gradle(注意路径 是android文件夹里的 不不不不是app里面的)中加入

subprojects {
    project.configurations.all {
    resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'androidx.core' &&
           !details.requested.name.contains('androidx')) {
        details.useVersion "1.0.1"
            }
    }
    }    
}

就可以解决~