java.lang.IllegalArgumentException: View not attached to window manager

@Brent,

the only place i use a native pop up is the licensing check with the code below.

Runtime:addEventListener( "system", onSystemEvent ) local licensing if "Android" == system.getInfo( "platformName" ) then licensing = require "licensing";licensing.init( "google" ) function licensingListener( event ) local verified = event.isVerified if event.isVerified then initNewGame();startScreen() else native.showAlert( "Licensing Failed.", "There was a problem verifying the application, please try again or re-download from Google Play Store.", { "OK" },function(event) native.requestExit() end ) end end licensing.verify( licensingListener ) else initNewGame();startScreen() end

And as mentioned it has only happened to one customer I heard from but others might simply have chosen a refund thinking the game didn’t work. Good to know what might be causing the problem but still doesn’t help much in order to solve the problem unless you can suggest some additional code I need to add to prevent this rare error.

How about showing some other kind of message that’s not a native alert? Like an overlay scene or something like that?

Brent

So you pretty sure the issue is caused by native.showAlert? If so, then it’s no problem for me to show a screen instead.

I suppose i do a simple eventListener so if user taps screen it calls native.requestExit()?

You could use a native.requestExit(), but note that it will likely appear as a “crash” to users who don’t pass the licensing, and that might cause more “refund request on the assumption the app is busted” cases. So, you may be better off showing some other non-native message.

Take care,

Brent

ok thanks for the advice Brent :wink: