I am running the sample from Implementing Effective Navigation - EffectiveNavigation.zip - which demonstrates some swipe views with tabs in an activity. It runs fine on a newer platform such as 4.2.2 (API17).
Then I want to support older platforms such as 2.3.3 (API10) too, so I lower the minSdkVersion to 4:
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="17"/>
I do include the support libraries in one of the following ways:
- by the book: V4 Support Library Setup - without resources
- or by the book: V7 Support Library Setup - with resources
- or right-click in project ->Android Tools->Add Support Library
Anyway, when I run the app on a 2.3.3 device, this ambiguous runtime exception occurs as in the listing below.
Before rushing in that has been asked before please note: my problem is I can't run it on older devices such as 2.3.3 - but runs fine on newer devices such as 4.2.2.
I deleted, reimported and rebuilt and rerun with various changed settings on various emulators. It just doesn't run on older devices (my purpose is using tabs and swipe views in older devices).
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.android.effectivenavigation/com.example.android.effectivenavigation.MainActivity}: java.lang.ClassNotFoundException: com.example.android.effectivenavigation.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.android.effectivenavigation-1.apk]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.example.android.effectivenavigation.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.android.effectivenavigation-1.apk]
at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)