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

前端 未结 3 1164
谎友^
谎友^ 2021-01-21 02:23

My app works perfectly when you run it on API 23 - 25, but on API 21 & 22 it crashes with the following error:

12-12 15:01:18.436 2         


        
3条回答
  •  后悔当初
    2021-01-21 02:28

    Actually , There is one more reason of this issue : When we using gradle build with :

    compile 'com.google.android.gms:play-services:xxxx'
    

    We had to compile the entire package of APIs into our app.In some cases, doing so made it more difficult to keep the number of methods in our app (including framework APIs, library methods, and your own code) under the 65,536 limit. So the solution: we should build with only packages which we use : Example :

    compile 'com.google.android.gms:play-services-analytics:x.x.x'
    compile 'com.google.android.gms:play-services-gcm:x.x.x'
    

    More detail : https://developers.google.com/android/guides/setup

提交回复
热议问题