[2015-07-16 17:32:14 - Loneous] Dx
trouble writing output: Too many method references: 107085; max is 65536.
You may try using --multi-dex option.
I have this error and I have extended my Application class with MultiDexApplication, but still I am getting this error.
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
Also added the attachBaseContext method in my application.
Kindly guide me how to avoid this compilation error and run my app successfully.
Edit your manifest.xml
and add a reference to your MultidexApplication class
<application android:name="your.package.MyApplicationWhichExtendsMultidex">
Go to your grandle build file and add
multiDexEnabled true
and a dependency to the multidex support
compile 'com.android.support:multidex:1.0.0'
I don't know how Eclipse handle Android projects, but if it doesn't use Gradle then you need to pass --multi-dex
option (as the error said) during the build. If you are still using Ant, move to Gradle or Maven.
I've found for you the official documentation about how to fix this problem