I am running this project which runs fine on Android but getting error as shown on the attached picture. I am using the latest public release and build for iOs and got this error when running on iPhone 4.
This is my build.setting
– Supported values for orientation:
– portrait, portraitUpsideDown, landscapeLeft, landscapeRight
settings = {
orientation = {
default = “portrait”,
supported = { “portrait”, }
},
plugins =
{
[“plugin.google.play.services”] =
{
publisherId = “com.coronalabs”
},
},
iphone = {
plist = {
CFBundleShortVersionString = “1.0”,
CFBundleIconFile = “Icon.png”,
UIBackgroundModes = {“remote-notification”},
NSLocationWhenInUseUsageDescription = “Your location is used to find businesses around your location. This is shown on the first page the lowest button. Also it is used if you want to show the option to drive to the business location.”,
UIStatusBarHidden = false,
UIPrerenderedIcon = true, – set to false for “shine” overlay
--UIApplicationExitsOnSuspend = true, – uncomment to quit app on suspend
– iOS app URL schemes:
CFBundleURLTypes =
{
{
CFBundleURLSchemes =
{
“fbXXXXXXXXXXXXXX”, – example scheme for facebook
“coronasdkapp”, – example second scheme
}
}
}
}
},
android =
{
usesPermissions =
{
“android.permission.INTERNET”,
“android.permission.ACCESS_FINE_LOCATION”,
“android.permission.ACCESS_COARSE_LOCATION”,
“android.permission.WRITE_INTERNAL_STORAGE”,
“android.permission.CALL_PHONE”,
},
},
plugins =
{
[“plugin.GameThrivePushNotifications”] =
{
publisherId = “com.gamethrive”,
},
[“plugin.google.play.services”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { android=true, [“android-kindle”]=true },
},
},
}
It didnt help when I took the second google plugin out either.
When you build what “Store” did you select from the menu? Recently it has only worked for me using the Google value. Not sure if that is your issue but give it a try.
I could fix it by adding this:
supportedPlatforms = { iphone = true, [“iphone-sim”] = true } --for iOS
You are loading the old admob plugin. You need to load the admob v2 plugin instead. We removed the old deprecated plugin. It should mostly be a change to your build.settings.
See: https://docs.coronalabs.com/plugin/ads-admob-v2/index.html
Rob
ROb, I did what it was on that link but I git error message on iPhone 4.
Post your current build.settings file. Please paste the code in the box that pops up when you click the blue <> button in the edit bar (with Bold, Italic, etc.).
Also, copy and paste the text from your terminal window where you’re getting your output from the device. If you don’t know how to do this, please see:
http://docs.coronalabs.com/guide/basics/debugging/index.html
Rob
I had the exact same problem and just found what’s causing the error.
In my case I was using AdMob and FB Audience Network.
To activate FAN plugin you need to add, as documented here:
settings = { plugins = { ["plugin.fbAudienceNetwork"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true, osx=true, ["win32-sim"]=true } }, ["plugin.google.play.services"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true } }, }, }
the issue in my case is the line:
supportedPlatforms = { android=true }
Removing the line fix the issue (now, I don’t know if that line is a typo or it’s actually needed for FB Audience Network… in that case there’s a bug)
In your first post, you also have two plugins= sections in your build.settings. One at the beginning and one at the end, which would cause issues.
Hi Ingemar, that didn’t seem to cause error. As mentiioned this line fixed the error:
supportedPlatforms = { iphone = true, [“iphone-sim”] = true } --for iOS
If you get an error in the simulator saying it can’t find the plugin, comment out the supportedPlatform line in build.settings and relaunch the simulator. This will let the simulator download it’s stub file. Once thats done, you can re-enable the supportedPlatform line.
This has been fixed in recent daily builds.
Rob
In my case I don’t get an error on the simulator but on device.
I’m using the latest daily and I’ve tried commenting and re-enabling the supportedPlatform but I still get the runtime error.
As I wrote above, the issue (at least in my case) is using FB Audience Network & AdMob at the same time.
Specifically, FB Audience Network requires adding the line supportedPlatforms= { android=true } to plugin.google.play.services (btw, why do we need to load the google play services when using only FB Audience Network?) :
["plugin.google.play.services"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true } },
Removing that line OR changing it (as instructed by amirfarazmand above) to:
supportedPlatforms = { iphone = true, [“iphone-sim”] = true } --for iOS
(btw, where does this come from, can’t find anything on the docs)
solves the issue.
Is it only on my side? Can someone try adding FAN + ADMOB with supportedPlatforms = {android = true} and build on device?
FIY, this is my most simplified test code exhibiting the issue:
build.settings
settings ={ plugins = { ["plugin.fbAudienceNetwork"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true, osx=true, ["win32-sim"]=true } }, ["plugin.google.play.services"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true } }, }, }
main.lua
local ads = require( "ads" ) local fbAudienceNetwork = require( "plugin.fbAudienceNetwork" ) function testListener( ... ) end ads.init( "admob", "ads", testListener ) local function adListener( ... ) end fbAudienceNetwork.init( adListener )
The error on device is:
<Warning>: Runtime Error: Runtime error: ERROR: Could not load provider (admob) due to the following reason: module ‘CoronaProvider.ads.admob’ not found:resource (CoronaProvider.ads.admob.lu) does not exist in archive
Another thing I noticed is that recently it takes a really long time to build the code (stuck in Communicating with build server… for a long time) then when it start building I see a lot of warning messages in the console for the most part like:
testadmob.app/.build/plugin.fbAudienceNetwork/libFBSDKCoreKit.a(FBSDKUtility.o)) was built for newer iOS version (7.0) than being linked (6.0)
@PXL artificer
FAN on iOS requires iOS 7. I believe Corona still targets iOS 6 by default so you can try adding a MinimumOSVersion in your build.settings for iOS. That should get rid of the warnings.
build.settings
settings = { iphone = { plist = { MinimumOSVersion = "7.0" } } }
Just tried, but no, it’s not what’s causing the runtime error.
I’m seeing a lot of warnings on compiling the FB Audience Network plugin
warning: /var/folders/9j/vw2bf7xn53g9ms_nnp0sct9167gh9d/C/org.llvm.clang.chrisp/ModuleCache/3WS22YCC15OO/Foundation-A3SOD99KJ0S9.pcm: No such file or directory
Jan 29 01:46:48.052 while processing /Users/rubenfrosali/Desktop/testadmob.app/.build/plugin.fbAudienceNetwork/libFBAudienceNetwork.a(FBAdCache.o):
Jan 29 01:46:48.052 warning: /var/folders/9j/vw2bf7xn53g9ms_nnp0sct9167gh9d/C/org.llvm.clang.chrisp/ModuleCache/3WS22YCC15OO/Foundation-A3SOD99KJ0S9.pcm: No object file for requested architecture
almost 100 similar warnings on compile
While I’m seeing a lot of error on compiling the fbAudienceNetwork plugin, the error seems still caused by admob, because of the line required by FAN
supportedPlatforms = { android=true }
The error message is
ERROR: Could not load provider (admob) due to the following reason: module ‘CoronaProvider.ads.admob’ not found:resource (CoronaProvider.ads.admob.lu) does not exist in archive.
OK, there seem to be multiple things going on here, but I assume that the iOS7/iOS6 warnings should be gone now at least.
The warnings you reported now indicate that the archive doesn’t have the iOS slice necessary to compile.
I’ll try to set up a test project myself to see if I can find out what’s going on.
BTW What version of OS X / Xcode are you using?
Ok thanks ingemar,
I’m using Xcode 7.2 and I’ve tried on:
-
iPhone 6S iOS 9.2.1
-
iPad iOS 9.0.2
-
iPhone 5S iOS 9.2
Same runtime error so far.
Here’s my test project https://dl.dropboxusercontent.com/u/1317705/testadscode.zip
Yes without the supportedPlatform = android under the plugin.Google.play.service doesn’t show any runtime error.
My question was, since it’s that line causing the crash, do we need it? From the docs of FAN looks like it’s required… Maybe it’s a typo?
The AdMob network is part of Google Play Services. Your current build.settings only activate it for Android (android=true), which will exclude it from all other platforms (in your case iOS).
If supportedPlatforms is omitted, the plugin will be included in all binaries that you compile. You only need to add supportedPlatforms if you want to exclude some platforms from adding the plugin to the binary. There is no =false option, you just set the platforms you want to =true in the table.
Valid options for supportedPlatforms are iphone, android, [“iphone-sim”], [“android-kindle”], [“android-nook”], osx, win32, [“win32-sim”] and tvos.
So, to answer your question: You don’t need the supportedPlatforms entry as long as you’re OK with including the plugin in every platform binary.
Thanks ingemar.
I was merely following the instructions on https://docs.coronalabs.com/plugin/fbAudienceNetwork/index.html
Btw, why is it required to add the google play services plugin on FBAudience?