i was busy with my app for over a week, when suddenly:
11-12 07:59:17.860 1653-1653/nl.test.myapp E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.Runtim
Your MainActivity.java is excluded from compile, so this class isn't included in .apk. Remove line:
<file url="file://$PROJECT_DIR$/src/nl/test/MyApp.java" />
from the excludeFromCompile section of the .idea/compiler.xml file (or you can do this from IDE settings).
Source
If you're creating an android library, you may simply have forgotten to import your library in your app build.gradle with the implementation project
keyword :
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:design:27.0.2'
implementation 'com.android.support:mediarouter-v7:27.0.2'
implementation project(':mylib-module:mymodule')
implementation 'com.google.firebase:firebase-core:10.0.1'
}
Hope this helps :)
Close android studio. Navigate to the project folder. Delete all files relating to intelliJ (Android Studio) i.e
Also make sure that package name matches the package in the android manifest.xml.
Then reimport the project.
This happened to me because I renamed the root package and IntelliJ (android studio) didn't track this.
This happened to me too, and none of the postings here helped. My problem was also caused by my having renamed the root package. My ClassNotFoundException was showing a DexPathList which was the old path to my package. I found the cause was in my Gradle Script called "build.gradle (Module: app)" I had a line saying: applicationId "old package name". I changed this to the new package name, did a gradle sync, and everything worked.
I ran into this. My app had been running fine and one day it just started running into these ClassNotFoundExceptions. My code hadn't changed at all.
As far as I can tell, it ended up being a bug in the build of Android Studio. I had recently updated to the latest release on the canary channel.
Switching back to an older release on the dev channel got things working again:
As i can see in your Log ,
nativeLibraryDirectories=[/data/app-lib/nl.test.myapp-2, /system/lib
For that you can change your lib
to libs
, I did this and it resolved my problem.
you would see some error mark on project to resolve that go to project properties and java build path, Remove all the libraries from there . You will not see this error again. :)