Describe the bug
I am making simple empty phaser html5. and try to initialize adMob. but it failed
To Reproduce
Steps to reproduce the behavior:
Make simple phaser 3 projects
Make capcitor app
Adding android from npm
Adding this
npm install @capacitor-community/admob
npx cap update
Adding this
npm install --save @capacitor-community/admob@5.0.0
npx cap update
Go to Android folder. editing manifest adding
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="@string/admob_app_id"/>
Go to android/app/src/main/res/values/strings.xml, adding this
[APP_ID]
Go to variables.gradle, adding this
playServicesAdsVersion = '22.0.0'
androidxCoreKTXVersion = '1.10.0'
Goto phaser 3 game before, making main.ts. Adding this
import { AdMob } from '@capacitor-community/admob';
export async function initialize(): Promise {
const { status } = await AdMob.trackingAuthorizationStatus();
if (status === 'notDetermined') {
/**
If you want to explain TrackingAuthorization before showing the iOS dialog,
you can show the modal here.
ex)
const modal = await this.modalCtrl.create({
component: RequestTrackingPage,
});
await modal.present();
await modal.onDidDismiss(); // Wait for close modal
**/
}
*Result I get
Initialization admob failed, get this error
java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException:
Describe the bug I am making simple empty phaser html5. and try to initialize adMob. but it failed
To Reproduce Steps to reproduce the behavior:
export async function initialize(): Promise {
const { status } = await AdMob.trackingAuthorizationStatus();
if (status === 'notDetermined') { /**
await modal.onDidDismiss(); // Wait for close modal **/ }
AdMob.initialize({ requestTrackingAuthorization: true, testingDevices: ['2077ef9a63d2b398840261c8221a0c9b'], initializeForTesting: true, }); } comple ts
Expected behavior Initialization admob success
*Result I get Initialization admob failed, get this error java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException: