我对这种问题感到沮丧,并试图找到所有解决方案但却失败了。请一位确实解决过这个问题的人给我一些建议,谢谢。
public class App extends Application
<application
android:name="my.package.App"
android:icon="@drawable/app_icon"
android:theme="@style/Holo.Theme.Light" >
java.lang.RuntimeException: Unable to instantiate application my.package.App: java.lang.ClassNotFoundException: Didn't find class "my.package.App" on path: DexPathList[dexElements=[],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:504)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4539)
at android.app.ActivityThread.access$1300(ActivityThread.java:156)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1400)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityThread.java:5297)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "my.package.App" on path: DexPathList[dexElements=[],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.app.Instrumentation.newApplication(Instrumentation.java:968)
at android.app.LoadedApk.makeApplication(LoadedApk.java:499)
... 11 more
答案 0 :(得分:0)
这样做
<application android:name="packagename.classname"
在命名类 * 时使用默认字母
时也要避免使用特殊字符