Crash on test device

Thanks for getting back.  I’m afraid it’s still crashing for me. Compiled on windows with Simulator v2016.2906 (2016.6.21).  More detailed error below

FATAL EXCEPTION: main Process: com.nellyfish.hundredplatforms, PID: 8440 java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255) at java.util.ArrayList.get(ArrayList.java:308) at com.coronalabs.coronaads.WaterFallConfig.getAfterWaterFallSDKString(WaterFallConfig.java:137) at com.coronalabs.coronaads.CoronaAds.fireAdEventResponseForRequest(CoronaAds.java:360) at com.coronalabs.coronaads.CoronaAds.showAd(CoronaAds.java:348) at plugin.coronaAds.LuaLoader$1.run(LuaLoader.java:195) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

build.settings is this

settings = { plugins = { ["plugin.coronaAds"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true } }, ["plugin.google.play.services"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true } }, ["shared.android.support.v4"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true } }, }, orientation = { -- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight default = "portrait", supported = { "portrait", } }, excludeFiles = { -- Include only the necessary icon files on each platform iphone = { "Icon-\*dpi.png", }, android = { "Icon.png", "Icon-Small-\*.png", "Icon\*@2x.png", } }, -- -- iOS Section -- iphone = { iCloud = true, plist = { UIStatusBarHidden = false, UIPrerenderedIcon = true, -- set to false for "shine" overlay --UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend CFBundleIconFiles = { "Icon.png", "Icon@2x.png", "Icon-167.png", "Icon-60.png", "Icon-60@2x.png", "Icon-60@3x.png", "Icon-72.png", "Icon-72@2x.png", "Icon-76.png", "Icon-76@2x.png", "Icon-Small.png", "Icon-Small@2x.png", "Icon-Small@3x.png", "Icon-Small-40.png", "Icon-Small-40@2x.png", "Icon-Small-50.png", "Icon-Small-50@2x.png", }, UIPrerenderedIcon = true, UILaunchStoryboardName = 'launchscreen', UIBackgroundModes = {'remote-notification'}, UIApplicationExitsOnSuspend = false, --Requred for Corona ads NSAppTransportSecurity = { NSAllowsArbitraryLoads=true }, NSLocationAlwaysUsageDescription = { "" }, NSLocationWhenInUseUsageDescription = { "" }, } }, -- -- Android Section -- android = { installLocation = 'auto', usesPermissions = { "android.permission.INTERNET", "android.permission.ACCESS\_COARSE\_LOCATION", "android.permission.ACCESS\_FINE\_LOCATION", "android.permission.ACCESS\_NETWORK\_STATE", "com.google.android.providers.gsf.permissions.READ\_GSERVICES" }, applicationChildElements = { [[\<activity android:name="com.facebook.ads.InterstitialAdActivity" android:configChanges="keyboardHidden|orientation|screenSize"/\>]] }, isGame = true, largeHeap = true }, }

Code is copied from the integration guide, just updated the guid.

I’m running this on windows pc with Android.  Bed now :)  i’ll try my mac tomorrow with an iphone.

Thanks again

Allan

My problem was solved. Thank you!

I’m also experiencing the issue allankstevens described. 

I get the exception when I try to call the show() function.

I’m still struggling with this.  I have switched from my windows to mac, and get the following error when I try and open via the simulator. 

Aug 04 03:44:02.017 [iOS Simulator] ERROR: Runtime error

Aug 04 03:44:02.017 [iOS Simulator] module ‘plugin.coronaAds’ not found:resource (plugin.coronaAds.lu) does not exist in archive
[iOS Simulator] no field package.preload[‘plugin.coronaAds’]
[iOS Simulator] no file ‘/Users/allanstevens/Library/Developer/CoreSimulator/Devices/F5AE1C07-23BE-4F3E-9376-D28F80B8003C/data/Containers/Bundle/Application/400627A0-3D56-419D-8A9A-1B34C2FAA40F/100 Platforms.app/plugin/coronaAds.lua’

Aug 04 03:44:02.059 [iOS Simulator] no file ‘/Users/allanstevens/Library/Developer/CoreSimulator/Devices/F5AE1C07-23BE-4F3E-9376-D28F80B8003C/data/Containers/Bundle/Application/400627A0-3D56-419D-8A9A-1B34C2FAA40F/100 Platforms.app/plugin/coronaAds.lua’
[iOS Simulator] no file ‘./plugin/coronaAds.so’
[iOS Simulator] no file ‘/Users/allanstevens/Library/Developer/CoreSimulator/Devices/F5AE1C07-23BE-4F3E-9376-D28F80B8003C/data/Containers/Bundle/Application/400627A0-3D56-419D-8A9A-1B34C2FAA40F/100 Platforms.app/plugin/coronaAds.so’
[iOS Simulator] no file ‘./plugin.so’
[iOS Simulator] no file '/Users/allanstevens/Library/Developer/CoreSimulator/Devices/F5AE1C07-23BE-4F3E-9376-D28F80B8003C/data/Containers/Bundle/Application/400627A0-3D56-419D-8A9A-1B34C2FAA40F/100 Platforms.app/plugin.so’plugin.coronaAds

This is the first time of have used Corona SDK on the mac and I can’t seem to get it to install on my physical device.  I get the ‘App Installation Complete’ prompt, but it’s nowhere to be seen on my device, anyway I assume this is not related.  

Thanks,

Allan

@allenkstevens: Where did this code come from?

applicationChildElements = { [[\<activity android:name="com.facebook.ads.InterstitialAdActivity" android:configChanges="keyboardHidden|orientation|screenSize"/\>]] },

@stanga can you post your build.settings please and the version of Corona SDK you’re using?

Thanks

Rob

For both of you, can you download and build the Corona Ads sample app?
 

https://github.com/coronalabs/plugins-sample-coronaAds

Of course change any Api Keys and placement ID’s with ones in your portal. Let me know the results.

Thanks

Rob

It’s not crashing anymore, however, it’s simply not showing an ad. 

After calling the show() function, I see the callback:

{

   “name”:“adsRequest”,

   “phase”:“request”,

   “placementId”:“exhibition-interstitial”,

   “provider”:“coronaAds”,

   “isError”:false

}

And that’s all. It’s possibly a fill issue.

This brings up the following questions:

  1. how do you set a test user/test mode so I get test ads (so I don’t need to depend on a fill)

  2. How do I know if an ad is loaded?

  3. How do I load an ad without calling the show() function?

The whole flow is not clear to me. 

Normally, there is a load() function and an isLoaded() function. 

In my code I alternate different providers by checking their isLoaded() function, and I use the first provider that has an ad available.

With CoronaAds, I don’t know if there is an ad available and how to load ahead of time.

CoronaAds was designed to be simple. I don’t see any way to do real ads vs. test ads. It does not support pre-loading.  Simply call coronaAds.show() when you want to show an ad.

I don’t know if preloading is on the roadmap or not. I’ll make some inquiries.

Rob

Hi Rob, really appreciate you looking into this.

Oops, that was me ‘speed’ reading the docs  :unsure: I had copied the Note section at the bottom of this page https://docs.coronalabs.com/daily/plugin/coronaads/index.html.  I had not read that it would be automatically added.  I have now removed this and i’m still getting the index out of bounds exception.

I have also downloaded the plugins-sample-coronaAds and built it with my api key.  But i’m afraid it’s still crashing when I click the ‘Show Interstitial Ad’ button.  I have tried this on a Nexus 4 and Amazon Fire.  Error below.

08-04 21:28:52.877: E/AndroidRuntime(21617): FATAL EXCEPTION: main 08-04 21:28:52.877: E/AndroidRuntime(21617): Process: com.gmail.allankstevens.plugins\_sample\_coronaAds, PID: 21617 08-04 21:28:52.877: E/AndroidRuntime(21617): java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 08-04 21:28:52.877: E/AndroidRuntime(21617): at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255) 08-04 21:28:52.877: E/AndroidRuntime(21617): at java.util.ArrayList.get(ArrayList.java:308) 08-04 21:28:52.877: E/AndroidRuntime(21617): at com.coronalabs.coronaads.WaterFallConfig.getAfterWaterFallSDKString(WaterFallConfig.java:137) 08-04 21:28:52.877: E/AndroidRuntime(21617): at com.coronalabs.coronaads.CoronaAds.fireAdEventResponseForRequest(CoronaAds.java:360) 08-04 21:28:52.877: E/AndroidRuntime(21617): at com.coronalabs.coronaads.CoronaAds.showAd(CoronaAds.java:348) 08-04 21:28:52.877: E/AndroidRuntime(21617): at plugin.coronaAds.LuaLoader$1.run(LuaLoader.java:195) 08-04 21:28:52.877: E/AndroidRuntime(21617): at android.os.Handler.handleCallback(Handler.java:739) 08-04 21:28:52.877: E/AndroidRuntime(21617): at android.os.Handler.dispatchMessage(Handler.java:95) 08-04 21:28:52.877: E/AndroidRuntime(21617): at android.os.Looper.loop(Looper.java:135) 08-04 21:28:52.877: E/AndroidRuntime(21617): at android.app.ActivityThread.main(ActivityThread.java:5254) 08-04 21:28:52.877: E/AndroidRuntime(21617): at java.lang.reflect.Method.invoke(Native Method) 08-04 21:28:52.877: E/AndroidRuntime(21617): at java.lang.reflect.Method.invoke(Method.java:372) 08-04 21:28:52.877: E/AndroidRuntime(21617): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) 08-04 21:28:52.877: E/AndroidRuntime(21617): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 08-04 21:28:52.878: W/ActivityManager(552): Force finishing activity 1 com.gmail.allankstevens.plugins\_sample\_coronaAds/com.ansca.corona.CoronaActivity

Could it be related to whats in my dash board as my app is showing as ‘pending’  also the settings ask for a Google Play and AppStore  details, but the app is not live yet.  

Thanks

Allan

Made some progress.  

If I use the default key (5223c2c3-cf81-4c43-ae41-2d4ed16552bc) found in the sample app, it works fine.  

But my key generates the IndexOutOfBoundsException.  Is there something I need to do to activate my key?  I have the default placement id’s and the Status is ‘pending’.  Am i missing something?

Thanks,

Allan

This sounds like a problem with your account. Please email ads AT coronalabs.com and provide them this information and see if they can look into your account and see what’s happening.

Rob

Hello all,

The bug causing the crash with java.lang.IndexOutOfBoundsException is now fixed. Rebuilding the app on Simulator should get things back to normal. No dashboard or code changes would be necessary.

Vamsee

Thanks Vamsee, it’s working for me now  :slight_smile: