Flutter 出现has different version for the compile (1.0.0) and runtime (1.0.1) classpath

发布于 1周前 作者 phonegap100 最后一次编辑是 5天前 来自 分享

Android dependency ‘androidx.core:core’ has different version for the compile (1.0.0) and runtime (1.0.2) classpath. You should manually set the same version via DependencyResolution


Flutter引入
photo: ^0.3.3
photo_manager: ^0.3.3
后出现上述问题
解决办法
1.android/gradle/wrapper/gradle-wrapper.properties里面
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip

2.android/build.gradle
dependencies { classpath 'com.android.tools.build:gradle:3.3.0' }

3.android/gradle.properties
加入
android.enableJetifier=true
android.useAndroidX=true

4.android/app/build.gradle 修改版本号:
 make sure compileSdkVersion and targetSdkVersion are at least 28.
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

5.android/app/build.gradle /defaultConfig加上
multiDexEnabled true

1 回复

这个可以用

回到顶部