Skip to content
This repository has been archived by the owner on May 19, 2021. It is now read-only.

On adding [email protected], app install successfully but crashes on android device after installation. #474

Open
Astha-Anand opened this issue Feb 23, 2021 · 4 comments

Comments

@Astha-Anand
Copy link

We are using cordova-plugin-admob-free latest version in the app. After adding the plugin app crashes on android device.
App build and installed successfully on device but crashes on opening.

Version details:
Ionic - 6.10.1
cordova - 9.0.0 ([email protected])
"cordova-android": "^9.0.0",

Admob plugin details:
"cordova-plugin-admob-free": "^0.27.0",
"cordova-admob-sdk": "^0.24.1",
"@ionic-native/admob-free": "^5.31.1",

Firebasex plugin verion:
"cordova-plugin-firebasex": "^11.0.3"

I have tried multiple solutions but no luck.Can you please look into this issue.

@Giuliopretis
Copy link

Same problem here, android studio gives me two errors:

  • package android.support.annotation does not exist
  • cannot find symbol class NonNull

@BrokerBisiako87
Copy link

I also have the same problem. I added the plugin "cordova-plugin-firebasex" (dpa99c version 11.0.3) and then the plugin cordova-plugin-admob-free (ratson v0.27.0) in my cordova project. The plugins installed together conflict, perhaps the cause is to be seen with gradle config ???
I am using cordova@10 , [email protected] , Gradle 6.8.2 , JVM 1.8.0_281 (Oracle Corporation 25.281-b09).
When I downloaded the ADMOB plugin, and then compiled with "cordova build android --debug", the same error as @Giuliopretis came out. I solved it by installing the following plugins: cordova-plugin-androidx and cordova-plugin-androidx-adapter, but after successful compilation, installing the apk with adb -s SAMSUNG install -t. \ App-debug.apk, after crashes after startup.

@Giuliopretis
Copy link

@BrokerBisiako87 I found out a solution. The problem is that this package is not updated since 2 years, the developer made a "new version" of this package: https://github.com/admob-plus/admob-plus
I would recommend to use that versione instead of this one.

To use this you have to install cordova-plugin-androidx, as you've already done, and change the import to androidx.annotation.NonNull

Then you have to update all the dependencies implementation of google services in the gradle file at the last version. You can find them on google documentation. And then I managed to make it work.

@BrokerBisiako87
Copy link

BrokerBisiako87 commented Mar 5, 2021

Hi @Giuliopretis , thanks for the information.
I was just integrating the new "admob-plus-cordova" package. I saw that in the cordova-plugin-admob-free GitHub repository it writes: "Please use admob-plus if possible".
The update dates back to 24h ago.
I have not installed cordova-plugin-androidx, if I use [email protected]. is already integrated, just enter the following information in the config.xml

<platform name="android">
<preference name="AndroidXEnabled" value="true" />
</platform>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants