Admob with Applovin crashes because of plugin.google.play.services

Hello

I am Sahil, Corona Pro user from last 7 years. I have done a lot of projects using corona for Android and ios.

Today while adding Admob and Applovin in a single project. I was surprised that Applovin is still using the obsolete plugin plugin.play.services while Admob is ready with latest Android dependencies.

Now if i remove the Plugin.play.services then applovin crashes and if i add then Admob crashes.

I read somewhere that Applovin have removed the dependency but with the latest build 2017.3068 the problem still persists as i have tested the scenario a lot of time now by adding and removing one or other plugin.

They work perfect alone but crashing on using together. Please suggest me how to achieve this as i want to add Admob and Applovin both in my project because Client is God for a developer.

Also i added chartboost which shows Ad on device for a while and now not showing, Is it because i need to turn on test mode or something else is there. Will this work on device perfectly after launch?

Looking for a quick response. Thanks in Advance.

Thanks,

Sahil sharma

@Sahil

Neither AdMob nor Applovin require the legacy Play Services plugin.

I tested just now by putting AdMob and Applovin in the same app, and they both initialize successfully.

Can you post your build.settings file?

It may help identify the issue.

Hello Ingemar,

Yes Below is my Build.settings code.

 

settings = {

splashScreen = 

    {

        enable = false

    },

orientation = {

default = “landscapeLeft”,

supported = { “landscapeLeft”,“landscapeRight”}

},

plugins = {

[“plugin.applovin”] =

{

publisherId = “com.coronalabs”

},

[“plugin.google.play.services”] =

{

publisherId = “com.coronalabs”,

supportedPlatforms = { android=true }

},

[“plugin.admob”] =

{

publisherId = “com.coronalabs”,

supportedPlatforms = { android=true },

},

[“plugin.CoronaSplashControl”] =

{

publisherId = “com.coronalabs”,

supportedPlatforms = {android=true },

},

[“plugin.notifications”] =

{

publisherId = “com.coronalabs”

},

[“plugin.gpgs”] =

{

publisherId = “com.coronalabs”,

supportedPlatforms = { android=true }

},

[“plugin.chartboost”] =

{

publisherId = “com.coronalabs”

},

},

android =

{

googlePlayGamesAppId = “664694682017”,

usesPermissions =

{

“android.permission.INTERNET”,

“android.permission.ACCESS_NETWORK_STATE”,

“android.permission.VIBRATE”,

“android.permission.WRITE_EXTERNAL_STORAGE”

},

},

}

NOTE: Following are the scenarios:

1: If i remove Admob plugin and its code from AdsLib then Applovin works good.
2: If i remove Admob Plugin and play service plugin then app crashes saying “Unfortunately xxxx stopped”

3: If i remove Applovin and Play services and add Admob plugin and enable its code in AdsLib then it works great too.

AdsLib simply holds calls to init admob, applovin and chartboost so have no error in it.

Thanks,

Sahil

@Sahil

From the list above you can remove [“plugin.google.play.services”] as it’s not needed anymore.

I added the plugin list above (with the google.play.services plugin removed) to one of my sample apps and it does not crash during initialization. Can you try this scenario and see if it works for you?

Hello Ingemar,

Yes i already tried that. It crashes as soon as it starts. Saying unfortunately xxx has stopped

I am not getting this now. Removing either admob or Aplovin is working great but both fails for me. I am using the latest build 2017.3068. May be it has some issues

Please try to do this with the latest sdk.

Thanks,

Yes, I’m using the latest build 3068 to build the app, and for me it’s working.

I see you are using [“plugin.notifications”].

Are you using only local notifications, or are you also using GCM push notifications?

In any case you should *not* include [“plugin.google.play.services”] in your plugin list, as it’s not used anymore by any of our plugins and it may cause conflicts if it’s present.

(I can see that the Applovin documentation mentions it. It has actually been removed from the documentation already, but for some reason the live documentation hasn’t been updated with the latest revision)

May I ask which device model are you testing on, and which version of Android is it running?

I am using Samsung S4 for testing and i have not used any android version.  It may be using the default version. 

Samsung S4 comes with Android 4.2.2 (API level 17) installed by default, so that should rule out any OS version related issues.

Unfortunately I cannot reproduce the issue you are having. You should definitely remove [“plugin.google.play.services”] from your plugin list to avoid potential conflicts, though.

I can only recommend to have a look at the device log and see the reason for the crash. When the app exits with an “Unfortunately xxx has stopped” message, there are entries in the log that specify why it crashed.

Once you have that information, it would be helpful if you could update this thread with the reason of the crash, so that I can continue to provide assistance.

@Sahil,

If possible, you can send a PM to me and attach your APK. I can then have a look at the log to help figure out what’s wrong.

There is nothing shown in logs, Please send me your email id, I will send the apk now.

To send a PM to me, click on my name ‘ingemar_cl’ on the left.

Then click the “Send message” button. You can add the APK as an attachment.

Thanks for the APK.

I’ve had a look at it and I’ve found the issue.

Somewhere in your code you are trying to load an AdMob banner with an adUnitId assigned to an interstitial ad.

Hello Ingemar,

Thanks for the support. Yes this was the case and Its working good now.

Thanks,

Hello Ingemar,

 

Damn I guessed this but never tried as i thought why it is working then after removing the Applovin plugin and init call? I did a blunder, sorry for this.

I have not used the banner Ads in game but yes there was a module which was loading both banner and Interstitial Ads and Id was used same as of Interstitial one.

Though i was using just Interstitial so I never thought like this.

One thing is clear that Loading banner using Interstitial Id was causing the issue, i just tested after removing call and it works great but what makes it run when i was removing the Applovin plugin and its init in code. I cannot understand this. lol

 

Also can you please tell me which Logcat i use to address such issues in future. I was using the ALV (Active log viewer) which was unable to output the log on this issue.

 

I am so thankful to you that you provide me such a great help and in best time.

 

Thanks,

 

Sahil

No problem! Glad that I could help.

BTW. I use ‘adb logcat’ (without any filtering) from the command line to read the Android logs. 

The logs will contain *a lot* of chatter but I usually output the logcat to file and then use a text editor to manually go through the entries.

In this case it was a crash, so I searched for “FATAL”, which brought me directly to your issue.

I’m also in the process of handling this type of error from within the AdMob plugin, so that if it happens in the future the app will not crash. It will report it in the device log instead.

ok, That would be perfect. 

@Sahil

FYI. The AdMob plugin will handle the error without crashing now. The update has been pushed and is live on our build servers.

Hello Ingemar,

Ahhh that’s a great news. I am sure this will help developers to avoid any crash by such loading.

Thanks,

Sahil