java.lang.IllegalStateException from Tap for Tap plugin?

We just updated one of our Android games to include Tap for Tap and in the past week have received a couple (4 or 5) new crash reports that seem to point to the Tap for Tap plugin as the culprit.

Below is the crash report I am receiving, but not sure what to make of it.

java.lang.IllegalStateException: Lua state is closed at com.naef.jnlua.LuaState.check(Unknown Source) at com.naef.jnlua.LuaState.rawGet(Unknown Source) at com.naef.jnlua.LuaState$LuaValueProxyImpl.pushValue(Unknown Source) at plugin.tapfortap.EventHelper.dispatchEvent(EventHelper.java:43) at plugin.tapfortap.EventHelper$AppWallListenerImplementation.onReceiveAd(EventHelper.java:125) at com.tapfortap.AppWall$3$1$1.run(AppWall.java:186) at android.os.Handler.handleCallback(Handler.java:605) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4424) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:817) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584) at dalvik.system.NativeStart.main(Native Method)

Anyone from Tap for Tap care to try and provide me some assistance on what this means and if there is a way I can fix it?

Thanks,

-Clark

Thanks for the report, it looks like a bug in the plugin that I need to fix.

The issue is probably that at one point a listener is set on the AppWall and the plugin is then trying to call that listener after the lua state has been closed by your app exiting or being pushed to the background. I need to make sure that listeners get nilled or the check if the LuaState is still valid.

Awesome, thanks for quick reply and I will keep an eye out for any updates.

PS: Thanks Tap for Tap for the awesome support and presence in these forums, really top notch.

Hey Sorry for the slow response here. There was a bug where I may have been using a closed LuaState. I added a check to see that the current LuaState is indeed open before I try to use it to fire an event. The 0.0.3 update for Android should be available in the next few days.

Thanks for the report, it looks like a bug in the plugin that I need to fix.

The issue is probably that at one point a listener is set on the AppWall and the plugin is then trying to call that listener after the lua state has been closed by your app exiting or being pushed to the background. I need to make sure that listeners get nilled or the check if the LuaState is still valid.

Awesome, thanks for quick reply and I will keep an eye out for any updates.

PS: Thanks Tap for Tap for the awesome support and presence in these forums, really top notch.

Hey Sorry for the slow response here. There was a bug where I may have been using a closed LuaState. I added a check to see that the current LuaState is indeed open before I try to use it to fire an event. The 0.0.3 update for Android should be available in the next few days.

Same problem here but in my case for the Interstitials:

[lua]
 

java.lang.IllegalStateException: Lua state is
closed
    at com.naef.jnlua.LuaState.check(Unknown
Source)
    at com.naef.jnlua.LuaState.rawGet(Unknown
Source)
    at
com.naef.jnlua.LuaState$LuaValueProxyImpl.pushValue(Unknown
Source)
    at
plugin.tapfortap.EventHelper.dispatchEvent(EventHelper.java:43)
    at
plugin.tapfortap.EventHelper$InterstitialListenerImplementation.onDismiss(EventHelper.java:113)
    at
com.tapfortap.Interstitial.onBackPressed(Interstitial.java:81)
    at
com.tapfortap.InterstitialHelper.onBackPressed(InterstitialHelper.java:16)
    at
com.tapfortap.TapForTapActivity.onBackPressed(TapForTapActivity.java:50)
    at
com.tapfortap.DefaultWebActivityHelper.shouldOverrideUrlLoading(DefaultWebActivityHelper.java:99)
    at
com.tapfortap.TapForTapActivity$MyWebViewClient.shouldOverrideUrlLoading(TapForTapActivity.java:116)
    at
android.webkit.CallbackProxy.uiOverrideUrlLoading(CallbackProxy.java:336)
    at
android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:461)
    at
android.os.Handler.dispatchMessage(Handler.java:99)
    at
android.os.Looper.loop(Looper.java:137)
    at
android.app.ActivityThread.main(ActivityThread.java:4898)
    at
java.lang.reflect.Method.invokeNative(Native
Method)
    at
java.lang.reflect.Method.invoke(Method.java:511)
    at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
    at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
    at
dalvik.system.NativeStart.main(Native Method)

[/lua]

Please fix.

Jens

I got that error too, but happy to see that you are fixing it! :slight_smile:

Same problem here but in my case for the Interstitials:

[lua]
 

java.lang.IllegalStateException: Lua state is
closed
    at com.naef.jnlua.LuaState.check(Unknown
Source)
    at com.naef.jnlua.LuaState.rawGet(Unknown
Source)
    at
com.naef.jnlua.LuaState$LuaValueProxyImpl.pushValue(Unknown
Source)
    at
plugin.tapfortap.EventHelper.dispatchEvent(EventHelper.java:43)
    at
plugin.tapfortap.EventHelper$InterstitialListenerImplementation.onDismiss(EventHelper.java:113)
    at
com.tapfortap.Interstitial.onBackPressed(Interstitial.java:81)
    at
com.tapfortap.InterstitialHelper.onBackPressed(InterstitialHelper.java:16)
    at
com.tapfortap.TapForTapActivity.onBackPressed(TapForTapActivity.java:50)
    at
com.tapfortap.DefaultWebActivityHelper.shouldOverrideUrlLoading(DefaultWebActivityHelper.java:99)
    at
com.tapfortap.TapForTapActivity$MyWebViewClient.shouldOverrideUrlLoading(TapForTapActivity.java:116)
    at
android.webkit.CallbackProxy.uiOverrideUrlLoading(CallbackProxy.java:336)
    at
android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:461)
    at
android.os.Handler.dispatchMessage(Handler.java:99)
    at
android.os.Looper.loop(Looper.java:137)
    at
android.app.ActivityThread.main(ActivityThread.java:4898)
    at
java.lang.reflect.Method.invokeNative(Native
Method)
    at
java.lang.reflect.Method.invoke(Method.java:511)
    at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
    at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
    at
dalvik.system.NativeStart.main(Native Method)

[/lua]

Please fix.

Jens

I got that error too, but happy to see that you are fixing it! :slight_smile: