-
-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Windows/Android]: runtime bug, native.showAlert doest works in coroutine #686
Comments
Workaround: coroutine.wrap(function()
timer.performWithDelay(0, function()
native.showAlert("Title", "Desc", {"OK"}, print)
end)
end)() |
The relevant line is: https://github.com/coronalabs/corona/blob/master/librtt/Rtt_LuaLibNative.cpp#L107 That Temporarily copying the function onto the main state's stack seems to work. Tested with this replacement code:
This was tested on Mac. |
I also encountered this problem, in coroutine can get normal parameters, string, number, etc., but can not get callback (on a different lua_State). |
Describe the bug
native.showAlert
called in coroutine, cant call a listener callback.Seems like it happens with other functions, i found https://forums.solar2d.com/t/bug-in-native-showalert-callback/318051 which report the same issue with
network.setStatusListener
on MacOS.To Reproduce
put in
main.lua
to minimal reproduce:Target platform and where build was made:
On Android 13 (DokeOS 4.0, live build) - nothing happens, callback just not called
Windows 10 22H2, Simulator: runtime error, with no info.
whole test project or build.settings
Just empty project, with
main.lua
, nobuild.settings
The text was updated successfully, but these errors were encountered: