无法解析FragmentActivity的超 [英] Unable to resolve superclass of FragmentActivity

查看:227
本文介绍了无法解析FragmentActivity的超的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个previous机器上我的环境设置,我上的MacBook不同的充。对于一些奇怪的原因,我不断收到我的班这exend FragmentActivity 中的一个问题。它口口声声说无法找到 FragmentActivity 类,虽然我的支持JAR在我的类路径,按图像:

I had my environment setup on a previous machine, and I'm on a differnt MacBook. For some strange reason, I keep getting an issue with one of my classes which exend FragmentActivity. It keeps saying it can't find the FragmentActivity class, although I have the support jar in my class path, as per the image:

这是我看到详细的错误信息是在这里:

The detailed error message that I'm seeing is here:

10-23 23:10:16.300  26062-26062/com.testapp W/dalvikvm﹕ Unable to resolve superclass of Lcom/testapp/views/loginregistration/LoginView; (92)
10-23 23:10:16.300  26062-26062/com.testapp W/dalvikvm﹕ Link of class 'Lcom/testapp/views/loginregistration/LoginView;' failed
10-23 23:10:16.300  26062-26062/com.testapp D/AndroidRuntime﹕ Shutting down VM
10-23 23:10:16.300  26062-26062/com.testapp W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x414f8700)
10-23 23:10:16.330  26062-26062/com.testapp E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.testapp/com.testapp.views.loginregistration.LoginView}: java.lang.ClassNotFoundException: Didn't find class "com.testapp.views.loginregistration.LoginView" on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/com.testapp-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.testapp-1, /vendor/lib, /system/lib]]
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
            at android.app.ActivityThread.access$600(ActivityThread.java:141)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:5103)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:525)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.testapp.views.loginregistration.LoginView" on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/com.testapp-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.testapp-1, /vendor/lib, /system/lib]]
            at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
            at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
            at android.app.ActivityThread.access$600(ActivityThread.java:141)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:5103)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:525)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
            at dalvik.system.NativeStart.main(Native Method)

是否有其他成才我失踪?

Is there someting else i'm missing?

推荐答案

在你的IDE(如你的屏幕截图所示),选中要包含缺少类类路径条目导出对话框。

In your IDE (as shown in your screenshot), check the 'export' box next to the classpath entry that contains the missing class.

我曾与从Android支持库一类类似的问题(无法解析LCOM ... PagerAdapter的超类)。原来,在需要导出的引用的.classpath库:

I had a similar problem with a class from the Android Support library (Unable to resolve superclass of Lcom ... PagerAdapter). It turned out a library referenced in the .classpath needed to be exported:

从:

<classpathentry 

要:

<classpathentry exported="true" ...

有关Eclipse用户,我在Java构建路径菜单出口Android的私家藏书解决了这一问题。

For Eclipse users, I fixed the problem by exporting Android Private Libraries in the Java Build Path menu.

这篇关于无法解析FragmentActivity的超的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆