Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ Android Runtime Exception: ClassNotFound, Didn't find Class on path

Using IntelliJ 14.0.3, my Android project was working until I built the project few times after each other and BANG, it doesn't come up anymore and it throws an Runtime Exception:

java.lang.RuntimeException: Unable to instantiate activity 
 ComponentInfo{com.rahil.ecat/com.rahil.activity.Activity_Main}: 
 java.lang.ClassNotFoundException: Didn't find class 
 "com.rahil.activity.Activity_Main" on path: 
 DexPathList[[zip file "/data/app/com.rahil.ecat-1.apk"],
  nativeLibraryDirectories=[/data/app-lib/com.rahil.ecat-1, 
      /vendor/lib, /system/lib]]

I've searched SO and found some answers which weren't for IntelliJ and they are all for Eclipse and I'm quite confused how to fix this and it's driving me crazy.

Any ideas?

like image 371
arash moeen Avatar asked Apr 15 '15 15:04

arash moeen


1 Answers

Ok I figured it out myself, using intellij 14.0.3 follow the below:

settings -> Build, Exclusion, Deployment -> Compiler -> Excludes

then you have to remove the excluded class from the list.

Note: The excluded classes have a little 'x' near their class icons.

like image 75
arash moeen Avatar answered Nov 15 '22 19:11

arash moeen