Before, my program run well. But When I just updated my Android studio to the latest version (2.2 built on 15-sept-16), I am having the following error. When I built it, it says
I got the same error. I resolved it by :
1) Removing unnecessary packages in the build.gralde.
2) Disabling the Firebase plugin
3) Upgrading the build tool to the latest
This works great which you add multidex support in manifest, when ever i encounter problem i got it fixed this way more over 64K.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapp">
<application
android:name="android.support.multidex.MultiDexApplication" >
...
</application>
</manifest>
Add following line to Manifest.xml
<application
android:name="android.support.multidex.MultiDexApplication"
Add this sn App level build.gradle file
defaultConfig {
multiDexEnabled true
}
......
dependencies {
compile 'com.android.support:multidex:1.0.1'
}
It seems you have a problem with Over 64K Methods and then tried to resolved it with multiDexEnabled true
in build.gradle (app module). But you need to add more than:
add: compile 'com.android.support:multidex:1.0.0'
in dependencies of build.gradle
Extends your Application class to MultiDexApplication. and add MultiDex.install(this);
in onCreated
method of Application class.
your issue should be resolved
refer link: https://developer.android.com/studio/build/multidex.html
A simple solution that works for me after trying all of these solution is by deleting outputs folder under project\app\build\ and rebuilding project will let it to running state.
I got the same error and resolved it using: