0

I have tried every answer for this on Google, but none worked for me.

I have just created an app I Android studio and add .jar file and simply running it.

But the app crashes leaving with below error message.

FATAL EXCEPTION: main Process: com.vtek.cam_pwr_flsh_cntrl, PID: 4850     
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.vtek.cam_pwr_flsh_cntrl/com.vtek.cam_pwr_flsh_cntrl.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.vtek.cam_pwr_flsh_cntrl.MainActivity" on path: DexPathList[[zip file "/data/app/com.vtek.cam_pwr_flsh_cntrl-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.vtek.cam_pwr_flsh_cntrl-2, /vendor/lib, /system/lib]]
                                                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2121)
                                                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
                                                     at android.app.ActivityThread.access$800(ActivityThread.java:135)
                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
                                                     at android.os.Handler.dispatchMessage(Handler.java:102)
                                                     at android.os.Looper.loop(Looper.java:136)
                                                     at android.app.ActivityThread.main(ActivityThread.java:5017)
                                                     at java.lang.reflect.Method.invokeNative(Native Method)
                                                     at java.lang.reflect.Method.invoke(Method.java:515)
                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
                                                     at dalvik.system.NativeStart.main(Native Method)
                                                  Caused by: java.lang.ClassNotFoundException: Didn't find class "com.vtek.cam_pwr_flsh_cntrl.MainActivity" on path: DexPathList[[zip file "/data/app/com.vtek.cam_pwr_flsh_cntrl-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.vtek.cam_pwr_flsh_cntrl-2, /vendor/lib, /system/lib]]
                                                     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
                                                     at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
                                                     at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
                                                     at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
                                                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2112)
                                                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) 
                                                     at android.app.ActivityThread.access$800(ActivityThread.java:135) 
                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
                                                     at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                     at android.os.Looper.loop(Looper.java:136) 
                                                     at android.app.ActivityThread.main(ActivityThread.java:5017) 
                                                     at java.lang.reflect.Method.invokeNative(Native Method) 
                                                     at java.lang.reflect.Method.invoke(Method.java:515) 
                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 
                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 
                                                     at dalvik.system.NativeStart.main(Native Method) 
Dany Pop
  • 3,590
  • 2
  • 21
  • 28
Ramadevi
  • 21
  • 3
  • seet this , https://stackoverflow.com/questions/19523167/android-classnotfoundexception-didnt-find-class-on-path , answer of Redman will work – Sachin Varma Feb 06 '18 at 07:36

1 Answers1

1

Check in your manifest file if you have declared the class as an activity. If missing, do it. Clean and REBUILD the code. Hope this helps.

GAGAN BHATIA
  • 591
  • 5
  • 17
  • No i just created an app and added .jar file.I have not added even a single line code in MainActivity.My Manifest file is same as studio generates while creating an app. –  Ramadevi Feb 07 '18 at 11:59