Skip to content Skip to sidebar Skip to footer

Flutter Error "Android Dependency 'androidx.core:core' Has Different Version" Using Flutter_local_notifications And Location Packages

Good day, i try to make an easy weather app with notifications for android and ios, for this I us base flutter app and libraries flutter_local_notifications: ^0.5.1+2 and location:

Solution 1:

No joke, I recently had the same problem (and I was getting many complaints about various dependencies that were AndroidX, with -rc01 version endings), and various solutions for forcing a resolution strategy were not working.

I solved it by upgrading my gradle dependency in the android/build.gradle file: classpath 'com.android.tools.build:gradle:3.3.1' (I was previously on version 3.2.1)


Solution 2:

I met the same problem which is from androidX compatibility. the error message looks like:

android dependency 'androidx.core:core' has different version for the compile (1.0.0) and runtime (1.0.1) classpath

I fixed it as below (if it's the same, ignore it):

  1. In android/gradle/wrapper/gradle-wrapper.properties change the line starting with distributionUrl like this:

distributionUrl=https://services.gradle.org/distributions/gradle-4.10.2-all.zip

  1. In android/build.gradle

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

  • under buildscript { (if it includes kotlin)

ext.kotlin_version = '1.3.0'

  1. In android/gradle.properties, append

android.enableJetifier=true

android.useAndroidX=true

  1. In android/app/build.gradle:

Under android {, make sure compileSdkVersion and targetSdkVersion are at least 28.

...

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

under dependencies {

androidTestImplementation 'androidx.test:runner:1.1.1'

androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'

implementation 'com.android.support:multidex:1.0.3'

under defaultConfig {

multiDexEnabled true

Hopefully, this helps!!!


Post a Comment for "Flutter Error "Android Dependency 'androidx.core:core' Has Different Version" Using Flutter_local_notifications And Location Packages"