我正在尝试从我的应用中获取 .apk 。我已经运行并调试了它,它运行得很好,但是当我尝试生成 apk 文件并在我的设备上运行它时,该应用程序崩溃了。这是我用来在Android Studio上运行和调试应用程序的设备。
这是我仅调试apk文件时的错误:
I/zygote64: no shared libraies, dex_files: 1
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: app.com.clave, PID: 27029
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{app.com.appclave/app.com.appclave.SplashScreenActivity}: java.lang.ClassNotFoundException: Didn't find class "app.com.appclave.SplashScreenActivity" on path: DexPathList[[zip file "/data/app/app.com.appclave-yXmYCRL4P7N4tjj38LZxFg==/base.apk"],nativeLibraryDirectories=[/data/app/app.com.appclave-yXmYCRL4P7N4tjj38LZxFg==/lib/arm64, /system/lib64, /system/vendor/lib64]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2841)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6944)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Caused by: java.lang.ClassNotFoundException: Didn't find class "app.com.appclave.SplashScreenActivity" on path: DexPathList[[zip file "/data/app/app.com.appclave-yXmYCRL4P7N4tjj38LZxFg==/base.apk"],nativeLibraryDirectories=[/data/app/app.com.appclave-yXmYCRL4P7N4tjj38LZxFg==/lib/arm64, /system/lib64, /system/vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.Instrumentation.newActivity(Instrumentation.java:1180)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2831)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6944)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Application terminated.
我还发现有时候问题出在manifest.xml文件中,但是我已经检查过了,并且我的活动在那里:
<activity
android:name=".SplashScreenActivity"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".BienvenidaActivity" />
<activity android:name=".infoAppActivity" />
<activity android:name=".dudaActivity" />
<activity android:name=".ActivationActivity" />
<activity android:name=".TokenCodeActivity" />
<activity android:name=".informationApp" />
<activity android:name=".NextTokenCodeActivity" />
<activity android:name=".Main"></activity>
</application>
</manifest>
答案 0 :(得分:0)
我曾经遇到过这个问题,特别是在API 26(Android Oreo)上,因为您的设备中有配置文件。问题在于,当您卸载第一个应用程序时,Android仅针对当前用户/个人资料卸载。
您应该做的是为所有用户删除第一个应用程序。
就是这样。