Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to resolve variable '${animal.sniffer.version}' when migrate to AndroidX

I fix this with two steps

1) File -> Invalidate Caches / restart... enter image description here

2) Build -> Clean project enter image description here


I got the same error after updating my build.gradle file with AndroidX Test dependencies. Turns out I forgot to remove the old junit dependency. So for me, the fix was simply to remove the following dependency:

dependencies {
    ...
    testImplementation 'junit:junit:4.12'
}

Adding Java 8 support to build.gradle file fixed issue for me

android {
     ...

     //Add the following configuration in order to target Java 8.
     compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_8
         targetCompatibility JavaVersion.VERSION_1_8
     }
}

It seems to be Glide the problem.

I had the same error and I just updated the Glide's dependencies to 4.8 and there is no build errors.

Kotlin :

// Glide
def glide_version = "4.8.0"
implementation "com.github.bumptech.glide:glide:$glide_version"
kapt "com.github.bumptech.glide:compiler:$glide_version"

Java :

// Glide
def glide_version = "4.8.0"
implementation "com.github.bumptech.glide:glide:$glide_version"
annotationProcessor "com.github.bumptech.glide:compiler:$glide_version"

Be sure to have enabled in your gradle.properties :

android.useAndroidX=true
android.enableJetifier=true

Source : https://github.com/bumptech/glide/issues/3124

Hope this will help you!


Fixed it by going to the main directory and typing flutter clean


Removing the testInstrumentationRunner worked for me:

defaultConfig {
...
...
//        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }