Using Gradle to split external libraries in separated dex files to solve Android Dalvik 64k methods limit

后端 未结 4 1769
离开以前
离开以前 2020-12-04 20:13

Is there a proper/easy way to solve the 64k methods limit using Gradle?

I mean some custom Gradle task to use pre-dexed jars to create separated dex fil

4条回答
  •  囚心锁ツ
    2020-12-04 20:39

    In case gms was your issue and you are using gradle

    Starting from gms version 6.5 you can choose individual API libraries

    for example to include only the Maps API :

    compile 'com.google.android.gms:play-services-maps:6.5.87'
    

    and here is the complete list :

          com.google.android.gms:play-services-base:6.5.87
          com.google.android.gms:play-services-ads:6.5.87
          com.google.android.gms:play-services-appindexing:6.5.87
          com.google.android.gms:play-services-maps:6.5.87
          com.google.android.gms:play-services-location:6.5.87
          com.google.android.gms:play-services-fitness:6.5.87
          com.google.android.gms:play-services-panorama:6.5.87
          com.google.android.gms:play-services-drive:6.5.87
          com.google.android.gms:play-services-games:6.5.87
          com.google.android.gms:play-services-wallet:6.5.87
          com.google.android.gms:play-services-identity:6.5.87
          com.google.android.gms:play-services-cast:6.5.87
          com.google.android.gms:play-services-plus:6.5.87
          com.google.android.gms:play-services-appstate:6.5.87
          com.google.android.gms:play-services-wearable:6.5.87
          com.google.android.gms:play-services-all-wear:6.5.87
    

提交回复
热议问题