之前使用的apk都是在调试模式下直接生成的,结果这次也不知道哪里出问题调试产生的apk总是报下面的错误,于是单独产生apk来解决。
/*********************************************************************
* Android Studio单独生成apk
* 说明:
* 之前使用的apk都是在调试模式下直接生成的,结果这次也不知道哪里出问题
* 调试产生的apk总是报下面的错误,于是单独产生apk来解决。
*
* 2017-8-8 深圳 龙华樟坑村 曾剑锋
********************************************************************/
一、错误信息:
I/InstantRun(26932): starting instant run server: is main process
D/AndroidRuntime(26932): Shutting down VM
E/AndroidRuntime(26932): FATAL EXCEPTION: main
E/AndroidRuntime(26932): Process: com.android.aplex.wachendorffbringup, PID: 269 32
E/AndroidRuntime(26932): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.android.aplex.wachendorffbringup/com.android.aplex.wachendorffbringup.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.android.aplex.wachendorffbringup.MainActivity" on path: DexPathList[[zip file "/data/app/com.android.aplex.wachendorffbringup-1/base.apk"],nativeLibraryDirectories=[/data/app/com.android.aplex.wachendorffbringup-1/lib/arm, /vendor/lib,/system/lib]]
E/AndroidRuntime(26932): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2236)
E/AndroidRuntime(26932): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
E/AndroidRuntime(26932): at android.app.ActivityThread.access$800(ActivityThread.java:151)
E/AndroidRuntime(26932): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
E/AndroidRuntime(26932): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(26932): at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime(26932): at android.app.ActivityThread.main(ActivityThread.java:5254)
E/AndroidRuntime(26932): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(26932): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(26932): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
E/AndroidRuntime(26932): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
E/AndroidRuntime(26932): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.android.aplex.wachendorffbringup.MainActivity" on path: DexPathList
[[zip file "/data/app/com.android.aplex.wachendorffbringup-1/base.apk"],nativeLibraryDirectories=[/data/app/com.android.aplex.wachendorffbringup-1/lib/arm, /vendor/lib, /system/lib]]
E/AndroidRuntime(26932): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
E/AndroidRuntime(26932): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
E/AndroidRuntime(26932): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
E/AndroidRuntime(26932): at android.app.Instrumentation.newActivity(Instrumentation.java:1066)
E/AndroidRuntime(26932): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2226)
E/AndroidRuntime(26932): ... 10 more
E/AndroidRuntime(26932): Suppressed: java.lang.ClassNotFoundException: com.android.aplex.wachendorffbringup.MainActivity
E/AndroidRuntime(26932): at java.lang.Class.classForName(Native Method)
E/AndroidRuntime(26932): at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
E/AndroidRuntime(26932): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
E/AndroidRuntime(26932): at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
E/AndroidRuntime(26932): ... 13 more
E/AndroidRuntime(26932): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
W/ActivityManager( 401): Force finishing activity 1 com.android.aplex.wachendorffbringup/.MainActivity
I/OpenGLRenderer( 401): Initialized EGL, version 1.4
E/BufferQueueProducer( 121): [Application Error: com.android.aplex.wachendorffbringup] dequeueBuffer: can't dequeue multiple buffers without setting the buffer
count
W/ActivityManager( 401): Activity pause timeout for ActivityRecord{7de90ed u0 com.android.aplex.wachendorffbringup/.MainActivity t39 f}
I/OpenGLRenderer( 1010): Initialized EGL, version 1.4
E/BufferQueueProducer( 121): [com.android.launcher/com.android.launcher2.Launcher] dequeueBuffer: can't dequeue multiple buffers without setting the buffer cou
nt
W/ResourceType( 759): No package identifier when getting value for resource number 0x00000000
二、解决办法,单独生产apk: