gpt4 book ai didi

android - 提示 : Apache Cordova and Android: Unable to instantiate activity ComponentInfo

转载 作者:太空狗 更新时间:2023-10-29 15:39:04 24 4
gpt4 key购买 nike

这个真的让我很紧张。经过 2 到 3 天的查阅各种资源后,我找到了一个常见问题的解决方案。

上下文基于使用 Android http://j.mp/MB1pTM 提供的 PhoneGap 演示。在使用 PhoneGap API 文档为 Android 4.0.3 进行精确设置时,演示本身对我来说失败了。我收到以下错误消息:

07-16 23:01:58.485: E/AndroidRuntime(778): FATAL EXCEPTION: main
07-16 23:01:58.485: E/AndroidRuntime(778): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.test.shreyas.main/com.test.shreyas.main.HelloCordovaActivity}: java.lang.ClassNotFoundException: com.test.shreyas.main.HelloCordovaActivity
07-16 23:01:58.485: E/AndroidRuntime(778): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1880)
07-16 23:01:58.485: E/AndroidRuntime(778): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
07-16 23:01:58.485: E/AndroidRuntime(778): at android.app.ActivityThread.access$600(ActivityThread.java:123)
07-16 23:01:58.485: E/AndroidRuntime(778): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
07-16 23:01:58.485: E/AndroidRuntime(778): at android.os.Handler.dispatchMessage(Handler.java:99)
07-16 23:01:58.485: E/AndroidRuntime(778): at android.os.Looper.loop(Looper.java:137)
07-16 23:01:58.485: E/AndroidRuntime(778): at android.app.ActivityThread.main(ActivityThread.java:4424)
07-16 23:01:58.485: E/AndroidRuntime(778): at java.lang.reflect.Method.invokeNative(Native Method)
07-16 23:01:58.485: E/AndroidRuntime(778): at java.lang.reflect.Method.invoke(Method.java:511)
07-16 23:01:58.485: E/AndroidRuntime(778): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
07-16 23:01:58.485: E/AndroidRuntime(778): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
07-16 23:01:58.485: E/AndroidRuntime(778): at dalvik.system.NativeStart.main(Native Method)
07-16 23:01:58.485: E/AndroidRuntime(778): Caused by: java.lang.ClassNotFoundException: com.test.shreyas.main.HelloCordovaActivity
07-16 23:01:58.485: E/AndroidRuntime(778): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
07-16 23:01:58.485: E/AndroidRuntime(778): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
07-16 23:01:58.485: E/AndroidRuntime(778): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
07-16 23:01:58.485: E/AndroidRuntime(778): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
07-16 23:01:58.485: E/AndroidRuntime(778): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871)
07-16 23:01:58.485: E/AndroidRuntime(778): ... 11 more

最佳答案

我的设置与@curlyreggie 相同。我通过执行以下操作使其正常工作:

右键点击 Cordova-2.4.jar -> Configure Build Path 然后在选项卡 Order and Export 中,我确保列表按以下顺序排列:

  1. Android(在我的例子中是 Android 3.0)
  2. 安卓依赖
  3. Cordova ....
  4. ..../源
  5. ..../gen

关于android - 提示 : Apache Cordova and Android: Unable to instantiate activity ComponentInfo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11514193/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com