<i id='D6Mgg'><tr id='D6Mgg'><dt id='D6Mgg'><q id='D6Mgg'><span id='D6Mgg'><b id='D6Mgg'><form id='D6Mgg'><ins id='D6Mgg'></ins><ul id='D6Mgg'></ul><sub id='D6Mgg'></sub></form><legend id='D6Mgg'></legend><bdo id='D6Mgg'><pre id='D6Mgg'><center id='D6Mgg'></center></pre></bdo></b><th id='D6Mgg'></th></span></q></dt></tr></i><div id='D6Mgg'><tfoot id='D6Mgg'></tfoot><dl id='D6Mgg'><fieldset id='D6Mgg'></fieldset></dl></div>

    <small id='D6Mgg'></small><noframes id='D6Mgg'>

        <bdo id='D6Mgg'></bdo><ul id='D6Mgg'></ul>
      1. <legend id='D6Mgg'><style id='D6Mgg'><dir id='D6Mgg'><q id='D6Mgg'></q></dir></style></legend>

      2. <tfoot id='D6Mgg'></tfoot>
      3. 无法实例化活动 ComponentInfo

        Unable to instantiate activity ComponentInfo(无法实例化活动 ComponentInfo)

      4. <tfoot id='Pic9G'></tfoot>
          <bdo id='Pic9G'></bdo><ul id='Pic9G'></ul>

            <i id='Pic9G'><tr id='Pic9G'><dt id='Pic9G'><q id='Pic9G'><span id='Pic9G'><b id='Pic9G'><form id='Pic9G'><ins id='Pic9G'></ins><ul id='Pic9G'></ul><sub id='Pic9G'></sub></form><legend id='Pic9G'></legend><bdo id='Pic9G'><pre id='Pic9G'><center id='Pic9G'></center></pre></bdo></b><th id='Pic9G'></th></span></q></dt></tr></i><div id='Pic9G'><tfoot id='Pic9G'></tfoot><dl id='Pic9G'><fieldset id='Pic9G'></fieldset></dl></div>
                <tbody id='Pic9G'></tbody>

              <small id='Pic9G'></small><noframes id='Pic9G'>

                • <legend id='Pic9G'><style id='Pic9G'><dir id='Pic9G'><q id='Pic9G'></q></dir></style></legend>
                  本文介绍了无法实例化活动 ComponentInfo的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在为 Froyo 作为最低版本和 Gingerbread 作为目标版本开发应用程序.所以,清单显示:

                  I am developing an application for Froyo as minimum version and Gingerbread as the target version. So, the manifest shows:

                  <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="10"/>
                  

                  我有一个模拟器和一个带 Gingerbread 的 Nexus One,应用程序可以正确部署和安装.但是一启动就崩溃了,在日志中抛出的错误是:

                  I have an emulator and a Nexus One with Gingerbread, and the application deploys and installs correctly. But when it starts, it crashes, and the error thrown in the log is:

                  09-18 06:35:11.240: ERROR/AndroidRuntime(382): FATAL EXCEPTION: main
                  09-18 06:35:11.240: ERROR/AndroidRuntime(382): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.my.package/com.my.package.Dashboard}: java.lang.ClassNotFoundException: com.my.package.Dashboard in loader dalvik.system.PathClassLoader[/data/app/com.my.package-2.apk]
                  09-18 06:35:11.240: ERROR/AndroidRuntime(382):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
                  09-18 06:35:11.240: ERROR/AndroidRuntime(382):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
                  09-18 06:35:11.240: ERROR/AndroidRuntime(382):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
                  09-18 06:35:11.240: ERROR/AndroidRuntime(382):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
                  09-18 06:35:11.240: ERROR/AndroidRuntime(382):     at android.os.Handler.dispatchMessage(Handler.java:99)
                  09-18 06:35:11.240: ERROR/AndroidRuntime(382):     at android.os.Looper.loop(Looper.java:130)
                  09-18 06:35:11.240: ERROR/AndroidRuntime(382):     at android.app.ActivityThread.main(ActivityThread.java:3683)
                  09-18 06:35:11.240: ERROR/AndroidRuntime(382):     at java.lang.reflect.Method.invokeNative(Native Method)
                  09-18 06:35:11.240: ERROR/AndroidRuntime(382):     at java.lang.reflect.Method.invoke(Method.java:507)
                  09-18 06:35:11.240: ERROR/AndroidRuntime(382):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
                  09-18 06:35:11.240: ERROR/AndroidRuntime(382):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
                  09-18 06:35:11.240: ERROR/AndroidRuntime(382):     at dalvik.system.NativeStart.main(Native Method)
                  09-18 06:35:11.240: ERROR/AndroidRuntime(382): Caused by: java.lang.ClassNotFoundException: com.my.package.Dashboard in loader dalvik.system.PathClassLoader[/data/app/com.my.package-2.apk]
                  09-18 06:35:11.240: ERROR/AndroidRuntime(382):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
                  09-18 06:35:11.240: ERROR/AndroidRuntime(382):     at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
                  09-18 06:35:11.240: ERROR/AndroidRuntime(382):     at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
                  09-18 06:35:11.240: ERROR/AndroidRuntime(382):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
                  09-18 06:35:11.240: ERROR/AndroidRuntime(382):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
                  09-18 06:35:11.240: ERROR/AndroidRuntime(382):     ... 11 more
                  

                  是的,在 Manifest 中声明了仪表板"活动:

                  And yes, the activity "Dashboard" is declared in the Manifest:

                  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
                        package="com.my.package"
                        android:versionCode="1"
                        android:versionName="1.0"
                        android:installLocation="auto">
                  
                        <activity android:name=".Dashboard"
                                android:label="@string/app_name"
                                android:screenOrientation="portrait">
                  
                              <intent-filter>
                                    <action android:name="android.intent.action.MAIN"/>
                                    <category android:name="android.intent.category.LAUNCHER"/>
                              </intent-filter>
                        </activity>
                  
                        ...
                  

                  那么这个问题可能与什么有关?这让我发疯了.

                  So what can this problem be related to?? This is driving me nuts.

                  推荐答案

                  事实证明,项目文件缺少正确制作 apk 所需的一些构建器.这就是它无法找到 Dashboard 类的原因.

                  As it turns out, the project files were missing some of the builders required for the apk to be correctly made. That's why it was not able to find the Dashboard class.

                  解决方案是创建一个空的 Android 项目,并将自动生成的 .project 和 .properties 文件与您损坏的项目中的文件进行比较.

                  The solution is to create an empty Android project and compare the automatically generated .project and .properties files with the ones in your broken project.

                  这篇关于无法实例化活动 ComponentInfo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                  How to find out locale-dependent text orientation in java?(如何在java中找出依赖于语言环境的文本方向?)
                  Eclipse gets stuck when trying to launch Android app(Eclipse 在尝试启动 Android 应用程序时卡住了)
                  Eclipse: Failed to initialize Monitor Thread: Unable to establish loopback connection(Eclipse:无法初始化监视器线程:无法建立环回连接)
                  Eclipse- JDK not found(Eclipse-找不到JDK)
                  Error:CreateProcess error=216, This version of %1(错误:CreateProcess 错误=216,此版本的 %1)
                    • <tfoot id='fXPhC'></tfoot>
                      <i id='fXPhC'><tr id='fXPhC'><dt id='fXPhC'><q id='fXPhC'><span id='fXPhC'><b id='fXPhC'><form id='fXPhC'><ins id='fXPhC'></ins><ul id='fXPhC'></ul><sub id='fXPhC'></sub></form><legend id='fXPhC'></legend><bdo id='fXPhC'><pre id='fXPhC'><center id='fXPhC'></center></pre></bdo></b><th id='fXPhC'></th></span></q></dt></tr></i><div id='fXPhC'><tfoot id='fXPhC'></tfoot><dl id='fXPhC'><fieldset id='fXPhC'></fieldset></dl></div>
                    • <legend id='fXPhC'><style id='fXPhC'><dir id='fXPhC'><q id='fXPhC'></q></dir></style></legend>

                        <bdo id='fXPhC'></bdo><ul id='fXPhC'></ul>

                            <tbody id='fXPhC'></tbody>

                            <small id='fXPhC'></small><noframes id='fXPhC'>