当我在Android studio中使用USB在真实设备中测试时,我的应用程序工作正常.但是当我将apk发送到另一台设备并安装在那里时,它无法正常工作.App得到崩溃.我没有找到任何正确的方法来解决问题.错误如下:
FATAL EXCEPTION: main Process: com.w3xplorers.cmch,PID: 17715 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.w3xplorers.cmch/com.w3xplorers.cmch.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.w3xplorers.cmch.MainActivity" on path: DexPathList[[zip file "/data/app/com.w3xplorers.cmch-1/base.apk"],nativeLibraryDirectories=[/data/app/com.w3xplorers.cmch-1/lib/arm, /system/lib, /vendor/lib, system/vendor/lib, system/vendor/lib/egl, system/lib/hw]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2395)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2544)
at android.app.ActivityThread.access$900(ActivityThread.java:150)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1394)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:168)
at android.app.ActivityThread.main(ActivityThread.java:5845)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:797)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.w3xplorers.cmch.MainActivity" on path: DexPathList[[zip file "/data/app/com.w3xplorers.cmch-1/base.apk"],nativeLibraryDirectories=[/data/app/com.w3xplorers.cmch-1/lib/arm, /system/lib, /vendor/lib, system/vendor/lib, system/vendor/lib/egl, system/lib/hw]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.app.Instrumentation.newActivity(Instrumentation.java:1085)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2385)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2544) …Run Code Online (Sandbox Code Playgroud) 我正在开发一个Firebase android项目。当我尝试从android studio运行该应用程序时,显示错误。
Error:Execution failed for task ':app:transformDexArchiveWithDexMergerForDebug'.
> com.android.build.api.transform.TransformException: java.io.IOException: EOCD signature not found in the last 22 bytes of the file.
Run Code Online (Sandbox Code Playgroud)
其实,我不知道这是什么问题,为什么会出现?有谁可以帮助我吗?