我对这种问题感到沮丧,并试图找到所有解决方案但却失败了。请一位确实解决过这个问题的人给我一些建议,谢谢。
public class App extends Application
<application
android:name=".App"
android:icon="@drawable/app_icon"
android:theme="@style/Holo.Theme.Light" >
java.lang.RuntimeException: Unable to instantiate application ***.App: java.lang.ClassNotFoundException: Didn't find class "***.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 "***.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 :(得分:2)
将android:name =“。app”替换为android:name =“'app'类的完整路径”
答案 1 :(得分:1)
请仔细检查清单中的包名或至少将其粘贴到此处。也许它没有指向正确的包名。或者你把它放在单独的子包装上。
答案 2 :(得分:0)
关闭android studio中的即时游戏。然后构建并运行。它会工作。它对我有用。