inneractive crashes on android device

I’m not doing anything special.
But when I try to display ads, it crashes immediately on launch.
I’ve signed up and created an app id and entered it properly

ads = require “ads”
ads.init( “inneractive”, “xxxx” )
ads.show( “banner”, { x=0, y=0, interval=60 } )

D/AndroidRuntime( 8364): Shutting down VM
W/dalvikvm( 8364): threadid=1: thread exiting with uncaught exception (group=0x40015560)
E/AndroidRuntime( 8364): FATAL EXCEPTION: main
E/AndroidRuntime( 8364): java.lang.NullPointerException
E/AndroidRuntime( 8364): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1372)
E/AndroidRuntime( 8364): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
E/AndroidRuntime( 8364): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
E/AndroidRuntime( 8364): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
E/AndroidRuntime( 8364): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
E/AndroidRuntime( 8364): at android.view.View.draw(View.java:6883)
E/AndroidRuntime( 8364): at android.widget.FrameLayout.draw(FrameLayout.java:357)
E/AndroidRuntime( 8364): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1862)
E/AndroidRuntime( 8364): at android.view.ViewRoot.draw(ViewRoot.java:1522)
E/AndroidRuntime( 8364): at android.view.ViewRoot.performTraversals(ViewRoot.java:1258)
E/AndroidRuntime( 8364): at android.view.ViewRoot.handleMessage(ViewRoot.java:1859)
E/AndroidRuntime( 8364): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 8364): at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime( 8364): at android.app.ActivityThread.main(ActivityThread.java:3683)
E/AndroidRuntime( 8364): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 8364): at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime( 8364): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
E/AndroidRuntime( 8364): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
E/AndroidRuntime( 8364): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager( 110): Force finishing activity com.silentlogicstudios.wtfknow/com.ansca.corona.CoronaActivity
W/ActivityManager( 110): Activity pause timeout for HistoryRecord{40993a80 com.silentlogicstudios.wtfknow/com.ansca.corona.CoronaActivity}
[import]uid: 40413 topic_id: 20580 reply_id: 320580[/import]

I’ve also tried using the sample inneractive code with my app id on device.
After pressing Show Banner Ad, I see Successfully Loaded Ad but no ad is displayed and the app is frozen.

Any help at all? Not sure what else to do.

[import]uid: 40413 topic_id: 20580 reply_id: 81547[/import]

Try adding a callback parameter to the ads.init() call.

Currently the inneractive ad support is somewhat buggy and needs some additional functionality to be usable. [import]uid: 16734 topic_id: 20580 reply_id: 81553[/import]

So we cannot use inneractive on ANY Android Devices? Or would it be related for the daily-build version you`re using?

PS: I am as concerned as you all about it as am going to try to cross my iOS app that does use Ads of Inneractive in Android Market as well and so I need it working if it says it does. :\
Cheers,
Rodrigo. [import]uid: 89165 topic_id: 20580 reply_id: 81569[/import]

I believe we should be able to use Inneractive on Android phones.

Did you try adding the callback parameter to the ads.init() call?

My concern is regarding the addition of a feature like Inneractive with no apparent support from Ansca once people find bugs/issues. [import]uid: 16734 topic_id: 20580 reply_id: 81574[/import]

Yes @Ken, I am with you.

BTW Ill try to test it, YET. Will report back sure. PS: FYI, Ive got an Android device to test the debug apks. So I thank you so much for the help offered. BTW I`ll let that dropbox folder shared with you for some “news” that can come out. :slight_smile:

Cheers,
Rodrigo. [import]uid: 89165 topic_id: 20580 reply_id: 81576[/import]

The callback didn’t help.

Interestingly, the code works fine on my Kindle Fire. However if I test on the Android SAmsung Galaxy device, it crashes.

[import]uid: 40413 topic_id: 20580 reply_id: 81579[/import]

Do you have an internet connection on the Samsung Galaxy?

I use the following to ensure I don’t try and connect to the ads unless there is a network connection:

[lua]function testNetworkConnection()
local netConn = require(‘socket’).connect(‘www.apple.com’, 80)
if netConn == nil then
return false
end
netConn:close()
return true
end

if ( testNetworkConnection() ) then
ads.show( “banner”, { x=ad_x, y=ad_y, interval=ad_interval } )
end[/lua] [import]uid: 16734 topic_id: 20580 reply_id: 81580[/import]

yeah it has connection.
I think the problem has to do with when I’m showing the ad.
Because I had some trouble on the Kindle Fire as well until I tried to display the ad AFTER all my UI widgets and tabbars are displayed.
However, this solution still doesn’t fix the crash on the Samsung device.

Everything works fine if I don’t display the ad so I know it isn’t any another code error.

[import]uid: 40413 topic_id: 20580 reply_id: 81587[/import]

I was struggling with this today too! It worked on the ipad and ipod4 I tested on, but would always crash after the initial menu loaded on my Droid2.

I found that if I commented out the ads.showAd(), the app wouldn’t crash (but obviously no ads). Then if I delayed the ads.showAd() with a 1-2 second timer, no crash and the ads would start turning up too. But what bothered me was that the inneractive sample project never crashed and didn’t need to use a silly delay to make it work. And so after a very, very, very long ordeal, I discovered…

that the problem had something to do with the Default.png.

When I removed it, it worked.

When I added my Default.png to the inneractive sample project, it crashed the same way.

So for me anyway, it seems there is a problem with Default.png and using ads (at least inneractive) on the Android.

And I submitted a bug report.
[import]uid: 94868 topic_id: 20580 reply_id: 81608[/import]

@Thank YOU for reporting it @Leaf! Your discover here is very welcome.
Cheers,
Rodrigo. [import]uid: 89165 topic_id: 20580 reply_id: 81614[/import]

Thanks! I can’t understand why no one else posted the problem when it seemed like others where already publishing with inneractive ads on android.

Hope this gets fixed soon.
[import]uid: 40413 topic_id: 20580 reply_id: 81624[/import]

@silentlogicstudios,

From the description of the bug, it looks like you would only see the issue if you were displaying an ad almost immediately after starting your app.

Most apps have load screens during asset load which probably gives enough of a delay to not see the bug. [import]uid: 16734 topic_id: 20580 reply_id: 81702[/import]

@Screaming Leaf

Thank-you, you solved my problem.

For others, I just wrapped in a delay as suggested.

local function listener( event ) ads.show( "banner", { x=0, y=0, interval=30 } ) end timer.performWithDelay(1000, listener ) [import]uid: 107098 topic_id: 20580 reply_id: 90969[/import]