Ad plugins throw exceptions while building

Hey @Rob and @vlad,

I’ve been testing the latest corona build (i.e. 2019.3498) for a couple of days now. I am now able to build 64-bit apps with most of the plugins working.

Previously, when I tried building, I was getting some lengthy errors along with a “BUILD FAILURE” message. I kept trying while removing the plugins from build.settings one by one hoping to pinpoint the ones that are causing the build to fail. It turns out that the ad plugins were the ones responsible. I was able to successfully build apks and run them on devices.  

Surprisingly, when I was building on  WINDOWS,  I was able to build apks even after including certain plugins like applovin, supersonic and inmobi But what happens as a result is when I install the app on a device and then try running it, it crashes and I can’t even see the splash screen. On Mac though, I can’t build apks unless I remove all ad related plugins from build.settings.

I am including the logs from my Mac which should provide you with all the details with regards to the build error. As said, I was able to build apks on Windows while including some of these plugins, but the app crashes everytime I run it. In case you need the logs for crash related error let me know and I can post that as well. 

Cheers.

Dear @vlads,

I had posted on the other thread yesterday that ad plugins are not working in the 64-bit builds. As you can see, I had raised this issue a few days back and even attached the logs pertaining to the same, and yet I received no response.

None of the ad networks I tried seem to work. These include applovin, ironsource(supersonic), inmobi and vungle. I had even  noticed people complaining about admob and appodeal ad plugins as well on other threads. I even tried implementing facebook ads today and still got the same error. This time though I was able to build the app but when attempted to install and run it on a device, it crashed.

I’m attaching the logs that I was able to extract after enabling adb to get you a better insight of the error. I’d like to request you to look into the problem and identify the cause as soon as possible as this has been bothering us for some time now.

Here’s the link to pastebin to access logs- https://pastebin.com/fd5WmaLr

Thanks.

I’ve pinged engineering.

@Rob, is there any update on this? We’ve now also tried Facebook audience network but it’s the same problem with all ad networks in the 64-bit builds 

I’d download the latest 64-bit version (3502) and give it a spin.

http://developer.coronalabs.com/sites/default/files/corona/2019.3502/Corona-2019.3502.dmg

http://developer.coronalabs.com/sites/default/files/corona/2019.3502/Corona-2019.3502.msi

Rob

We tried that build as soon as vlads posted on another topic that a new build was available but the problem still persists. Would be quite helpful if you can let us know what the word from engineering is with regards these plugins because if they say it should work, maybe we are missing something and we’ll check again at our end.

You have to be more specific than that. I just tried AdMob, Appodeal beta and Unity Ads plugin, seems to build and work fine. You probably have some plugin which spoils the build, and I can’t figure out which one without you posting which you are using.

Please, put on specific plugin list you have in build.settings.

Vlads, I actually work with the OP so like he’s said in the first post, the problem we’re facing is with:
Applovin, vungle, ironsource, inmobi

Now, we’ve also tried facebook audience network and it’s the same problem. All logs and details are already posted on the thread so please have a look when you get a chance.

There’s nothing wrong with our implementation because everythinf works perfectly when we switch to one of the older corona builds.

Thanks

Based on this:

07-08 17:15:32.917 12756 12756 E AndroidRuntime: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 07-08 17:15:32.917 12756 12756 E AndroidRuntime: \* The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers \* 07-08 17:15:32.917 12756 12756 E AndroidRuntime: \* should follow the instructions here: https://goo.gl/fQ2neu to add a valid \* 07-08 17:15:32.917 12756 12756 E AndroidRuntime: \* App ID inside the AndroidManifest. Google Ad Manager publishers should \* 07-08 17:15:32.917 12756 12756 E AndroidRuntime: \* follow instructions here: https://goo.gl/h17b6x. \* 07-08 17:15:32.917 12756 12756 E AndroidRuntime: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

You need to update your build.settings in the android section.

See the AdMob docs under project management settings:  http://docs.coronalabs.com/plugin/admob/index.html#project-settings

This is new with the 64-bit builds and the updated AdMod SDK. This also impacts Appodeal.

I don’t know why you’re getting AdMob errors since you’re using Applovin, Vungle, IronSource and InMobi. The duplicate symbols should have been addressed several builds ago.

Can you please share your build.settings file?

Rob

Thank you. Looking into plugins you mentioned.

Also, please, separate issues: there are build failures, there are crashes. Crashes are mostly caused by a technicality: our plugins rely on shared plugins. One of thouse is google ad id. Proble was that google ad id was together with AdMob. And now, when updated, AdMob requires to be initialized and used. So I moved out the ad-id into separate shared plugin. Vungle is doing something funny, but they maintain their own plugin,  I don’t really want to touch it.

It’s not like “nothing works”. Just try excluding Vungle, and some plugins would start working. I’m updating plugins referring admob to not require whole admob, just ads-identifier.

Appreciate the inputs vlads and Rob. I get the point about build failure vs crashes-- on Mac, the builds just fail but they do go through on Windows and then the app crashes after we load it on an Android device. 

Admittedly we need to reorganise things a little at this stage because we may have gotten mixed up having tried too many permutations in our attempt to get this working during the past few days. 

Will report back soon after trying your suggestions. cheers!

@vlads- just curious if you guys have or will be putting in a request to folks at Vungle to revise their plugin?

btw, I updated all plugins not to require AdMob id. There should be much less crashing now. Working on the issues.

Thanks for understanding. You goal here same us ours - to make your existing apps work. If they don’t build/don’t work, but was before, we want to fix it.

I updated all most the ads plugins, and actually tried to update Vungle plugin for new build system. It seems quite straightforward. I also emailed Vungle with suggested changes.

Please, try to build your app again, and see how it goes.

Thanks!

Thanks! We are now finally able to get applovin running after using dummy values for the admob app Id. We’ll try other plugins as well and post any significant findings.

You’re welcome. By the way. Applovin (and other plugins) should work without dummy values for app id. Please confirm.

Hey!

Thanks for your continued support Rob and vlads. We were finally able to run most of the ad plugins by including adMob APP_ID in the build.settings. From the logs, it can be seen that the app crashes due to an IllegalStateException caused by MobileAdsInitProvider. The other ad plugins are for some reason failing to initialise unless the following entry is added to the android table inside build.settings :

applicationChildElements =

        {

            [[

                <meta-data android:name=“com.google.android.gms.ads.APPLICATION_ID”

                    android:value="[YOUR_ADMOB_APP_ID]"/>  – replace with your app id. 

            ]],

        }

It is also mentioned in AdMob’s official documentation that adding a meta-data tag is compulsory. This was the message provided :

Important:  This step is required as of Google Mobile Ads SDK version 17.0.0. Failure to add this <meta-data> tag results in a crash with the message: “The Google Mobile Ads SDK was initialized incorrectly.”

more info can be found here : https://developers.google.com/admob/android/quick-start

So we tried adding the above bit of code and for APP_ID, we copied a sample key provided in adMob’s documentation and built the app. Surprisingly, the app wasn’t crashing anymore and ad networks started showing ads. 

We understand that this shouldn’t be the case as you mentioned in one of your previous posts that all plugins have been updated and they shouldn’t require app id any more. But as of now, when I don’t include an adMob app id in build.settings(while using ad plugins like appLovin, supersonic etc.), the app crashes. Hope this information helps you diagnose the problem. If you require any more information, feel free to ask.

PS-  I’ve done all my testing using the latest build i.e. 3502.

Cheers!

Thanks. Can you give full list of plugins used? AdMob entry should not be required. If some plugin still requires it, I’ll fix it.
Please, give plugins as they are in your build settings.

Sure, here’s a list of plugins that we use,

plugins =

    {

        [“plugin.vungle”] =

        {

            publisherId = “com.vungle”

        },

        [“plugin.applovin”] =

        {

            publisherId = “com.coronalabs”,

        },

        [“plugin.supersonic”] =

        {

            publisherId = “com.coronalabs”

        },

        [“plugin.inMobi”] =

        {

            publisherId = “com.coronalabs”

        },

        [“plugin.fbAudienceNetwork”] =

        {

            publisherId = “com.coronalabs”

        },

        [“CoronaProvider.native.popup.social”] =

        {

            publisherId = “com.coronalabs”,

            supportedPlatforms = { iphone=true, android=true }

        },

        [“CoronaProvider.native.popup.activity”] =

        {

            publisherId = “com.coronalabs”,

            supportedPlatforms = {iphone=true}

        },

        [‘plugin.vibrator’] = 

        {

            publisherId = ‘com.spiralcodestudio’

        },

        [“plugin.notifications.v2”] =

        {

            publisherId = “com.coronalabs”

        },

        [“plugin.google.iap.v3”] =

        {

            publisherId = “com.coronalabs”

        },

        [“shared.google.play.services.gcm”] =

        {

            publisherId = “com.coronalabs”,

            supportedPlatforms = { android=true }

        },

        [“plugin.googleAnalytics”] =

        {

            publisherId = “com.coronalabs”,

            supportedPlatforms = { iphone=true, android=true }

        },

        [“plugin.gameanalytics_v2”] =

        {

            publisherId = “com.gameanalytics”,

            supportedPlatforms = { iphone=true, android=true }

        },

        [“plugin.gpgs”] = {

            publisherId = “com.coronalabs”,

            supportedPlatforms = {android = true}

        },

        [“CoronaProvider.gameNetwork.apple”] =

        {

            publisherId = “com.coronalabs”,

            supportedPlatforms = { iphone=true }

        },

        [“plugin.flurry.analytics”] =

        {

            publisherId = “com.coronalabs”

        },

        [“plugin.tenjin”] =

        {

            publisherId = “com.coronalabs”

        },

    },

I must remind you that the app crashes only when I include ad plugins i.e. vungle, applovin, supersonic, inmobi and fbAudienceNetwork. If I remove these plugins from build.settings, the app doesn’t crash. Guess you don’t have to test for all the above mentioned plugins.

Thanks!

All that plugins should be good to go without stub AdMob id.

Actually, only AdMob (and Appodeal) plugins require AdMob manifest entry now.