Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException
This happened due to updated AdMob SDK. Now you need to add appID in your manifest file.
<application> . . .
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-################~##########"/>
</application>
You can get appID from here -->Google addmob -->Select app --> App Settings --> App ID.
You can read more from here ads-developers.
If you want to use test ads before putting your own id check the AdMob test ids from here developers.google.
Hope this will help you. Thanks :)
React native Admob Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException:
Add this line in your project AndroidManifest.xml, inside 'application' tag
<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="[appid here]"/>
AdMob causing: unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.ClassNotFoundException
I got a similar error and this solved it.
In biuld.gradle (Module)
android {
...
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
}
Android 8.1 Unable to get provider com.google.android.gms.ads.MobileAds!!! apk crash
There are 2 ad ids in Admob.
1). appID
2). adUnitID
For an app whatever the your ad type you use, the appID is same. But the the adUnitID differs for the each ad type you use. For example, you can have both banner ads and interstitial ads in the App. For both of those ad types appID is same, but the adUnitID differs.
As per your code you have used the same ID everywhere, which is not correct. You need to use appID, adUnitID in appropriate places. In layout xml, where you declare the ad unit it should have adUnitID and other places appID.
Manifest.xml
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value=**appID**/>
MainActivity Layout
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_gravity="bottom"
android:layout_weight="1"
ads:adSize="SMART_BANNER"
ads:adUnitId=**adUnitID**>
HomeActivity.java
MobileAds.initialize(this, **appID**);
So in your case, it seems that you have used adUnitID for the the places you should have used appID. That's probably why it throws the error as in
******************************************************************************
* Invalid application ID. Follow instructions here: Link to *
* find your app ID. *
******************************************************************************
Refer this link on how to find out appID and adUnitID for your adMob
Unable to integrate Google Mobile Ads in Flutter
To get application id create admob app then create ad units for your app and then you get both appid and ad units to get start.
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"/>
Related Topics
Material Design Not Styling Alert Dialogs
Swiperefreshlayout Setrefreshing() Not Showing Indicator Initially
Custom Cut/Copy Action Bar for Edittext That Shows Text Selection Handles
How to Add APKs in an Aosp Build
How to Create a Relativelayout Programmatically with Two Buttons One on Top of the Other
"Canvas: Trying to Draw Too Large Bitmap" When Android N Display Size Set Larger Than Small
Intent to Launch the Clock Application on Android
Why Mediaplayer Throws Not Present Error When Creating Instance of It
How to Apply Zoom, Drag and Rotation to an Image in Android
Volley Android Networking Library
How to Provide Animation When Calling Another Activity in Android
Default Interface Methods Are Only Supported Starting with Android 7.0 (Nougat)
How to Force an Entire Layout View Refresh
Gatt Callback Fails to Register