Today i found this error while trying to run my app. I made the following attempts towards solving it. - First i removed multidex support, but i can still see the slices of
for me I found this change fixed my issue. I had a repo that built find in July this year. Then as I kept my build environment up to date with flutter etc, it wouldn't build this project but built my other project fine. I found this difference:
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -5,8 +5,8 @@ buildscript {
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.2.1'
- classpath 'com.google.gms:google-services:4.2.0'
+ classpath 'com.android.tools.build:gradle:3.3.0'
+ classpath 'com.google.gms:google-services:4.3.0'
}
}
I had the same problem and solved it by editing the build.gradle
file like this:
...
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//Add these lines to fix the error.
implementation 'com.google.firebase:firebase-analytics:17.2.1'
implementation 'com.google.firebase:firebase-auth:19.2.0'
implementation 'com.google.firebase:firebase-firestore:21.3.0'
}
apply plugin: 'com.google.gms.google-services'
It looks you are missing v4 support library in your app gradle dependencies. Try by adding v4 support library
compile 'com.android.support:support-v4:25.1.1'
I faced the same problem with Flutter
and this question was the first link on Google when I searched my error:
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/ArraySet
So the root of your problem might be same: AndroidX
adaptation. Adding those lines to gradle.properties
fixed my problem:
android.useAndroidX=true
android.enableJetifier=true
You may also want to add compileSdkVersion 28
to your app-level build.gradle
file.
For further information