Mohamad Al Asmar
Mohamad Al Asmar

Reputation: 1177

Ionic cordova app built as android app bundle doesn't work [Shows white screen] when admob-plus-cordova plugin is installed

Describe the bug

Ionic cordova app built for production as android app bundle doesn't work while admob-plus-cordova plugin is installed. The app shows white screen after launch.

To Reproduce

Steps to reproduce the behavior:

  1. Create new ionic app with cordova using ionic start myapp --cordova
  2. Add the plugin using the cli from docs:
ionic cordova plugin add admob-plus-cordova
npm install @admob-plus/ionic
  1. Generate ionic app bundle using & sign it ionic cordova build android --prod --release -- -- --packageType=bundle
  2. Upload the app to google play store and download the apk then run it on device Result: app shows white screen

Note: When I remove the plugin "admob-plus-cordova" and uninstall @admob-plus/ionic package, the apk from aab will work normally!

Expected behavior

The app should launch normally not stuck on white screen, when I run ionic cordova run android without --prod --releaseflag the app works but in prod and after aab release it doesn't

Screenshots screen2

Environment

ionic-info: (coz npx admob-plus info doesn't work inside ionic project)

Ionic:

   Ionic CLI                     : 6.18.2 (C:\Users\moasmar\AppData\Roaming\npm\node_modules\@ionic\cli)
   Ionic Framework               : @ionic/angular 6.0.11
   @angular-devkit/build-angular : 13.2.6
   @angular-devkit/schematics    : 13.2.6
   @angular/cli                  : 13.2.6
   @ionic/angular-toolkit        : 6.1.0

Cordova:

   Cordova CLI       : 11.0.0
   Cordova Platforms : android 10.1.1
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 4 other plugins)

Utility:

   cordova-res (update available: 0.14.0) : 0.11.0
   native-run                             : 1.5.0

System:

   Android SDK Tools : 26.1.1 (C:\Users\moasmar\AppData\Local\Android\Sdk)
   NodeJS            : v16.14.0 (C:\Program Files\nodejs\node.exe)
   npm               : 8.5.4
   OS                : Windows 10

Upvotes: 0

Views: 807

Answers (1)

Niklas Merz
Niklas Merz

Reputation: 195

If your app starts with a white screen you could have a look at the JavaScript console through Google Chrome and USB to see the errors that might appear. Android Studio also lets you check logs via Logcat which can be helpful.

Upvotes: -1

Related Questions