0

I'm new to android programming and especially eclipse. I have a very hard time undersanding what the LogCat errors mean and where to look to fix them. I'm used to Visual Studios so it usually tells me where the error is located at. All of the classes it shows me arent even classes that I have created, but built in ones so I'm just confused..

LogCat:

06-26 09:03:56.201: E/AndroidRuntime(3428): FATAL EXCEPTION: main
06-26 09:03:56.201: E/AndroidRuntime(3428): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.basicscanner/com.example.basicscanner.MainActivity}: java.lang.ClassNotFoundException: com.example.basicscanner.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.basicscanner-1.apk]
06-26 09:03:56.201: E/AndroidRuntime(3428):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
06-26 09:03:56.201: E/AndroidRuntime(3428):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
06-26 09:03:56.201: E/AndroidRuntime(3428):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
06-26 09:03:56.201: E/AndroidRuntime(3428):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
06-26 09:03:56.201: E/AndroidRuntime(3428):     at android.os.Handler.dispatchMessage(Handler.java:99)
06-26 09:03:56.201: E/AndroidRuntime(3428):     at android.os.Looper.loop(Looper.java:130)
06-26 09:03:56.201: E/AndroidRuntime(3428):     at android.app.ActivityThread.main(ActivityThread.java:3683)
06-26 09:03:56.201: E/AndroidRuntime(3428):     at java.lang.reflect.Method.invokeNative(Native Method)
06-26 09:03:56.201: E/AndroidRuntime(3428):     at java.lang.reflect.Method.invoke(Method.java:507)
06-26 09:03:56.201: E/AndroidRuntime(3428):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-26 09:03:56.201: E/AndroidRuntime(3428):     at   com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-26 09:03:56.201: E/AndroidRuntime(3428):     at dalvik.system.NativeStart.main(Native Method)
06-26 09:03:56.201: E/AndroidRuntime(3428): Caused by: java.lang.ClassNotFoundException: com.example.basicscanner.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.basicscanner-1.apk]
06-26 09:03:56.201: E/AndroidRuntime(3428):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
06-26 09:03:56.201: E/AndroidRuntime(3428):     at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
06-26 09:03:56.201: E/AndroidRuntime(3428):     at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
06-26 09:03:56.201: E/AndroidRuntime(3428):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
06-26 09:03:56.201: E/AndroidRuntime(3428):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
bbesase
  • 791
  • 4
  • 18
  • 31
  • Your problem is that you are using the class `MainActivity` (actually you want to start this activity), but the class is not found in the APK. – WonderCsabo Jun 26 '14 at 13:54
  • possible duplicate of [java.lang.RuntimeException: Unable to instantiate activity ComponentInfo](http://stackoverflow.com/questions/4688277/java-lang-runtimeexception-unable-to-instantiate-activity-componentinfo) – duggu Jun 26 '14 at 13:57
  • @bbesase please before asking question do some google . – duggu Jun 26 '14 at 13:57
  • @Golu I actually looked at that prior to asking mine... The thing is though is that I do not have more than one activity so I don't know why it has to do with intents – bbesase Jun 26 '14 at 14:00

2 Answers2

0

It means that the compiler is not able to find your class, maybe because you haven't defined it in your android manifest or maybe the path to your class is not right;)

axl coder
  • 739
  • 3
  • 19
0

It is a problem of your Intent.

Please add your Activity in your AndroidManifest.xml.

When you want to making new activity, you should register it in your AndroidManifest.xml.

Vipul Kanade
  • 83
  • 1
  • 8