Error on some devices - couldn't find class 'com.google.android.gms.measurement.internal.zzz'

前端 未结 3 1975
刺人心
刺人心 2020-12-03 03:22

I am working on an Android Custom Launcher. The application runs perfectly on some phones but do not start on others. On launching the application the following error occurs

3条回答
  •  情深已故
    2020-12-03 04:00

    +) Building Apps with Over 65K Method will cause this Error.

    +) When your application and the libraries it references reach a certain size ( DEX file of your application can have total number of methods upto 65,536 including Android framework methods, library methods, and methods in your own code), you encounter build errors that indicate your app has reached a limit of the Android app build architecture.

    +) To resolve it, include Multidex Configuration in your build.gradle like the highlighted one in picture, along with this override the attachBaseContext(Context base) method in your Application class with the below content.

    public class YourParentApplication extends Application {
    
    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
     }
    }
    

    Add this in you Androidmanifest.xml:

    
    

    For more information about Multidex refer these sites: http://developer.android.com/tools/building/multidex.html

    How to enable multidexing with the new Android Multidex support library

提交回复
热议问题