我的应用程序的java.lang.ClassNotFoundException

时间:2013-09-25 00:01:30

标签: java android

我最近刚收到设备“Desire HD(ace)”的错误报告,我无法为我的生活重新创建。我查看了Here1Here2,但它似乎不能帮助我解决我的问题,或者我只是不理解这一点,以了解这是否是解决我的问题的方法。

我的LogCat:

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{joseph.lubonty.librarysmite11/joseph.lubonty.librarysmite11.Splash}: java.lang.ClassNotFoundException: joseph.lubonty.librarysmite11.Splash in loader dalvik.system.PathClassLoader[/mnt/asec/joseph.lubonty.librarysmite11-2/pkg.apk]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1738)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1837)
at android.app.ActivityThread.access$1500(ActivityThread.java:132)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1033)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:4196)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: joseph.lubonty.librarysmite11.Splash in loader dalvik.system.PathClassLoader[/mnt/asec/joseph.lubonty.librarysmite11-2/pkg.apk]
at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1730)
... 11 more

我的宣言:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="joseph.lubonty.librarysmite11"
android:installLocation="preferExternal"
android:versionCode="19"
android:versionName="2.7" >

<compatible-screens>

    <!-- all normal size screens -->
    <screen
        android:screenDensity="mdpi"
        android:screenSize="normal" />
    <screen
        android:screenDensity="hdpi"
        android:screenSize="normal" />
    <screen
        android:screenDensity="xhdpi"
        android:screenSize="normal" />

    <!-- all large size screens -->
    <screen
        android:screenDensity="mdpi"
        android:screenSize="large" />
    <screen
        android:screenDensity="hdpi"
        android:screenSize="large" />
    <screen
        android:screenDensity="xhdpi"
        android:screenSize="large" />

    <!-- all xlarge size screens -->
    <screen
        android:screenDensity="mdpi"
        android:screenSize="xlarge" />
    <screen
        android:screenDensity="hdpi"
        android:screenSize="xlarge" />
    <screen
        android:screenDensity="xhdpi"
        android:screenSize="xlarge" />

    <!-- Special case for Nexus 7 -->
    <screen
        android:screenDensity="213"
        android:screenSize="large" />

    <!-- Special case for HTC One -->
    <screen
        android:screenDensity="480"
        android:screenSize="large" />

    <!-- Special case for Android DNA -->
    <screen
        android:screenDensity="480"
        android:screenSize="normal" />
</compatible-screens>

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

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<application
    android:allowBackup="true"
    android:icon="@drawable/b_promo"
    android:label="@string/app_name"
    android:logo="@drawable/i_topbarimage1"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".Splash"
        android:label="@string/title_activity_main"
        android:noHistory="true"
        android:screenOrientation="landscape" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".MainActivity"
        android:label="@string/title_activity_main" >
    </activity>
    <activity
        android:name=".GodStatComparison"
        android:label="@string/app_name"
        android:screenOrientation="landscape" >
    </activity>
    <activity
        android:name=".JungleTimers"
        android:label="@string/app_name"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name=".JungleInfoTablet"
        android:label="@string/app_name"
        android:screenOrientation="landscape" >
    </activity>
    <activity
        android:name=".JungleTimersTablet"
        android:label="@string/app_name"
        android:screenOrientation="landscape" >
    </activity>
    <activity
        android:name=".TopPlayers"
        android:label="@string/app_name"
        android:screenOrientation="landscape" >
    </activity>
</application>
</manifest>

以下是我的“属性”&gt;的图片“Java Build Path”如果这可能有助于解决这个问题:

enter image description here

enter image description here

(“项目”标签为空)

enter image description here

如果您需要任何其他类型的信息,请告诉我。

编辑:

package joseph.lubonty.librarysmite11;

public class Splash extends FragmentActivity {

}

2 个答案:

答案 0 :(得分:2)

刚安装在我的Desire HD上。默认安装在SD卡上。所以可能是@Jon所说的。

答案 1 :(得分:1)

他们的设备可能是fubar'd,但我也注意到你的项目是为JDK构建而不是ADT设置的。您需要确保使用Properties设置所有内容 - &gt; Android代替Properties - &gt; Java Build,正如here所述。

Managing Projects from Eclipse with ADT | Android Developers

升级到ADT版本22之后,似乎其他人也遇到类似问题,因此SDK中可能存在错误。我刚查看了我的版本,发现了对Ver的更新。 22.2.1可用。

Libraries do not get added to APK after update to ADK 22