我已经创建了android库(.aar)并集成在我的项目中。构建整个项目没有任何问题。但是每当我在设备上运行时,我发现找不到类,没有找到来自.aar的类。我已经看到那些课程在图书馆项目中,甚至是主要的.APK。我已经启用了multidex,但没有结果。有什么帮助吗?
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/content/a;
at com.galactio.MaterialProgressDialog.onCreate(MaterialProgressDialog.java:157)
at android.app.Dialog.dispatchOnCreate(Dialog.java:373)
at android.app.Dialog.show(Dialog.java:274)
at qi.mnav.Loader.loadingScreen(Loader.java:92)
at qi.tracksynq.ui.LoginActivity_V2.onClick(LoginActivity_V2.java:136)
at android.view.View.performClick(View.java:4785)
at android.view.View$PerformClick.run(View.java:19884)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5343)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.content.a" on path: DexPathList[[zip file "/data/app/com.tracksynq.mobile.sg-1/base.apk"],nativeLibraryDirectories=[/data/app/com.tracksynq.mobile.sg-1/lib/arm, /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 com.galactio.MaterialProgressDialog.onCreate(MaterialProgressDialog.java:157)
at android.app.Dialog.dispatchOnCreate(Dialog.java:373)
at android.app.Dialog.show(Dialog.java:274)
at qi.mnav.Loader.loadingScreen(Loader.java:92)
at qi.tracksynq.ui.LoginActivity_V2.onClick(LoginActivity_V2.java:136)
at android.view.View.performClick(View.java:4785)
at android.view.View$PerformClick.run(View.java:19884)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5343)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
Suppressed: java.lang.ClassNotFoundException: android.support.v4.content.a
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)
... 16 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
在此应用程序类中。
public class MyApplication extends MultiDexApplication {
}
摇篮
android {
compileSdkVersion 23
buildToolsVersion '23.0.3'
useLibrary 'org.apache.http.legacy'
publishNonDefault true
aaptOptions {
cruncherEnabled = false
}
defaultConfig {
minSdkVersion 14
targetSdkVersion 23
multiDexEnabled true
ndk {
moduleName "webp"
}
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
}