I updated my Android Studio to version 2.0. But I had a problem, I don\'t know why?
The important error info:
Unable to instantiate applicati
I had the same error.
I solved it by cleaning the project ( Build > Clean Project )
you can also add this into your gradle to prevent making dex on debug
debug {
// dev utilizes minSDKVersion = 21 to allow the Android gradle plugin
// to pre-dex each module and produce an APK that can be tested on
// Android Lollipop without time consuming dex merging processes.
minSdkVersion 21
}
I also got this error with Android 2.0 in stable channel.
What I did?
- I had an older version of the app already installed on the device (which was built using older version of the Studio) which I was trying to replace by running the newer app on device.
I just uninstalled the older version completely before running the new app and the trick worked.
If you are sharing your app then another solution is
go to Android Studio --> Build --> Build APK
A pop up will come with APK generated successfully
. Show in Explorer
will get you to the generated apk folder.
If you don't want to disable Instant Run, just do a project clean and rerun.
Just go to Android Studio menu - Build --> Rebuild Project.