我AppLovin MAX
在我的 android 应用程序中使用中介,但是当我尝试添加如下横幅广告时
void createBannerView(View view){
final String bannerAdUni = getString(R.string.bannerAdUnits);
adView = new MaxAdView(bannerAdUni,getActivity());
ViewGroup viewGroup = view.findViewById(R.id.content);
adView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.BOTTOM));
viewGroup.addView(adView);
adView.loadAd();
}
我在运行时收到以下错误
AppLovinSdk: [DataCollector] Could not collect Google Advertising ID - this will negatively impact your eCPMs! Please integrate the Google Play Services SDK into your application. More info can be found online at http://developer.android.com/google/play-services/setup.html. If you're sure you've integrated the SDK and are still seeing this message, you may need to add a ProGuard exception: -keep public class com.google.android.gms.** { public protected *; }
java.io.IOException: java.util.concurrent.TimeoutException: Timed out waiting for the service connection
at com.google.android.gms.ads.identifier.AdvertisingIdClient.zza(Unknown Source:16)
at com.google.android.gms.ads.identifier.AdvertisingIdClient.zza(Unknown Source:25)
at com.google.android.gms.ads.identifier.AdvertisingIdClient.getAdvertisingIdInfo(Unknown Source:47)
at com.applovin.impl.sdk.m.c(Unknown Source:15)
at com.applovin.impl.sdk.m.j(Unknown Source:2)
at com.applovin.impl.sdk.m.a(Unknown Source:84)
at com.applovin.impl.sdk.m.a(Unknown Source:11)
at com.applovin.impl.sdk.m.a(Unknown Source:7)
at com.applovin.impl.sdk.EventServiceImpl.a(Unknown Source:24)
at com.applovin.impl.sdk.EventServiceImpl.a(Unknown Source:0)
at com.applovin.impl.sdk.EventServiceImpl$1.run(Unknown Source:29)
at com.applovin.impl.sdk.e.y.run(Unknown Source:2)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.util.concurrent.TimeoutException: Timed out waiting for the service connection
at com.google.android.gms.common.BlockingServiceConnection.getServiceWithTimeout(com.google.android.gms:play-services-basement@@17.5.0:13)
at com.google.android.gms.ads.identifier.AdvertisingIdClient.zza(Unknown Source:4)
at com.google.android.gms.ads.identifier.AdvertisingIdClient.zza(Unknown Source:25)
at com.google.android.gms.ads.identifier.AdvertisingIdClient.getAdvertisingIdInfo(Unknown Source:47)
at com.applovin.impl.sdk.m.c(Unknown Source:15)
at com.applovin.impl.sdk.m.j(Unknown Source:2)
at com.applovin.impl.sdk.m.a(Unknown Source:84)
at com.applovin.impl.sdk.m.a(Unknown Source:11)
at com.applovin.impl.sdk.m.a(Unknown Source:7)
at com.applovin.impl.sdk.EventServiceImpl.a(Unknown Source:24)
at com.applovin.impl.sdk.EventServiceImpl.a(Unknown Source:0)
at com.applovin.impl.sdk.EventServiceImpl$1.run(Unknown Source:29)
at com.applovin.impl.sdk.e.y.run(Unknown Source:2)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
我尝试了大多数解决方案,包括添加 Google Play Services SDK,但我的 Android Emulator 和 Real Device 仍然存在问题。以下是正在使用的依赖项列表
dependencies {
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
/*---------- APPLOvIN -------*/
implementation 'com.applovin:applovin-sdk:+'
implementation 'com.applovin.mediation:vungle-adapter:6.10.2.0'
implementation 'com.applovin.mediation:facebook-adapter:+'
implementation 'com.facebook.android:facebook-android-sdk:12.1.0'
implementation 'com.google.android.gms:play-services-ads-identifier:17.1.0'
implementation 'androidx.ads:ads-identifier:1.0.0-alpha04'
// Used for the calls to addCallback() in the snippets on this page.
implementation 'com.google.guava:guava:28.0-android'
implementation 'com.android.volley:volley:1.2.1'
implementation 'com.google.code.gson:gson:2.8.9'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:2.0.4'
implementation 'com.google.android.gms:play-services-auth-base:17.1.4'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core :3.4.0'}
我ProGuard Exception
按照上面 stackTrace 中的说明添加了
如果您确定已集成 SDK 并且仍然看到此消息,则可能需要添加 ProGuard 异常:-keep public class com.google.android.gms.** { public protected *; }
直到现在我不知道该怎么办..是与AppLovin有关的问题吗?我能做些什么来解决它?