Applovin Plugin module error

Hi,
 
I’m trying to integrate the applovin plugin in my app but I always get this error on device:
 
ERROR: Could not load provider (applovin) due to the following reason: module
‘CoronaProvider.ads.applovin’ not found:resource
 
(CoronaProvider.ads.applovin.lu) does not exist in archive
 
no field package.preload['CoronaProvider.ads.applovin]
 
and so on.
 
I’ve already tried to put[lua][“iphone-sim”]=true[/lua] in supported platforms under applovin plugin but I always get the error.

I also have these two Warnings when running on the Corona Simulator:

WARNING: The ‘ads’ provider (applovin) is not available on the simulator

WARNING: The ‘plugin.applovin’ library is not available on this platform.

This is my build.settings

[lua]settings =
{
plugins = {

[“plugin.applovin”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { iphone=true, android=true, appletvos=true, [“iphone-sim”]=true }
},
[“plugin.google.play.services”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { iphone=true, android=true }
},

[“plugin.google.play.services”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { iphone=true, android=true }
},

[“plugin.adbuddiz”] =
{ publisherId = “com.adbuddiz” },

[“CoronaProvider.ads.vungle”] =
{
publisherId = “com.vungle”
},
[“plugin.google.play.services”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { iphone=true, android=true }
},

[“plugin.revmob”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { iphone=true, android=true }
},

[“plugin.flurry.analytics”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { iphone=true, android=true }
},
[“plugin.google.play.services”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { iphone=true, android=true }
},

[“plugin.facebook.v4”] =
{
publisherId = “com.coronalabs”
},

[“CoronaProvider.gameNetwork.google”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { android = true },
},
–[[remove this line to implement iAds
[“CoronaProvider.ads.iads”] =
{
– required
publisherId = “com.coronalabs”,
},
]] --remove this line to implement iAds
[“CoronaProvider.gameNetwork.apple”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { iphone=true, [“iphone-sim”]=true },
},
[“plugin.google.iap.v3”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { android=true }
},
[“plugin.chartboost”] =
{
publisherId = “com.swipeware”
},
[“CoronaProvider.native.popup.social”] =
{
publisherId = “com.coronalabs”
},
},
orientation =
{
default = “portrait”,
supported = { “portrait” }
},
android =
{

facebookAppId = “XXXXXXXXXX”, – Replace XXXXXXXXXX with your Facebook App ID
googlePlayGamesAppId = “372926750211”, --insert your app id number for google game services
usesPermissions =
{
“com.android.vending.BILLING”, --remove this line if you don’t use iAP
“android.permission.INTERNET”,
“android.permission.ACCESS_NETWORK_STATE”,
“android.permission.ACCESS_FINE_LOCATION”,
“android.permission.ACCESS_COARSE_LOCATION”,
–[[remove this line if you use admob and not chartboost
“android.permission.READ_PHONE_STATE”
]]–remove this line if you use admob and not chartboost
},
},
iphone =
{
plist =
{

– Whitelist Facebook Servers for Network Requests
NSAppTransportSecurity =
{

NSAllowsArbitraryLoads=true,

NSExceptionDomains =
{
[“fbcdn.net”] =
{
NSIncludesSubdomains = true,
NSExceptionRequiresForwardSecrecy = false,
},
[“facebook.com”] =
{
NSIncludesSubdomains = true,
NSExceptionRequiresForwardSecrecy = false,
},
[“akamaihd.net”] =
{
NSIncludesSubdomains = true,
NSExceptionRequiresForwardSecrecy = false,
},
},
},

– Whitelist Facebook Apps
LSApplicationQueriesSchemes =
{
“fb”,
“fbapi20130214”,
“fbapi20130410”,
“fbapi20140410”,
“fbapi20140116”,
“fbapi20150313”,
“fbapi20150629”,
“fbauth”,
“fbauth2”,
“fb-messenger-api20140430”,
},

CFBundleIconFile = “Icon.png”,
CFBundleIconFiles =
{
“Icon.png”,
“Icon@2x.png”,
“Icon-60.png”,
“Icon-60@2x.png”,
“Icon-72.png”,
“Icon-72@2x.png”,
“Icon-76.png”,
“Icon-76@2x.png”,
“Icon-Small.png”,
“Icon-Small@2x.png”,
“Icon-Small-40.png”,
“Icon-Small-40@2x.png”,
“Icon-Small-50.png”,
“Icon-Small-50@2x.png”,
},
UIApplicationExitsOnSuspend = false, – must be false for single sign-on to work
FacebookAppID = “XXXXXXXXX”, – replace XXXXXXXXX with your facebook appId

CFBundleURLTypes =
{
{
CFBundleURLSchemes =
{
“fbXXXXXXXXX”, – replace XXXXXXXXX with your facebook appId, make sure that you leave fb in front of it
}
}
}
}
}
}
[/lua]

Thanks

WARNING: The ‘ads’ provider (applovin) is not available on the simulator

WARNING: The ‘plugin.applovin’ library is not available on this platform.

These are to be expected for the Corona Simulator or desktop builds since most vendors don’t provide SDK’s for  more than iOS and Android. The Corona Simulator needs an SDK for either OS X or Windows and the vendors don’t provide them.

Now the other error you shouldn’t be getting if you’re building for iOS or Android and testing on devices. Are you trying to test on the Xcode iOS simulator?

Hi Rob,

No I’m trying to test on an iPhone 4S and I also tried to test on a Nexus 5 and I get the same error.

Before integrating applovin everything was workin perfectly so there is nothing wrong with other things in my app.

I had the same error with the RevMob plugin days ago, but I solved just including [lua]iphone=true[/lua] in every supported Platforms lines in my build.settings. (even those not related with the RevMob plugin).

I tried to remove supported Platforms and I tried to place all of them inside. (inside the plugin line)

Could this be because of something wrong with how the plugin gets called in the adlistener or It is just an error due to how the build.settings is coded?

Thanks for your help

You really don’t need the supportedPlatforms line unless you are wanting to limit which plugins are available. For instance iAds is an iOS only plugin. You don’t really want to include that in your Android builds, so you would use supportedPlatforms = { iphone = true } and when you do an Android build, it won’t attempt to fetch the plugin.

RevMob, AppLovin and such are available in both places, so  you in theory don’t need to include the line.

Rob

I tried the sample for the appLovin plugin and It works perfectly on my phone.

So there is something wrong with the integration in my app. It’s my first app so if you can help me out It will great.

Let’s take a look at my adsLib.lua

So this is my initFunction related to appLovin

adsInitFunctions = { ["applovin"] = function() applovin = require( "plugin.applovin" ) applovin.init( adsListenerFunctions.applovin, { sdkKey="my sdk Key" } ) end,

This is my adsListenerFunction for appLovin:

adsListenerFunctions = { ["applovin"] = function(event) if event.isError then if ads.ragdogAdsLib and ads.ragdogAdsLib.applovin then local adData, providerData = ads.ragdogAdsLib.applovin.adData, ads.ragdogAdsLib.applovin.providerData; adData.fallbackCount = adData.fallbackCount or 0; adData.fallbackCount = adData.fallbackCount+1; if providerData.providerFallback and adData.fallbackCount \<= #adData.providers then adsShowFunctions[adData.providers[providerData.providerFallback].providerName][adData.adType](adData.providers[providerData.providerFallback], adData); else adData.fallbackCount = 0; end end end if ( event.phase == "init" ) then -- Successful initialization print( event.isError ) -- Load an AppLovin ad applovin.load("interstitial") elseif ( event.phase == "loaded" ) then -- The ad was successfully loaded print( event.type ) -- Show the ad applovin.show("interstitial") end end,

And this is my adsShow function:

adsShowFunctions = { ["applovin"] = { ["interstitial"] = function(providerData, adData) if ads:getCurrentProvider() ~= "applovin" then ads:setCurrentProvider("applovin"); end ads.ragdogAdsLib = ads.ragdogAdsLib or {}; ads.ragdogAdsLib.applovin = ads.ragdogAdsLib.applovin or {}; ads.ragdogAdsLib.applovin.adData = adData; ads.ragdogAdsLib.applovin.providerData = providerData; applovin.show("interstitial") end },

Thanks

Where are you calling your init from? (since that’s where you are first requiring it?)

Why are you over complicating this?

Also posting (using copy/paste and not a screen shot) the full backtrace of the error message would be helpful.

thanks for your help.

It is complicated because the adsLib is from a template that I’ve downloaded and all the other ad providers I tried are working very well in it, so I wanted to try to implement also applovin.

This should be the init Function inside the adsLib:

adsLib.init = function(activeAds, adsSettings) if \_G.activeRemoveAdsButton then if ragdogLib.getSaveValue("isAdsRemoved") then return; end end adsLib.adsSettings = adsSettings; activeAds = activeAds[currentSystem]; for i = 1, #activeAds do adsInitFunctions[activeAds[i]](); end end

This is the entire Runtime Error:

'Corona Runtime Error', reason: 'ERROR: Could not load provider (applovin) due to the following reason: module 'CoronaProvider.ads.applovin' not found:resource (CoronaProvider.ads.applovin.lu) does not exist in archive no field package.preload['CoronaProvider.ads.applovin'] no file '/var/mobile/Applications/8FCDE3A8-53AA-447B-95E9-97A62679532F/myapp47.app/CoronaProvider/ads/applovin.lua' no file '/var/mobile/Applications/8FCDE3A8-53AA-447B-95E9-97A62679532F/myapp47.app/CoronaProvider/ads/applovin.lua' no file './CoronaProvider/ads/applovin.so' no file '/var/mobile/Applications/8FCDE3A8-53AA-447B-95E9-97A62679532F/myapp47.app/CoronaProvider/ads/applovin.so' no file './CoronaProvider.so' no file '/var/mobile/Applications/8FCDE3A8-53AA-447B-95E9-97A62679532F/myapp47.app/CoronaProvider.so'CoronaProvider.ads.applovin.'

Thanks

Hi,

It seems like I solved the issue changing the code in the adsLib.

Now when I’m on Android It shows me video ads from applovin, so I guess the function works now.

I set up appLovin as the first provider and if It fails I have adMob second.

I do get applovin ads and sometimes adMob because I guess the applovin ones don’t load every time, but checking the error log I get two types of errors every now and then.

The first one is this:

W/Corona (23741): WARNING: applovin.show() An Interstitial Ad has not been loaded. Use applovin.load() to load an Interstitial Ad before attempting to show it W/Corona (23741): WARNING: applovin.show() The Interstitial Ad has not finished loading yet

And sometimes I get this:

[AppLovinInterstitialAdDialog] Attempted to show an interstitial while one is already displayed; ignoring.

Overall I’m quite happy about how they are showing but I just want to check if those errors are normal, or if I can prevent them.

Thanks

With many of our new ad vendors you have to call their .load() method before you can call .show(). AdMob was programmed that just calling .show() would do a .load() and a .show(). But everyone wants to preload the next ad, so it’s your responsibility to call .load(), wait on it to complete then call .show().

The last message means you’re calling .show() again while the ad is still on the screen.

Rob

That’s probably because I’m calling it two times in the adsLib. I should clean it a bit.

This my adsListener Function for appLovin:

 if ( event.phase == "init" ) then -- Successful initialization print( event.isError ) -- Load an AppLovin ad applovin.load("interstitial") elseif ( event.phase == "loaded" ) then -- The ad was successfully loaded print( event.type ) -- Show the ad applovin.show("interstitial") end

And this is the show Function:

applovin.load("interstitial") applovin.show("interstitial")

Should I remove these two lines from the show Function if I already call it in the adListener?

Thanks

I don’t know why you’re getting that coronaProvider error, but you need to look at the applovin plugin docs again, as your api calls are incorrect.

https://docs.coronalabs.com/plugin/applovin/index.html

load()/show() don’t take a string as their first parameter. It’s a boolean, true/false. true if you wish to show an incentivized (rewarded) ad, false or no parameter if you wish to show a standard (non rewarded) ad.