capacitor-community / admob

Community plugin for using Google AdMob
MIT License
205 stars 67 forks source link

Android Implementation failed #250

Closed alvvinsatGloding closed 1 week ago

alvvinsatGloding commented 1 year ago

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:

  1. Make simple phaser 3 projects
  2. Make capcitor app
  3. Adding android from npm
  4. Adding this npm install @capacitor-community/admob npx cap update
  5. Adding this npm install --save @capacitor-community/admob@5.0.0 npx cap update
  6. Go to Android folder. editing manifest adding <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="@string/admob_app_id"/>
  7. Go to android/app/src/main/res/values/strings.xml, adding this [APP_ID]
  8. Go to variables.gradle, adding this playServicesAdsVersion = '22.0.0' androidxCoreKTXVersion = '1.10.0'
  9. 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') { /**

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:

distante commented 1 week ago

App id is missing https://stackoverflow.com/a/52795066/1255819