Could not resolve superclass of class Landroid / support / v4 / app / FragmentActivity

I have a project that uses WelcomeActivity that extends FragmentActivity . I use the support library, so android-support-v4.jar is in the libs folder. When I run this application, there is no problem.

However, I want to add an ActionBarSherlock to the project. In the ABS project, I use actionbarsherlock-plugin-maps-4.1.0.jar and android-support-v4-r6-googlemaps.jar in the libs folder. In my application project, I add the ABS library, and when I try to start the application, this error occurs:

 UNEXPECTED TOP-LEVEL EXCEPTION: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoStubImpl; 

To solve this problem, I deleted the android-support-v4.jar from my libs application. When I launch my application now, the application crashes with this logarithm:

 08-01 18:59:11.182: W/dalvikvm(13338): Unable to resolve superclass of Landroid/support/v4/app/FragmentActivity; (620) 08-01 18:59:11.182: W/dalvikvm(13338): Link of class 'Landroid/support/v4/app/FragmentActivity;' failed 08-01 18:59:11.182: W/dalvikvm(13338): Unable to resolve superclass of Lcom/myapp/welcome/WelcomeActivity; (109) 08-01 18:59:11.182: W/dalvikvm(13338): Link of class 'Lcom/myapp/welcome/WelcomeActivity;' failed 08-01 18:59:11.182: E/dalvikvm(13338): Could not find class 'com.myapp.welcome.WelcomeActivity', referenced from method com.myapp.MainDispatcherActivity.startWelcomeActivity 08-01 18:59:11.182: W/dalvikvm(13338): VFY: unable to resolve const-class 690 (Lcom/myapp/welcome/WelcomeActivity;) in Lcom/myapp/MainDispatcherActivity; 08-01 18:59:11.182: D/dalvikvm(13338): VFY: replacing opcode 0x1c at 0x0002 08-01 18:59:11.182: D/dalvikvm(13338): VFY: dead code 0x0004-000b in Lcom/myapp/MainDispatcherActivity;.startWelcomeActivity ()V 08-01 18:59:11.182: D/AndroidRuntime(13338): Shutting down VM 08-01 18:59:11.182: W/dalvikvm(13338): threadid=1: thread exiting with uncaught exception (group=0x40015560) 08-01 18:59:11.182: E/AndroidRuntime(13338): FATAL EXCEPTION: main 08-01 18:59:11.182: E/AndroidRuntime(13338): java.lang.NoClassDefFoundError: com.myapp.welcome.WelcomeActivity 08-01 18:59:11.182: E/AndroidRuntime(13338): at com.myapp.MainDispatcherActivity.startWelcomeActivity(MainDispatcherActivity.java:33) 08-01 18:59:11.182: E/AndroidRuntime(13338): at com.myapp.MainDispatcherActivity.startProperActivity(MainDispatcherActivity.java:26) 08-01 18:59:11.182: E/AndroidRuntime(13338): at com.myapp.MainDispatcherActivity.onCreate(MainDispatcherActivity.java:19) 08-01 18:59:11.182: E/AndroidRuntime(13338): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 08-01 18:59:11.182: E/AndroidRuntime(13338): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611) 08-01 18:59:11.182: E/AndroidRuntime(13338): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 08-01 18:59:11.182: E/AndroidRuntime(13338): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 08-01 18:59:11.182: E/AndroidRuntime(13338): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 08-01 18:59:11.182: E/AndroidRuntime(13338): at android.os.Handler.dispatchMessage(Handler.java:99) 08-01 18:59:11.182: E/AndroidRuntime(13338): at android.os.Looper.loop(Looper.java:130) 08-01 18:59:11.182: E/AndroidRuntime(13338): at android.app.ActivityThread.main(ActivityThread.java:3683) 08-01 18:59:11.182: E/AndroidRuntime(13338): at java.lang.reflect.Method.invokeNative(Native Method) 08-01 18:59:11.182: E/AndroidRuntime(13338): at java.lang.reflect.Method.invoke(Method.java:507) 08-01 18:59:11.182: E/AndroidRuntime(13338): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862) 08-01 18:59:11.182: E/AndroidRuntime(13338): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620) 08-01 18:59:11.182: E/AndroidRuntime(13338): at dalvik.system.NativeStart.main(Native Method) 

How can i fix this?

Edit
I have another project that uses the same ABS library and works fine. I have no idea what I did differently or which settings are incorrect.

+7
source share
4 answers

This error seems to have occurred because I did not have this line in the AndroidManifest.xml file in the <application> :

 <uses-library android:name="com.google.android.maps" /> 
+13
source

Click here

I think this is one and the same problem on the build path -> Configure build path -> Order and export, you need to check "android-support-v4.jar".

I hope this is useful to you.

+9
source

Have you installed compiler matching for the actionbarsherlock library project? Right-click on the library project, go to the properties. In the java compiler, make sure the match parameter is set to 1.6. I had a similar problem, and I found that the match is set to 1.5.

+2
source

I haven't come across this myself, but I think the doc for ActionBarSherlock says you need to extend SherlockFragmentActivity , not FragmentActivity . This may not be a problem, but a problem.

0
source

All Articles