Failed to resolve variable '${animal.sniffer.version}' when migrate to AndroidX
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 }}