Believe that many people have encountered this problem, with Android Studio is running the program, suddenly don't know what the reason, Reported an error that could not find application or could not find activity (java.lang.ClassNotFoundException:), this dick in clean and rebuild n times, Program is still runtimeexception, near app die.
Asked a lot of people, still can't find a way, and then search the Internet a large number of articles found several solutions, the following in turn to share to you:
Note: The first two I have tested, can be used, the following two you are interested to be able to test:
Workaround:
1, add the app build. The buildtoolsversion in Gradle is changed to 21.1.2;
The option to start with the first enable in 2,file-setting-build,execution,deploymedent-instant Run is unchecked;
3, Changing:classpath ' COM.ANDROID.TOOLS.BUILD:GRADLE:2.0.0-ALPHA1 '
By:classpath ' com.android.tools.build:gradle:1.2.3 '
4, in project Folder>/.idea/gradle.xml
Will:<option name= "Gradlehome" value= "$APPLICATION _home_dir$/gradle/gradle-2.8"/>
Change to:<option name= "Gradlehome" value= "$APPLICATION _home_dir$/gradle/gradle-2.4"/>
Unable to instantiate application Com.android.tools.fd.runtime.BootstrapApplication solution