Я получаю ошибки при компиляции из-за несовместимости с AndroidX:
Android dependency 'androidx.vectordrawable:vectordrawable' has different version for the compile (1.0.0) and runtime (1.0.1) classpath. You should manually set the same version via DependencyResolution
после -> этот пост <- я добавил код в build.gradle
allprojects {
configurations.all {
resolutionStrategy.force"androidx.vectordrawable:vectordrawable:1.0.0",
}
repositories {
google()
jcenter()
}
следующий запуск дал мне эту другую ошибку
Android dependency 'androidx.core:core' has different version for the compile (1.0.0) and runtime (1.0.1) classpath. You should manually set the same version via DependencyResolution
Я пытался добавить это
"androidx.vectordrawable:vectordrawable:1.0.0","androidx.core:core:1.0.0",
но я наверное не так делаю, так как получается классическое "неожиданное бла-бла-бла"
любое предложение?
заранее спасибо
[править] Я тоже пробовал этот старый трюк, но он не сработал (также понижение пакетов по мере необходимости ЗДЕСЬ)
rootProject.allprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'androidx.core') {
details.useVersion "1.0.1"
}
if (details.requested.group == 'androidx.lifecycle') {
details.useVersion "2.0.0"
}
if (details.requested.group == 'androidx.versionedparcelable') {
details.useVersion "1.0.0"
}
}
}
}
теперь возвращает другую ошибку
Android dependency 'androidx.appcompat:appcompat' has different version for the compile (1.0.0) and runtime (1.0.2) classpath. You should manually set the same version via DependencyResolution
2. В android/build.gradle замените:
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
к
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:
В разделе android { убедитесь, что compileSdkVersion и targetSdkVersion имеют значение не менее 28.
5. Замените все устаревшие библиотеки эквивалентами AndroidX. Например, если вы используете файлы .gradle по умолчанию, внесите следующие изменения:
В android/app/build.gradle
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
к
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Наконец, в зависимостях замените
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
к
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
Вам нужно использовать это указание с последней версией... :)
1) Входит
android/gradle/wrapper/gradle-wrapper.properties
Замените строку, начинающуюся с DistributionUrl, на последний gradle:
> distributionUrl = https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
2) Входит
android/build.gradle
вам нужно заменить:
> dependencies {
> classpath 'com.android.tools.build:**gradle:x.x.x**' }
с участием
dependencies { classpath 'com.android.tools.build:**gradle:3.5.0**' }
3) В android/gradle.properties вставьте это
android.enableJetifier=true android.useAndroidX=true
4) В android/app/build.gradle: убедитесь, что скомпилироватьSdkVersion и targetSdkVersion не менее 28``
Самое главное здесь: В android/app/build.gradle: заменить
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
с `
> testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
`
заменять
> androidTestImplementation 'com.android.support.test:runner:x.x.x'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:x.x.x'
с участием
> androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
У меня такая же проблема, я уже следовал вашим инструкциям и даже пробовал с другими, но ошибка продолжается, я не знаю, что изменить, не знаю, влияет ли это на то, что у меня самая последняя версия флаттера. Execution failed for task ':simple_permissions:verifyReleaseResources @Мессу
Всегда следите за тем, чтобы вновь добавленные зависимости соответствовали версии вашей градации, вам может потребоваться либо обновить, либо понизить зависимости, чтобы они соответствовали вашей версии gradle, но самое главное, рекомендуется использовать последнюю версию gradle и сопоставлять ее с последними зависимостями плагинов, чтобы избежать этих ошибок.
если я правильно понимаю, androidX обновил кучу вещей 2 дня назад (5 июня 2019 г.), возможно, поэтому флаттер отстает: / developer.android.com/jetpack/androidx/версии