2

我最近向市场发布了我的应用程序,当为少数用户加载时,我的应用程序崩溃了。我无法在手机或模拟器上重现该错误。这是堆栈..

该应用程序因少数人而崩溃的任何原因?有没有人遇到过这个问题?

java.lang.RuntimeException: Unable to instantiate application
xyz.android.MyApplication: java.lang.ClassNotFoundException: xyz.android.MyApplication in loader dalvik.system.PathClassLoader[/data/app/rageup.android.official-2.apk]
at android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:671)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4322)
at android.app.ActivityThread.access$3200(ActivityThread.java:129)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2155)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:4717)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: xyz.android.MyApplication in loader     dalvik.system.PathClassLoader[/data/app/xyz.android.official-2.apk]
at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
at android.app.Instrumentation.newApplication(Instrumentation.java:942)
at android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:666)
... 11 more

这是我的清单文件的片段

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="xyz.android.official"
android:versionCode="AAA"
android:versionName="AAA" >

<uses-sdk android:minSdkVersion="7" />
<application
    android:name="xyz.android.MyApplication"
    android:icon="@drawable/myicon"
    android:label="@string/app_name">

这是我的 MyApplication 类。

public class MyApplication extends Application 
{ 

public int someVar = 555;
private static MyApplication me;

@Override
public void onCreate() {        
    super.onCreate();
    me = this ;
}

public void setSomeVar(int someVar)
{       
    this.someVar = someVar;
}

public int getSomeVar()
{
    return someVar;
}

public static MyApplication getInstance() {
     return me;
}

}
4

1 回答 1

0

这主要导致目标构建的更改。有人说您需要将库文件夹更改为libfrom ,其他人说您应该在 Manifest.xml 中libs编写。.MyApplication

来源:工作应用程序上的 java.lang.ClassNotFoundException

于 2012-09-24T02:15:51.943 回答