【问题标题】:java.lang.RuntimeException and unable to instantiatejava.lang.RuntimeException 并且无法实例化
【发布时间】:2012-09-30 23:43:31
【问题描述】:

我试图找到解决方案,但它在我的 n00b 眼中看起来很正确,所以我完全迷路了。我试过寻找其他问题,他们似乎都有不同的答案,所以他们根本没有帮助。这是一些我正在尝试使用的示例代码,因此我为奇怪的命名道歉。

我收到了这个错误

09-30 17:22:26.467: E/AndroidRuntime(273): FATAL EXCEPTION: main
09-30 17:22:26.467: E/AndroidRuntime(273): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{test.test/test.test.test.splashScreen}: java.lang.ClassNotFoundException: test.test.test.splashScreen in loader dalvik.system.PathClassLoader[/data/app/test.test-1.apk]

这是我的清单

<manifest xmlns:android="http://schemas.android.com/apk/res/android"  
package="test.test" android:versionCode="1" android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />

<application android:icon="@drawable/icon" android:label="@string/app_name">
    <activity android:name=".test.splashScreen" android:label="@string/app_name"
        android:clearTaskOnLaunch="true">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".test.Game" android:screenOrientation="landscape" android:theme="@style/Theme.NoBackground"/>
    <activity android:name=".test.test" />
    <activity android:name=".test.TMXTiledMapExampleAStar" />
    <activity android:name=".test.Options" />
    <activity android:name=".test.MainMenu" />
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK"/>

这是 splashScreen 文件的开头

package test.test.test;

public class splashScreen extends BaseGameActivity {

【问题讨论】:

  • 好的...我正在看。我在找什么?我已经看过了,它看起来是正确的,所以我一定不知道导致这个问题的错误。

标签: android eclipse andengine runtimeexception


【解决方案1】:

首先,给你的包裹起更直观的名字! 我想发表评论,但我没有足够的代表。

2 条建议:

尝试清理您的项目

试试:

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="test.test" android:versionCode="1" android:versionName="1.0">

和

<activity android:name=".splashScreen" android:label="@string/app_name"
        android:clearTaskOnLaunch="true">

【讨论】:

  • 是的......这根本不起作用。我仍然遇到同样的错误。而且我认为您建议的 没有任何区别。
猜你喜欢
  • 2014-05-07
  • 2013-05-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-08-04
  • 2011-06-08
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多