我不能让它工作。
我在这里发现了许多类似的问题,例如。但是没有任何帮助,也没有任何作用。有没有人在带有 android.support.v4 库的 Android 2.2 中有工作片段?(如果你是请上传到某个地方。)
我几乎要哭了,因为我找不到问题所在!
该错误与许多人的错误相同:
05-15 18:20:20.583: W/dalvikvm(1521): Unable to resolve superclass of Lmy/fragment/test/FragmentTestActivity; (8)
05-15 18:20:20.583: W/dalvikvm(1521): Link of class 'Lmy/fragment/test/FragmentTestActivity;' failed
05-15 18:20:20.593: D/AndroidRuntime(1521): Shutting down VM
05-15 18:20:20.593: W/dalvikvm(1521): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
05-15 18:20:20.703: E/AndroidRuntime(1521): FATAL EXCEPTION: main
05-15 18:20:20.703: E/AndroidRuntime(1521): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{my.fragment.test/my.fragment.test.FragmentTestActivity}: java.lang.ClassNotFoundException: my.fragment.test.FragmentTestActivity in loader dalvik.system.PathClassLoader[/data/app/my.fragment.test-1.apk]
05-15 18:20:20.703: E/AndroidRuntime(1521): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
05-15 18:20:20.703: E/AndroidRuntime(1521): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
05-15 18:20:20.703: E/AndroidRuntime(1521): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
05-15 18:20:20.703: E/AndroidRuntime(1521): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
05-15 18:20:20.703: E/AndroidRuntime(1521): at android.os.Handler.dispatchMessage(Handler.java:99)
05-15 18:20:20.703: E/AndroidRuntime(1521): at android.os.Looper.loop(Looper.java:123)
05-15 18:20:20.703: E/AndroidRuntime(1521): at android.app.ActivityThread.main(ActivityThread.java:4627)
05-15 18:20:20.703: E/AndroidRuntime(1521): at java.lang.reflect.Method.invokeNative(Native Method)
05-15 18:20:20.703: E/AndroidRuntime(1521): at java.lang.reflect.Method.invoke(Method.java:521)
05-15 18:20:20.703: E/AndroidRuntime(1521): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-15 18:20:20.703: E/AndroidRuntime(1521): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
05-15 18:20:20.703: E/AndroidRuntime(1521): at dalvik.system.NativeStart.main(Native Method)
05-15 18:20:20.703: E/AndroidRuntime(1521): Caused by: java.lang.ClassNotFoundException: my.fragment.test.FragmentTestActivity in loader dalvik.system.PathClassLoader[/data/app/my.fragment.test-1.apk]
05-15 18:20:20.703: E/AndroidRuntime(1521): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
05-15 18:20:20.703: E/AndroidRuntime(1521): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
05-15 18:20:20.703: E/AndroidRuntime(1521): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
05-15 18:20:20.703: E/AndroidRuntime(1521): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
05-15 18:20:20.703: E/AndroidRuntime(1521): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
05-15 18:20:20.703: E/AndroidRuntime(1521): ... 11 more
05-15 18:20:23.423: I/Process(1521): Sending signal. PID: 1521 SIG: 9
解决了!!!!谁在错误前有此警告:
05-16 10:08:00.033: W/dalvikvm(1695): Unable to resolve superclass of Lmy/fragment/test/FragmentTestActivity; (7)
05-16 10:08:00.076: W/dalvikvm(1695): Link of class 'Lmy/fragment/test/FragmentTestActivity;' failed
应该将 android-support-v4 导出到您的应用程序:
配置 Java 构建路径 -> 订购和导出选项卡 ->设置复选框 android-support-v4.jar
(可能需要先删除现有的)
它会将这个库移动到你的apk(据我所知)