This is how I solved the problem if someone got here.
After I deeply dealt with the problem, I found that this was not an inflatable exception, although what logcat said, the real exception was the OutOfMemory exception caused by the notorious 65K problem, click here to get more information about this problem , and she was wrapped by exhumation of inflation.
To solve this problem, I first added the multidex support library to the build.gradle file:
compile 'com.android.support:multidex:1.0.0'
Then I followed these three simple steps to get it working:
If you do not implement the application class yourself, you can simply define the MultiDexApplication libraries in your Android manifest file in the application tag:
Android: name = "android.support.multidex.MultiDexApplication"
If you implement your own application class, you can simply override the MultiDexApplication file:
Public class MyAwesomeApplication extends MultiDexApplication {
Or, if your application class is already extending another class, you can simply override the attachBaseContext method and add the following call to it:
@Override protected void attachBaseContext (Context Base) {super.attachBaseContext (context); Multidex.install (this); }
I already had my own application class, which extends from the Application class, so I jumped directly to step 3, and voila worked on Kitkat and Lollipop.
Hope this helps anyone. Happy coding.
source share