[Android] App crashes at start.
See original GitHub issueSteps to reproduce:
cordova create test-app com.test.sample
cordova platform add android
cordova run android # It's ok
cordova plugin add cordova-admob-plus --variable ADMOB_APPLICATOIN_ID=<MY_ADMOB_APPID>
cordova run android # crash
adb logcat messages:
adb logcat com.test.sample *:E
10-07 14:18:41.528 27114 27114 E AndroidRuntime: FATAL EXCEPTION: main
10-07 14:18:41.528 27114 27114 E AndroidRuntime: Process: com.test.sample, PID: 27114
10-07 14:18:41.528 27114 27114 E AndroidRuntime: java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException:
10-07 14:18:41.528 27114 27114 E AndroidRuntime:
10-07 14:18:41.528 27114 27114 E AndroidRuntime: ******************************************************************************
10-07 14:18:41.528 27114 27114 E AndroidRuntime: * The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers *
10-07 14:18:41.528 27114 27114 E AndroidRuntime: * should follow the instructions here: https://goo.gl/fQ2neu to add a valid *
10-07 14:18:41.528 27114 27114 E AndroidRuntime: * App ID inside the AndroidManifest. Google Ad Manager publishers should *
10-07 14:18:41.528 27114 27114 E AndroidRuntime: * follow instructions here: https://goo.gl/h17b6x. *
10-07 14:18:41.528 27114 27114 E AndroidRuntime: ******************************************************************************
10-07 14:18:41.528 27114 27114 E AndroidRuntime:
10-07 14:18:41.528 27114 27114 E AndroidRuntime:
10-07 14:18:41.528 27114 27114 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:6501)
10-07 14:18:41.528 27114 27114 E AndroidRuntime: at android.app.ActivityThread.installContentProviders(ActivityThread.java:6064)
10-07 14:18:41.528 27114 27114 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5968)
10-07 14:18:41.528 27114 27114 E AndroidRuntime: at android.app.ActivityThread.-wrap1(Unknown Source:0)
10-07 14:18:41.528 27114 27114 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1684)
10-07 14:18:41.528 27114 27114 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:105)
10-07 14:18:41.528 27114 27114 E AndroidRuntime: at android.os.Looper.loop(Looper.java:164)
10-07 14:18:41.528 27114 27114 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6759)
10-07 14:18:41.528 27114 27114 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
10-07 14:18:41.528 27114 27114 E AndroidRuntime: at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
10-07 14:18:41.528 27114 27114 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:770)
As described in the instructions link https://goo.gl/fQ2neu, I need to manually add a meta-data
to the AndroidManifest.xml
file to resolve this error.
Can this be fixed?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Why do my apps keep crashing on Android, How to fix it
How to fix apps that keep crashing on Android · 1. Force stop the app · 2. Restart the device · 4. Reinstall...
Read more >How to Stop Apps From Crashing on Android - AVG
Press and hold the Power button. · Wait until you see options to Restart or Power off. · Select Restart to start up...
Read more >Why Do My Apps Keep Crashing on Android? - Avast
1. The “Force stop” method · 2. Restart your Android device · 3. Keep your phone updated · 4. Clear your cached data...
Read more >How to Fix It When Apps Keep Crashing on Android - Lifewire
How to Fix When Apps Keep Crashing on Android · Reboot your Android. · turn on Wi-Fi on your Android and test the...
Read more >8 Ways to Fix Android Apps Crashing - MakeUseOf
Tap to open the number of available networks. Choose the one you want to use. Enter the password, and you will start receiving...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
A quick workaround for me was to add the following to my
config.xml
inside of the<platform name="android">
block:I also had to add
xmlns:android="http://schemas.android.com/apk/res/android"
towidget
.I think if these changes (of course with replacing with the correct App-ID) would be added to the plugins
plugin.xml
everything would be fine.Thanks all. Problem solved for my case: