0

I am getting class not found exception on some android devices, it's happening only on some devices. This is the call-stack i have got,

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.picframes.android/com.picframes.android.first}: java.lang.ClassNotFoundException: com.picframes.android.first
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2121)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2240)
at android.app.ActivityThread.access$600(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1262)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:4987)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.picframes.android.first
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.app.Instrumentation.newActivity(Instrumentation.java:1039)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2112)

Any suggestions for resolving this problem, I could not reproduce this problem on my device.

Tamil Selvan C
  • 19,913
  • 12
  • 49
  • 70
pavan
  • 1,085
  • 4
  • 22
  • 34

1 Answers1

0

On devices with which android version program works and where it doesn't work? I am not sure if this is the case but you probably get this error on older devices, is that right? You should make sure that all the functionality of your program is available on older systems. Use your manifest file:

<uses-sdk android:minSdkVersion="integer"
          android:targetSdkVersion="integer"
          android:maxSdkVersion="integer" />

to define minimum sdk version, and you will get errors in your code if you are trying to use features that are not available on the device that you target.

Marek
  • 3,935
  • 10
  • 46
  • 70
  • I am not sure on which device this problem is happening, in call stack I could not find device information, might be old devices only.I have defined like this in my manifest file, – pavan May 29 '13 at 03:18
  • android:minSdkVersion="6" or some other numbers and see what happens. You can check android version on your android device through settings menu. If this will not help you can take a look here http://stackoverflow.com/questions/4688277/java-lang-runtimeexception-unable-to-instantiate-activity-componentinfo – Marek May 29 '13 at 04:14