I'm trying to implement a rewarded ad using google dev guides here and here , the ad shows up and the callbacks are called normally when using the test ad-unit ca-app-pub-3940256099942544/5224354917 on the emulator , then I replaced the test ad unit with mine, launched on a physical device, the ad doesn't load up and function onRewardedVideoAdFailedToLoad is called.
in the log I found
GoogleService failed to initialize, status: 10, Missing google app id value from string resources with name google_app_id.
I went on and created a firebase account just to download google-services.json and get the mobilesdk_app_id, then I added it to the Strings resources. Now when it launches the ad fails to load again, and I found this in the log
Disabling data collection. Found google_app_id in strings.xml but Google Analytics for Firebase is missing. Remove this value or add Google Analytics for Firebase to resume data collection.
I'm using com.google.gms:google-services:4.3.0
I couldn't find anything in the guide to help
Did you add add
apply plugin: 'com.google.gms.google-services'
to the bottom of your modules build.gradle?
You app_id needs to go to your AndroidManifest.xml as well
<manifest>
<application>
<!-- Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713 -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"/>
</application>
</manifest>
see here: https://developers.google.com/admob/android/quick-start#update_your_androidmanifestxml
Related
In my Flutter project, I have 2 flavors: free and full, and I use Codemagic for my CI/CD.
Only the free version comes with a Google ad banner. So I added the com.google.android.gms.permission.AD_ID permission in the manifest, then run my build on Codemagic, for the full version only.
Then I went to my Google Play console, and I got the error : This version includes the com.google.android.gms.permission.AD_ID permission, but your statement in the Play Console indicates that your app does not use the advertising ID., which is true (again, for the full version only).
So I add 2 new AndroidManifest.xml files in my project, one in free, one in full, and removed the permission from the main AndroidManifest.xml file.
Here is the content of the manifest in the android/app/src/free directory:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mistikee.mistikee.mistikee">
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
</manifest>
And here is the content of the manifest in the android/app/src/full directory:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mistikee.mistikee.mistikee">
</manifest>
Then I launched a new build on Codemagic, everything went fine, until I went to the Google Play console, and I still got the same error. I really don't understand why. It looks like there is a cache issue somewhere.
How can I fix that, without going to the console telling that I use the advertising ID (because, again, I don't use it in the full version)?
Thanks.
I am trying to release a Flutter based Android app to the Play Store.
When I review my release in Play Store console, I have the following warning:
You must complete the advertising ID declaration before you can release an app that targets Android 13 (API 33). We'll use this declaration to provide safeguards in Play Console to accommodate changes to advertising ID in Android 13.
Apps targeting Android 13 or above and using advertising ID must include the com.google.android.gms.permission.AD_ID permission in the manifest.
I have followed the advice and added the following to my android/app/src/main/AndroidManifest.xml:
</application>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
</manifest>
When I 'flutter clean', create and upload a new bundle, I'm still getting the same warning. Does anyone know how to resolve this warning?
Note: I have incorporated Google Ads in my app using the google_mobile_ads plugin.
Luke
There are 2 steps that you have to follow to solve this problem.
add com.google.android.gms.permission.AD_ID permission in the manifest file.
Go to your Google Play Console select the app which you are trying to upload then on the left side go to Policy and programs -> App content in there fill the Advertising ID form.
So you have already done step 1. Now complete step 2 and upload your app again.
Go to your Google Play Console select the app which you are trying to upload then on the left side go to Policy -> App content in there fill the Advertising ID form.
Only if you answered with Yes in the form shown above, add the line shown below to your AndroidManifest.xml:
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
I added the package to my app putting the meta data with the API key and all that and it was working ok so I started working on other parts of my app and when I tried to use it again some time later it started giving me this exception:
Unhandled Exception: Platform Exception(error, java.lang.IllegalStateException: A required meta-data tag in your app's AndroidManifest.xml
its telling me to add the following to my AndroidManifest.xml:
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
however i didn't need this line before and it was working just fine, why is it asking for it out of nowhere? I added it but now its crashing whenever it tries to load the map saying FATAL EXCEPTION: Thread-3. Can anyone help please?
It looks like you are using some kind of Google Mobile Services (GMS) APIs in your app. Google Maps API is one of them. As the error suggests, just add the meta-data to your AndroidManifest.xml to solve the problem. If you read the docs on how to properly set up Google Maps API or other GMS APIs in your app, you can find that you have to define the meta-data on AndroidManifest.xml as well.
Hope this helps.
We are doing the beta-test of our android app this time. Is there any way to stop android emulators from sending crash reports to the Firebase Console?
First we have to look at the devices of each problem to manually close them because we don't see if the problem comes from developing/testing or from a beta-tester.
Use this in your custom Application class onCreate method:
FirebaseCrash.setCrashCollectionEnabled(!BuildConfig.DEBUG);
If you compile the debug APK for emulators you are fine
You can add a meta-data entry to the AndroidManifest.xml for your app to disable Crash Reporting at build time.
<meta-data android:name="firebase_crash_collection_enabled" android:value="false" />
Or you can disable by adding in Application or MainActivity,
FirebaseCrash.setCrashCollectionEnabled(false);
For more info check this link,
https://firebase.google.com/docs/crash/disable-sdk
I tried to upgrade my implementation of AdMob. Using the GoogleAdMobSDK, I would like to turn into the google-play-services-lib.
The ad appears. So it seems ok, but I still got this error at the method call loadAd() in log
Requesting resource 0x7f0c000d failed because it is complex
GooglePlayServicesUtil: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
Here's my checklist:
I import the library project in my workspace, copying the source.
I reference the library into my project
I add the meta-data in the Manifest
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
My code
this.request = new AdRequest.Builder().addTestDevice(id).build();
this.adView = new AdView(context);
this.adView.setAdUnitId(MY_AD_UNIT_ID);
this.adView.setAdSize(AdSize.SMART_BANNER);
...
this.adView.loadAd(request);
The target version for my app in 9 (2.3). I test on Nexus 5 with KitKat version.
I also tried to put the google-play-services-lib jar in the properties, but no result.
I want to be sure that this error could be handle before submit my app.
This is a benign error with the current version of Google Play Services.
Don't worry about it. Submit your app. Get some sleep.