wequick / Small

A small framework to split app into small parts
http://code.wequick.net/Small
Apache License 2.0
5.05k stars 1.11k forks source link

NoClassDefFoundError #569

Open guokejiang opened 6 years ago

guokejiang commented 6 years ago

错误报告

你做了什么?

编译且运行了APP

你期望的结果是什么?

APP能够运行起来!

实际结果是什么?

跳转插件报错

Small环境

Compile-time

  gradle-small plugin : 1.3.0-beta5 (maven)
            small aar : 1.3.0-beta5 (maven)
    small binding aar : 1.1.2 (maven)
          gradle core : 4.1
       android plugin : 2.3.0
                   OS : Windows 10 10.0 (amd64)

Bundles

type name PP sdk aapt support file(armeabi) size
host app 26 26.0.2 26.1.0
app app.main 0x77 26 26.0.2 26.1.0 *_main.so 6.1 KB
lib lib.style 0x79 26 26.0.2 26.1.0 *_style.so 5 KB

Runtime

E/AndroidRuntime: FATAL EXCEPTION: main Process: cn.liucd.test, PID: 6773 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{cn.liucd.test/cn.liucd.test.app.main.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "cn.liucd.test.app.main.MainActivity" on path: DexPathList[[zip file "/data/app/cn.liucd.test-2/lib/arm/libcn_liucd_test_lib_style.so", dir "/data/app/cn.liucd.test-2/lib/arm/libcn_liucd_test_lib_style.so", zip file "/data/app/cn.liucd.test-2/lib/arm/libcn_liucd_test_app_main.so", dir "/data/app/cn.liucd.test-2/lib/arm/libcn_liucd_test_app_main.so", zip file "/data/app/cn.liucd.test-2/base.apk"],nativeLibraryDirectories=[/data/app/cn.liucd.test-2/lib/arm, /data/app/cn.liucd.test-2/base.apk!/lib/armeabi, /vendor/lib, /system/lib]] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2391) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2544) at android.app.ActivityThread.access$1000(ActivityThread.java:154) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1398) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:157) at android.app.ActivityThread.main(ActivityThread.java:5668) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:740) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:630) Caused by: java.lang.ClassNotFoundException: Didn't find class "cn.liucd.test.app.main.MainActivity" on path: DexPathList[[zip file "/data/app/cn.liucd.test-2/lib/arm/libcn_liucd_test_lib_style.so", dir "/data/app/cn.liucd.test-2/lib/arm/libcn_liucd_test_lib_style.so", zip file "/data/app/cn.liucd.test-2/lib/arm/libcn_liucd_test_app_main.so", dir "/data/app/cn.liucd.test-2/lib/arm/libcn_liucd_test_app_main.so", zip file "/data/app/cn.liucd.test-2/base.apk"],nativeLibraryDirectories=[/data/app/cn.liucd.test-2/lib/arm, /data/app/cn.liucd.test-2/base.apk!/lib/armeabi, /vendor/lib, /system/lib]] 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:1068) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2381) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2544)  at android.app.ActivityThread.access$1000(ActivityThread.java:154)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1398)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:157)  at android.app.ActivityThread.main(ActivityThread.java:5668)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:740)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:630)  Suppressed: java.lang.ClassNotFoundException: cn.liucd.test.app.main.MainActivity at java.lang.Class.classForName(Native Method) at java.lang.BootClassLoader.findClass(ClassLoader.java:781) at java.lang.BootClassLoader.loadClass(ClassLoader.java:841) at java.lang.ClassLoader.loadClass(ClassLoader.java:504) ... 12 more Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available

  Device : 小米4
     SDK : Android 6.0.1
     ABI : armeabi-v7a
galenlin commented 6 years ago

从日志看,已经成功加载了 lib.styleapp.main 插件,请确认类名有无拼写错误:“cn.liucd.test.app.main.MainActivity”