java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/ArrayMap;

ε祈祈猫儿з 提交于 2019-12-04 23:21:33

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

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'

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'
     }
 }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!