我正在尝试在我的项目中使用HeyZapAd SDK,但无法正常工作。当我查看logcat时,发现没有找到SDK的类文件,并且其中许多文件被混淆了。即使禁用Proguard,此问题仍然存在。
更新:我已经在Android Studio中创建了一个新项目,并添加了HeyZap SDK,但仍然遇到相同的错误。我不确定在将SDK添加到项目中时是否做错了什么,或者问题出在SDK上!
请查看我的app / build.gradle和logcat的某些部分。
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.animalsdrawingbook.android"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0.0"
multiDexEnabled true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
}
}
}
repositories {
flatDir {
dirs 'libs'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
// compile project(':SupportLibrary')
implementation project(':SupportLibrary-release')
// compile project(':infinitecycleviewpager')
// compile 'com.android.support:cardview-v7:25.3.1'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.jakewharton:butterknife:8.4.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
// compile 'com.github.Andreu35:BrushView:v.1.0'
implementation 'com.fyber:fairbid:9.56.0'
// implementation 'com.google.android.gms:play-services-ads:17.2.1'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.kila.apprater_dialog.lars:apprater-dialog:1.0.5'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
}
这是logcat
2019-07-11 08:44:14.025 1842-1842/? E/LoadedApk: Unable to instantiate appComponentFactory
java.lang.ClassNotFoundException: Didn't find class "android.support.v4.app.CoreComponentFactory" on path: DexPathList[[],nativeLibraryDirectories=[/data/app/com.animalsdrawingbook.android-YRbWpN3NP24S4xy4YKzMyw==/lib/x86, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.LoadedApk.createAppFactory(LoadedApk.java:226)
at android.app.LoadedApk.updateApplicationInfo(LoadedApk.java:338)
at android.app.ActivityThread.handleDispatchPackageBroadcast(ActivityThread.java:5388)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1733)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at com.android.server.SystemServer.run(SystemServer.java:454)
at com.android.server.SystemServer.main(SystemServer.java:294)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:838)
2019-07-11 08:44:14.030 1586-1645/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 8298496
2019-07-11 08:44:14.029 1842-1857/? W/BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_REPLACED dat=package:com.animalsdrawingbook.android flg=0x4000010 (has extras) } to com.google.android.apps.photos/.account.full.FetchAccountPropertiesAppUpgradeBroadcastReceiver
2019-07-11 08:44:14.066 1842-1842/? E/LoadedApk: Unable to instantiate appComponentFactory
java.lang.ClassNotFoundException: Didn't find class "android.support.v4.app.CoreComponentFactory" on path: DexPathList[[],nativeLibraryDirectories=[/data/app/com.animalsdrawingbook.android-YRbWpN3NP24S4xy4YKzMyw==/lib/x86, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.LoadedApk.createAppFactory(LoadedApk.java:226)
at android.app.LoadedApk.updateApplicationInfo(LoadedApk.java:338)
at android.app.ActivityThread.handleDispatchPackageBroadcast(ActivityThread.java:5388)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1733)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at com.android.server.SystemServer.run(SystemServer.java:454)
at com.android.server.SystemServer.main(SystemServer.java:294)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:838)
2019-07-11 08:44:16.344 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: Rejecting re-init on previously-failed class java.lang.Class<com.heyzap.sdk.a.a.a$a>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/adcolony/sdk/AdColonyInterstitialListener;
2019-07-11 08:44:16.344 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at java.lang.Object java.lang.reflect.Constructor.newInstance0(java.lang.Object[]) (Constructor.java:-2)
2019-07-11 08:44:16.344 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at java.lang.Object java.lang.reflect.Constructor.newInstance(java.lang.Object[]) (Constructor.java:343)
2019-07-11 08:44:16.344 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at com.heyzap.mediation.a.c com.heyzap.mediation.a.c.a(java.lang.Class) (SourceFile:292)
2019-07-11 08:44:16.344 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void com.heyzap.mediation.d$1.run() (SourceFile:2055)
2019-07-11 08:44:16.344 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void com.heyzap.common.c.l.run() (SourceFile:26)
2019-07-11 08:44:16.344 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void com.heyzap.common.c.l.run() (SourceFile:26)
2019-07-11 08:44:16.344 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at java.lang.Object java.util.concurrent.Executors$RunnableAdapter.call() (Executors.java:458)
2019-07-11 08:44:16.345 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void java.util.concurrent.FutureTask.run() (FutureTask.java:266)
2019-07-11 08:44:16.347 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run() (ScheduledThreadPoolExecutor.java:301)
2019-07-11 08:44:16.347 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1167)
2019-07-11 08:44:16.347 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:641)
2019-07-11 08:44:16.347 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void java.lang.Thread.run() (Thread.java:764)
2019-07-11 08:44:16.347 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.adcolony.sdk.AdColonyInterstitialListener" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.animalsdrawingbook.android-x2pjcInqNV9lazUhBLhW_w==/base.apk"],nativeLibraryDirectories=[/data/app/com.animalsdrawingbook.android-x2pjcInqNV9lazUhBLhW_w==/lib/x86, /system/lib]]
2019-07-11 08:44:16.349 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:134)
2019-07-11 08:44:16.349 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
2019-07-11 08:44:16.349 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
2019-07-11 08:44:16.349 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at java.lang.Object java.lang.reflect.Constructor.newInstance0(java.lang.Object[]) (Constructor.java:-2)
2019-07-11 08:44:16.349 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at java.lang.Object java.lang.reflect.Constructor.newInstance(java.lang.Object[]) (Constructor.java:343)
2019-07-11 08:44:16.349 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at com.heyzap.mediation.a.c com.heyzap.mediation.a.c.a(java.lang.Class) (SourceFile:292)
2019-07-11 08:44:16.349 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void com.heyzap.mediation.d$1.run() (SourceFile:2055)
2019-07-11 08:44:16.349 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void com.heyzap.common.c.l.run() (SourceFile:26)
2019-07-11 08:44:16.349 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void com.heyzap.common.c.l.run() (SourceFile:26)
2019-07-11 08:44:16.349 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at java.lang.Object java.util.concurrent.Executors$RunnableAdapter.call() (Executors.java:458)
2019-07-11 08:44:16.349 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void java.util.concurrent.FutureTask.run() (FutureTask.java:266)
2019-07-11 08:44:16.349 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run() (ScheduledThreadPoolExecutor.java:301)
2019-07-11 08:44:16.349 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1167)
2019-07-11 08:44:16.349 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:641)
2019-07-11 08:44:16.350 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void java.lang.Thread.run() (Thread.java:764)
2019-07-11 08:44:16.351 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: Rejecting re-init on previously-failed class java.lang.Class<com.heyzap.sdk.a.a.a$a>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/adcolony/sdk/AdColonyInterstitialListener;
2019-07-11 08:44:16.351 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at java.lang.Object java.lang.reflect.Constructor.newInstance0(java.lang.Object[]) (Constructor.java:-2)
2019-07-11 08:44:16.351 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at java.lang.Object java.lang.reflect.Constructor.newInstance(java.lang.Object[]) (Constructor.java:343)
2019-07-11 08:44:16.351 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at com.heyzap.mediation.a.c com.heyzap.mediation.a.c.a(java.lang.Class) (SourceFile:292)
2019-07-11 08:44:16.351 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void com.heyzap.mediation.d$1.run() (SourceFile:2055)
2019-07-11 08:44:16.351 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void com.heyzap.common.c.l.run() (SourceFile:26)
2019-07-11 08:44:16.351 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void com.heyzap.common.c.l.run() (SourceFile:26)
2019-07-11 08:44:16.351 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at java.lang.Object java.util.concurrent.Executors$RunnableAdapter.call() (Executors.java:458)
2019-07-11 08:44:16.351 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void java.util.concurrent.FutureTask.run() (FutureTask.java:266)
2019-07-11 08:44:16.351 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run() (ScheduledThreadPoolExecutor.java:301)
2019-07-11 08:44:16.351 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1167)
2019-07-11 08:44:16.351 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:641)
2019-07-11 08:44:16.351 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void java.lang.Thread.run() (Thread.java:764)
2019-07-11 08:44:16.351 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.adcolony.sdk.AdColonyInterstitialListener" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.animalsdrawingbook.android-x2pjcInqNV9lazUhBLhW_w==/base.apk"],nativeLibraryDirectories=[/data/app/com.animalsdrawingbook.android-x2pjcInqNV9lazUhBLhW_w==/lib/x86, /system/lib]]
2019-07-11 08:44:16.351 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:134)
2019-07-11 08:44:16.351 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
2019-07-11 08:44:16.352 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
2019-07-11 08:44:16.352 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at java.lang.Object java.lang.reflect.Constructor.newInstance0(java.lang.Object[]) (Constructor.java:-2)
2019-07-11 08:44:16.352 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at java.lang.Object java.lang.reflect.Constructor.newInstance(java.lang.Object[]) (Constructor.java:343)
2019-07-11 08:44:16.352 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at com.heyzap.mediation.a.c com.heyzap.mediation.a.c.a(java.lang.Class) (SourceFile:292)
2019-07-11 08:44:16.352 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void com.heyzap.mediation.d$1.run() (SourceFile:2055)
2019-07-11 08:44:16.352 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void com.heyzap.common.c.l.run() (SourceFile:26)
2019-07-11 08:44:16.353 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void com.heyzap.common.c.l.run() (SourceFile:26)
2019-07-11 08:44:16.354 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at java.lang.Object java.util.concurrent.Executors$RunnableAdapter.call() (Executors.java:458)
2019-07-11 08:44:16.354 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void java.util.concurrent.FutureTask.run() (FutureTask.java:266)
2019-07-11 08:44:16.354 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run() (ScheduledThreadPoolExecutor.java:301)
2019-07-11 08:44:16.354 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1167)
2019-07-11 08:44:16.354 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:641)
2019-07-11 08:44:16.354 25959-26017/com.animalsdrawingbook.android I/ingbook.androi: at void java.lang.Thread.run() (Thread.java:764)