gpt4 book ai didi

android-studio - 如何将flutter项目迁移到androidx:任务 ':app:preDebugBuild'执行失败。 > Android依赖项'androidx.versionedparcelable

转载 作者:行者123 更新时间:2023-12-03 05:28:27 26 4
gpt4 key购买 nike

我在flutter项目中添加了geolocator程序包,每当我运行时,都会收到有关androidx兼容性和
任务':app:preDebugBuild'的执行失败。

Android dependency 'androidx.versionedparcelable:versionedparcelable' has different version for the compile (1.0.0) and runtime (1.1.0) classpath. You should manually set the same version via DependencyResolution i added this in android/gradle.properties


android.useAndroidX=true
android.enableJetifier=true

我尝试更改构建版本,但无法正常工作。我也尝试github粘贴提出的一些解决方案

我在android / build.gradle的buidscript下添加了这个
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "27.1.1"
}

if (details.requested.group == 'androidx.core'
&& !details.requested.name.contains('androidx') ) {
details.useVersion "1.0.1"
}
}
}
}

enter image description here做的所有事都没用

最佳答案

有时候,我能够找到答案。我只需要更新 flutter
和buildscript下的android / build.gradle中的followinng

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

并在android / gradle.properties文件中添加以下内容
android.useAndroidX=true
android.enableJetifier=true

关于android-studio - 如何将flutter项目迁移到androidx:任务 ':app:preDebugBuild'执行失败。 > Android依赖项'androidx.versionedparcelable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60351429/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com