Android 8 samsung admob not showing ads - android

I have an application with admob.
It works on all devices, but it doesn't show ads on android 8 samsung devices.
It also works samsung's other versions and other brands all versions including android 8.
I get following error.
2018-10-12 21:21:47.508 13284-31190/? E/Ads: Error waiting for future.
java.util.concurrent.ExecutionException: java.util.concurrent.TimeoutException
at com.google.android.gms.ads.internal.util.future.af.get(:com.google.android.gms#14366015#14.3.66 (040300-213742215):18)
at com.google.android.gms.ads.internal.util.future.g.a(:com.google.android.gms#14366015#14.3.66 (040300-213742215):11)
at com.google.android.gms.ads.internal.request.service.c.a(:com.google.android.gms#14366015#14.3.66 (040300-213742215):62)
at com.google.android.gms.ads.internal.request.service.c.a(:com.google.android.gms#14366015#14.3.66 (040300-213742215):169)
at com.google.android.gms.ads.internal.request.service.f.run(:com.google.android.gms#14366015#14.3.66 (040300-213742215):1)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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
at com.google.android.gms.ads.internal.util.future.m.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
For ads, I use following version:
implementation 'com.google.android.gms:play-services-ads:17.0.0'
Manifest File
<?xml version="1.1" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.package.app">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="#mipmap/icon"
android:label="#string/app_name"
android:roundIcon="#mipmap/roundicon"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".DepartmentCoursesActivity" />
<activity android:name=".ExamDetailActivity" />
<activity android:name=".AddLessonActivity" />
<activity android:name=".LoginActivity" />
<activity android:name=".CourseExamListActivity" />
<activity android:name=".ImageZoomActivity"></activity>
<!-- Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713 -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="[MY_AD_ID]"/>
</application>
</manifest>
And also there is following log, it may be related
2018-10-12 21:21:46.618 1764-1764/? E/ServiceUtils: [#MLP#] Unable to get package name: android.content.pm.PackageManager$NameNotFoundException: com.samsung.ipservice (com.samsung.ipservice)
at android.app.ApplicationPackageManager.getPackageInfoAsUser (ApplicationPackageManager.java:301)
at android.app.ApplicationPackageManager.getPackageInfo (ApplicationPackageManager.java:272)
at com.samsung.mlp.platform.utils.ServiceUtils.isPackageAvailable (ServiceUtils.java:55)
at com.samsung.mlp.platform.framework.ItemFetchTask.buildImageSelectionSchema (ItemFetchTask.java:147)
at com.samsung.mlp.platform.framework.ItemFetchTask.buildMediaSelectionSchema (ItemFetchTask.java:129)
at com.samsung.mlp.platform.framework.ItemFetchTask.<init> (ItemFetchTask.java:107)
at com.samsung.mlp.platform.framework.LPServiceController.setupExecutors (LPServiceController.java:200)
at com.samsung.mlp.platform.framework.LPServiceController.<init> (LPServiceController.java:179)
at com.samsung.mlp.platform.framework.LPServiceController.getInstance (LPServiceController.java:168)
at com.samsung.mlp.platform.LPService.onBind (LPService.java:49)
at android.app.ActivityThread.handleBindService (ActivityThread.java:3571)
at android.app.ActivityThread.-wrap2 (null:0)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1791)
at android.os.Handler.dispatchMessage (Handler.java:105)
at android.os.Looper.loop (Looper.java:164)
at android.app.ActivityThread.main (ActivityThread.java:6944)
at java.lang.reflect.Method.invoke (Method.java:-2)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)

Add below code in manifest file
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="#android:style/Theme.Translucent" />
Hope this will work...!

Related

java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException

Suddenly, I tried to open my application and the app did not wanted to start. It stopped before opening it. I started searching and tried all of other similar questions, but none worked. this is my log:
2020-07-18 22:27:41.652 21042-21042/? I/art: Not late-enabling -Xcheck:jni (already on)
2020-07-18 22:27:41.652 21042-21042/? W/art: Unexpected CPU variant for X86 using defaults: x86
2020-07-18 22:27:41.878 21042-21042/? W/System: ClassLoader referenced unknown path: /data/app/com.ainimei.remotemouse-1/lib/x86
2020-07-18 22:27:41.900 21042-21042/? D/AndroidRuntime: Shutting down VM
2020-07-18 22:27:41.900 21042-21042/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.ainimei.remotemouse, PID: 21042
java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException:
******************************************************************************
* The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers *
* should follow the instructions here: *
* https://googlemobileadssdk.page.link/admob-android-update-manifest *
* to add a valid App ID inside the AndroidManifest. *
* Google Ad Manager publishers should follow instructions here: *
* https://googlemobileadssdk.page.link/ad-manager-android-update-manifest. *
******************************************************************************
at android.app.ActivityThread.installProvider(ActivityThread.java:5856)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5445)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5384)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.IllegalStateException:
******************************************************************************
* The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers *
* should follow the instructions here: *
* https://googlemobileadssdk.page.link/admob-android-update-manifest *
* to add a valid App ID inside the AndroidManifest. *
* Google Ad Manager publishers should follow instructions here: *
* https://googlemobileadssdk.page.link/ad-manager-android-update-manifest. *
******************************************************************************
at com.google.android.gms.internal.ads.zzyz.attachInfo(com.google.android.gms:play-services-ads-lite##19.2.0:33)
at com.google.android.gms.ads.MobileAdsInitProvider.attachInfo(com.google.android.gms:play-services-ads-lite##19.2.0:3)
at android.app.ActivityThread.installProvider(ActivityThread.java:5853)
... 10 more
here is my androidManifest.xml:
note that the code has no meta-data tag. But I never needed it until now. Also my app does not use ads on it.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ainimei.remotemouse">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<application
android:allowBackup="true"
android:fullBackupContent="true"
android:icon="#drawable/ainimei_logo_icon"
android:label="#string/app_name"
android:roundIcon="#drawable/ainimei_logo_icon"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".SelectConnectionType" />
<activity android:name=".ControlBluetoothConnection" />
<activity android:name=".Connection" />
<activity
android:name=".KeyboardActivity"
android:screenOrientation="landscape" />
<activity
android:name=".ProfileSettingsActivity"
android:screenOrientation="portrait" />
<activity
android:name=".loginActivity"
android:screenOrientation="portrait" />
<activity
android:name=".buyPremiumActivity"
android:screenOrientation="portrait" />
<activity
android:name=".select_control"
android:screenOrientation="portrait" />
<activity
android:name=".SettingsActivity"
android:screenOrientation="portrait" />
<activity
android:name=".MainActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
I keep trying anyways.
In your manifest file , inside the application tag put this code
<application>
<!-- Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713 -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
/// pass the key generated from your admob which contains ~(APP ID)
android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"/> //
</application>
just check whether meta-data tag is out of activity tag
if it is like this
<manifest>
<application>
<activity>
<meta-data>
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-4347201915048498~6120388314"/>
</activity>
</application>
</manifest>
this should be changed to this
<manifest>
<application>
<activity>
</activity>
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-4347201915048498~6120388314"/>
</application>
</manifest>

Fatal Exception: android.content.ActivityNotFoundException | android.gms.ads.AdActivity (ADMOB)

Since today at an amazing speed Admob is crashing when trying to display an Add according to Firebase.
Also Crashlytics is not getting the mapping... do not know why
This happens in every version of android 4, 5, 6, 7, 8, 9, 10.
Fatal Exception: android.content.ActivityNotFoundException
Unable to find explicit activity class {com.myCompany.myApp/com.google.android.gms.ads.AdActivity}; have you declared this activity in your AndroidManifest.xml?
com.myCompany.myApp.GameActivity.E
android.app.Instrumentation.checkStartActivityResult (Instrumentation.java:1933)
android.app.Instrumentation.execStartActivity (Instrumentation.java:1616)
android.app.ContextImpl.startActivity (ContextImpl.java:904)
android.app.ContextImpl.startActivity (ContextImpl.java:882)
android.content.ContextWrapper.startActivity (ContextWrapper.java:383)
com.google.android.gms.internal.ads.Di.a (Unknown Source:9)
com.google.android.gms.ads.internal.overlay.zzn.a (Unknown Source:77)
com.google.android.gms.internal.ads.KC.a (Unknown Source:76)
com.google.android.gms.internal.ads.zu.a (Unknown Source:9)
com.google.android.gms.internal.ads.cF.showInterstitial (Unknown Source:24)
com.google.android.gms.internal.ads.Cea.c (Unknown Source:7)
com.google.android.gms.ads.InterstitialAd.c (Unknown Source:2)
com.myCompany.myApp.GameActivity.E (Unknown Source:82)
com.myCompany.myApp.X.onClick (Unknown Source:4)
android.view.View.performClick (View.java:6390)
Tried to reproduce the error locally, but couldn't
This started suddenly... and is in the only app that I'm getting that error in Firebase (all are implemented the same way)
Gradle
dependencies {
...
implementation 'com.google.android.gms:play-services-ads:18.2.0'
implementation 'com.google.firebase:firebase-core:17.2.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
...
}
MANIFEST
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myCompany.MyApp"
android:installLocation="auto">
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true"
android:xlargeScreens="true"
/>
<application
android:allowBackup="true"
android:fullBackupContent="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:largeHeap="true"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme"
>
<uses-library
android:name="org.apache.http.legacy"
android:required="false"/>
<meta-data
android:name="com.google.android.gms.ads.AD_MANAGER_APP"
android:value="true"/>
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="THENUMBERFORMYADMOB"/>
<service
android:name=".services.MusicService"
android:enabled="true"/>
<meta-data
android:name="firebase_crashlytics_collection_enabled"
android:value="${crashlyticsCollectionEnabled}" />
<activity
android:name=".SplashActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name=".LevelsActivity"
android:label="#string/title_activity_game"
android:parentActivityName=".SplashActivity">
</activity>
<activity
android:name=".GameActivity"
android:keepScreenOn="true"
android:label="#string/title_activity_game"
android:parentActivityName=".LevelsActivity">
</activity>
...
OTHER ACTIVITIES
...
</application>
</manifest>
I implemented Admob accordingly to the guide.
¿Should I add an Admob activity?
In google play crash report I'm getting reports regarding
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)
WebViewGoogle.apk
#00 pc 00000000008fca14 /system/app/WebViewGoogle/WebViewGoogle.apk
But this has been for a long time (since 1' July... when started suddenly with a spike...) and google is "fixing it"... could this be related?

Trying to connect Firebase plus FB Auth and get error

Trying to connect FB Auth to Firebase. Appears error
FATAL EXCEPTION: main
Process: com.borisruzanov.social, PID: 20684
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.borisruzanov.social/com.borisruzanov.social.FacebookLoginActivity}: A valid Facebook app id must be set in the AndroidManifest.xml or set by calling FacebookSdk.setApplicationId before initializing the sdk.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2665)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: A valid Facebook app id must be set in the AndroidManifest.xml or set by calling FacebookSdk.setApplicationId before initializing the sdk.
at com.facebook.FacebookSdk.sdkInitialize(FacebookSdk.java:276)
at com.facebook.FacebookSdk.sdkInitialize(FacebookSdk.java:232)
at com.borisruzanov.social.FacebookLoginActivity.onCreate(FacebookLoginActivity.java:49)
at android.app.Activity.performCreate(Activity.java:6679)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618
Here is my manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.borisruzanov.social">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".AuthPage">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".GoogleSignInActivity" >
</activity>
<activity android:name=".PhoneAuthActivity" >
</activity>
<activity android:name=".FacebookLoginActivity"
>
<meta-data android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id"/>
</activity>
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="#string/app_name" />
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="#string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
</application>
</manifest>
And also i dont understand why initialization of SDK is not actual and it stroked. I have tried solutions which on stack. Doesn't help.
Also if any1 know the good example where Firebase and Facebook auth integrated well? Because as always firebase guide is totally collapsed my brain.
You need add
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//initialize Facebook SDK
FacebookSdk.sdkInitialize(getApplicationContext());
if (BuildConfig.DEBUG) {
FacebookSdk.setIsDebugEnabled(true);
FacebookSdk.addLoggingBehavior(LoggingBehavior.INCLUDE_ACCESS_TOKENS);
}
setContentView(R.layout.activity_main); }
Need add meta-data to Application
<application android:label = "#string/app_name" ... >
...
<meta-data android:name = "com.facebook.sdk.ApplicationId" android:value = "#string/facebook_app_id" />
...
</ application>
instead of
<activity android:name=".FacebookLoginActivity"
>
<meta-data android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id"/>
</activity>
You don't really need to initialize FacebookSDK manually as it gets initialized automatically, just change your manifest file as #Boris showed. Hope it will work now.

java.lang.RuntimeException: Package manager has died

I got the following exception from crashlytics on a API Level 22 YU5510 device. The frequency of occurring this exception is not that higher. Is it any hardware related issue or device specific issue?
Exception java.lang.RuntimeException: Unable to start receivercom.google.firebase.iid.FirebaseInstanceIdInternalReceiver: java.lang.RuntimeException: Package manager has died
android.app.ActivityThread.handleReceiver (ActivityThread.java:2649)
android.app.ActivityThread.access$1800 (ActivityThread.java:154)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1398)
android.os.Handler.dispatchMessage (Handler.java:102)
android.os.Looper.loop (Looper.java:135)
android.app.ActivityThread.main (ActivityThread.java:5292)
java.lang.reflect.Method.invoke (Method.java)
java.lang.reflect.Method.invoke (Method.java:372)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:904)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:699)
arrow_drop_down
Caused by java.lang.RuntimeException: Package manager has died
android.app.ApplicationPackageManager.resolveService (ApplicationPackageManager.java:638)
com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.zze ()
com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.zzh ()
com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.zzb ()
com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.onReceive ()
android.app.ActivityThread.handleReceiver (ActivityThread.java:2642)
android.app.ActivityThread.access$1800 (ActivityThread.java:154)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1398)
android.os.Handler.dispatchMessage (Handler.java:102)
android.os.Looper.loop (Looper.java:135)
android.app.ActivityThread.main (ActivityThread.java:5292)
java.lang.reflect.Method.invoke (Method.java)
java.lang.reflect.Method.invoke (Method.java:372)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:904)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:699)
arrow_drop_down
Caused by android.os.DeadObjectException:
android.os.BinderProxy.transactNative (Binder.java)
android.os.BinderProxy.transact (Binder.java:496)
android.content.pm.IPackageManager$Stub$Proxy.resolveService (IPackageManager.java:2669)
android.app.ApplicationPackageManager.resolveService (ApplicationPackageManager.java:632)
com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.zze ()
com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.zzh ()
com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.zzb ()
com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.onReceive ()
android.app.ActivityThread.handleReceiver (ActivityThread.java:2642)
android.app.ActivityThread.access$1800 (ActivityThread.java:154)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1398)
android.os.Handler.dispatchMessage (Handler.java:102)
android.os.Looper.loop (Looper.java:135)
android.app.ActivityThread.main (ActivityThread.java:5292)
java.lang.reflect.Method.invoke (Method.java)
java.lang.reflect.Method.invoke (Method.java:372)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:904)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:699)
This is my manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sss.lll" >
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<!-- <uses-permission android:name="android.permission.GET_ACCOUNTS" />-->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:name="com.sss.lll.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.sss.lll.permission.C2D_MESSAGE" />
<application
android:allowBackup="false"
android:icon="#drawable/m_icon"
android:label="#string/app_name"
android:name="MyApp"
android:theme="#style/AppTheme">
<activity
android:name=".activities.MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activities.ListActivity"
android:launchMode= "singleTop"
android:screenOrientation="portrait"></activity>
<activity android:name=".activities.DetailActivity"
android:launchMode= "singleTop"
android:parentActivityName=".activities.ListActivity"
android:screenOrientation="portrait"></activity>
<activity android:name=".activities.WebviewActivity"
android:launchMode= "singleTop"
android:parentActivityName=".activities.ListActivity"
android:screenOrientation="portrait"></activity>
<activity android:name=".activities.ViewPagerImageActivity"
android:launchMode= "singleTop"
android:parentActivityName=".activities.DetailActivity"
android:screenOrientation="portrait"></activity>
<activity android:name=".activities.LikeActivity"
android:launchMode= "singleTop"
android:parentActivityName=".activities.ListActivity"
android:screenOrientation="portrait"
></activity>
<service
android:name=".MyFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<service
android:name=".MyFirebaseInstanceIDService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
<meta-data
android:name="io.fabric.ApiKey"
android:value="1234567899" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="#drawable/ic_notification" />
</application>
</manifest>
Add this receiver and check it.
Internal receiver for FirebaseInstanceId used to start services securely. This receiver is automatically added to your application's manifest file via manifest merge. If necessary it can be manually declared via:
<receiver
android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver"
android:exported="false" />

AdMob still not working

I got a problem regarding Google AdMob:
I try to display a Interstitial, for this I have added the AdActivity, permissions and meta-tags to manifest.
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.lunation.warface"
android:versionCode="10"
android:versionName="1.4" >
<uses-sdk
android:minSdkVersion="13"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="#drawable/icon"
android:label="#string/app_name"
android:largeHeap="true"
android:theme="#style/AppTheme"
android:windowSoftInputMode="adjustPan|adjustResize" >
<!--This meta-data tag is required to use Google Play Services.-->
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<!--Include the AdActivity configChanges and theme. -->
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="#android:style/Theme.Translucent" />
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:screenOrientation="sensorPortrait"
android:windowSoftInputMode="adjustPan|adjustResize" >
<intent-filter>
</intent-filter>
</activity>
<activity
android:name=".SplashScreen"
android:noHistory="true"
android:screenOrientation="sensorPortrait"
android:theme="#style/Theme.Transparent" >
<intent-filter>
<action android:name="android.intent.action.MAIN" >
</action>
<category android:name="android.intent.category.LAUNCHER" >
</category>
</intent-filter>
</activity>
<activity android:name="gallery.FullScreenViewActivity"></activity>
</application>
</manifest>
In MainActivity:
mInterstitialAd = new InterstitialAd(this);
mInterstitialAd.setAdUnitId("xxx/xxx");
AdRequest adRequest = new AdRequest.Builder().build();
mInterstitialAd.loadAd(adRequest);
if (mInterstitialAd != null && mInterstitialAd.isLoaded()) {
mInterstitialAd.show();
}
Logcat:
04-04 15:15:19.397: W/Ads(19752): There was a problem getting an ad response. ErrorCode: 0
04-04 15:15:19.407: I/dalvikvm(19752): Could not find method android.webkit.WebSettings.setMixedContentMode, referenced from method com.google.android.gms.ads.internal.s.g.<init>
04-04 15:15:19.407: W/dalvikvm(19752): VFY: unable to resolve virtual method 3153: Landroid/webkit/WebSettings;.setMixedContentMode (I)V
04-04 15:15:19.407: D/dalvikvm(19752): VFY: replacing opcode 0x6e at 0x004a
04-04 15:15:19.502: W/Ads(19752): Failed to load ad: 0
Besides there is also a compilation error:
Conversion of dalvik format failed with error code 1
I tried about 20 answers, still not working.
I also dont know whether the problem is the unit id, I can change
mInterstitialAd.setAdUnitId("xxx/xxx");
to:
mInterstitialAd.setAdUnitId("xxx");
and I got the same errors.
I use the following external libraries:
android support v4&v7, picasso, ftpclient(commons, httpmime),FAB
Does somebody have a advice?
Greetings
Solution found!
Seems like some features in CyanogenMod blocks AdMob.
Flashed a new version WITHOUT Adaware and blocking Tools.
WORKING NOW :D

Categories

Resources