Google AdMob-无法使用统一的SDK,因为com.android.gms.ads.InterstitialAd在“ com.google.android.gms:play-services-ads:15.0.1”上不存在

时间:2018-09-26 20:58:31

标签: android unity3d admob google-play-services ads

我正在尝试将sdk集成到我的Unity项目中,但是当我调用加载非页内广告的方法时,我收到了一个异常提示Failed resolution of: Lcom/google/android/gms/ads/InterstitialAd.

我检查了com.google.android.gms:play-services-ads:15.0.1程序包,但在那儿找不到此类。我想念一些进口商品吗?

这是我遇到的错误

W/System.err: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/ads/InterstitialAd;
                at com.google.unity.ads.Interstitial$1.run(Interstitial.java:66)
                at android.os.Handler.handleCallback(Handler.java:739)
                at android.os.Handler.dispatchMessage(Handler.java:95)
                at android.os.Looper.loop(Looper.java:145)
                at android.app.ActivityThread.main(ActivityThread.java:5942)
                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:1400)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
            Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.ads.InterstitialAd" on path: DexPathList[[zip file "/data/app/com.test.app-1/base.apk", zip file "/data/app/com.test.app-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.test.app-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)
                ... 9 more
                Suppressed: java.lang.ClassNotFoundException: com.google.android.gms.ads.InterstitialAd
                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)
                    ... 10 more
                Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
E/AndroidRuntime: FATAL EXCEPTION: main
                Process: com.test.app, PID: 3786
                java.lang.Error: FATAL EXCEPTION [main]
                Unity version     : 2018.2.6f1
                Device model      : samsung GT-I9505
                Device fingerprint: samsung/jfltevj/jflte:5.0.1/LRX22C/I9505VJUHOC1:user/release-keys

                Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/ads/InterstitialAd;
                    at com.google.unity.ads.Interstitial$1.run(Interstitial.java:66)
                    at android.os.Handler.handleCallback(Handler.java:739)
                    at android.os.Handler.dispatchMessage(Handler.java:95)
                    at android.os.Looper.loop(Looper.java:145)
                    at android.app.ActivityThread.main(ActivityThread.java:5942)
                    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:1400)
                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
                Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.ads.InterstitialAd" on path: DexPathList[[zip file "/data/app/com.test.app-1/base.apk", zip file "/data/app/com.test.app-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.test.app-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.test.app-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.google.unity.ads.Interstitial$1.run(Interstitial.java:66) 
                    at android.os.Handler.handleCallback(Handler.java:739) 
                    at android.os.Handler.dispatchMessage(Handler.java:95) 
                    at android.os.Looper.loop(Looper.java:145) 
                    at android.app.ActivityThread.main(ActivityThread.java:5942) 
                    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:1400) 
                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195) 
                    Suppressed: java.lang.ClassNotFoundException: com.google.android.gms.ads.InterstitialAd
                    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)
                            ... 10 more
                Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

0 个答案:

没有答案