This is a follow-up update.
I tried my game bilgi on an Android 14 Samsung device and used logcat to debug like @alanFlickGames suggested. My previous report on Discord was from Amazon QA testing it on Windows 11 Android emulation.
I’ll share the steps to reproduce, code, error dump and other things I noticed. Here:
Steps to reproduce:
1- Open the game.
2- Swipe up to see all apps working on the background. (Don’t send to background!)
3- Select the game again to bring it to full screen.
4- Crash!
Code → OpenBilgi/screens/menuScreen.lua at main · sekodev/OpenBilgi · GitHub
Error dump
02-04 02:06:12.582 10631 10678 V Corona : > Class.forName: network.LuaLoader
02-04 02:06:12.582 10631 10678 V Corona : < Class.forName: network.LuaLoader
02-04 02:06:12.582 10631 10678 V Corona : Loading via reflection: network.LuaLoader
02-04 02:06:12.595 10631 10678 I Corona : Platform: SM-F731B / ARM64 / 14 / Adreno (TM) 740 / OpenGL ES 3.2 V@0676.42 (GIT@7b26bdd942, Iab69c31769, 1693222181) (Date:08/28/23) / 2024.3710 / Türkçe | TR | tr_TR | tr
02-04 02:06:12.599 10631 10678 V Corona : > Class.forName: shared.google.play.services.base.LuaLoader
02-04 02:06:12.603 10631 10678 V Corona : > Class.forName: licensing.LuaLoader
02-04 02:06:12.605 10631 10678 V Corona : > Class.forName: CoronaProvider.licensing.google.LuaLoader
02-04 02:06:12.605 10631 10678 V Corona : < Class.forName: CoronaProvider.licensing.google.LuaLoader
02-04 02:06:12.607 10631 10678 V Corona : Loading via reflection: CoronaProvider.licensing.google.LuaLoader
02-04 02:06:12.615 10631 10678 I Corona : Default translation is set to defined value 'en'
02-04 02:06:14.034 4581 4726 I System.out: Broadcasting: Intent { act=com.sec.intent.action.CP_CHAN_INFO flg=0x1000000 (has extras) }
02-04 02:06:14.038 4581 4726 I System.out: Broadcast completed: result=0
02-04 02:06:15.758 4581 4636 I System.out: Broadcasting: Intent { act=com.sec.intent.action.CP_CHAN_INFO flg=0x1000000 (has extras) }
02-04 02:06:15.762 4581 4636 I System.out: Broadcast completed: result=0
02-04 02:06:26.241 2747 2909 W System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.ComponentName.getPackageName()' on a null object reference
02-04 02:06:26.241 2747 2909 W System.err: at com.samsung.android.server.wifi.SemWifiOptimizer$6.noteResumeComponent(SemWifiOptimizer.java:19)
02-04 02:06:26.241 2747 2909 W System.err: at com.android.server.usage.UsageStatsService$LocalService.reportEvent(UsageStatsService.java:3123)
02-04 02:06:26.241 2747 2909 W System.err: at com.android.server.am.ActivityManagerService.updateActivityUsageStats(ActivityManagerService.java:3524)
02-04 02:06:26.241 2747 2909 W System.err: at com.android.server.am.ActivityManagerService$LocalService.updateActivityUsageStatsWithIntent(ActivityManagerService.java:21166)
02-04 02:06:26.241 2747 2909 W System.err: at com.android.server.wm.ActivityTaskManagerService$$ExternalSyntheticLambda26.accept(R8$$SyntheticClass:0)
02-04 02:06:26.241 2747 2909 W System.err: at com.android.internal.util.function.pooled.PooledLambdaImpl.doInvoke(PooledLambdaImpl.java:384)
02-04 02:06:26.241 2747 2909 W System.err: at com.android.internal.util.function.pooled.PooledLambdaImpl.invoke(PooledLambdaImpl.java:204)
02-04 02:06:26.241 2747 2909 W System.err: at com.android.internal.util.function.pooled.OmniFunction.run(OmniFunction.java:87)
02-04 02:06:26.241 2747 2909 W System.err: at android.os.Handler.handleCallback(Handler.java:958)
02-04 02:06:26.241 2747 2909 W System.err: at android.os.Handler.dispatchMessage(Handler.java:99)
02-04 02:06:26.241 2747 2909 W System.err: at android.os.Looper.loopOnce(Looper.java:230)
02-04 02:06:26.241 2747 2909 W System.err: at android.os.Looper.loop(Looper.java:319)
02-04 02:06:26.241 2747 2909 W System.err: at android.os.HandlerThread.run(HandlerThread.java:67)
02-04 02:06:26.241 2747 2909 W System.err: at com.android.server.ServiceThread.run(ServiceThread.java:46)
02-04 02:06:26.242 2747 2909 W System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.ComponentName.getPackageName()' on a null object reference
02-04 02:06:26.242 2747 2909 W System.err: at com.samsung.android.server.wifi.tcp.SemWifiTransportLayerMonitor$3.noteResumeComponent(SemWifiTransportLayerMonitor.java:69)
02-04 02:06:26.242 2747 2909 W System.err: at com.android.server.usage.UsageStatsService$LocalService.reportEvent(UsageStatsService.java:3123)
02-04 02:06:26.242 2747 2909 W System.err: at com.android.server.am.ActivityManagerService.updateActivityUsageStats(ActivityManagerService.java:3524)
02-04 02:06:26.242 2747 2909 W System.err: at com.android.server.am.ActivityManagerService$LocalService.updateActivityUsageStatsWithIntent(ActivityManagerService.java:21166)
02-04 02:06:26.242 2747 2909 W System.err: at com.android.server.wm.ActivityTaskManagerService$$ExternalSyntheticLambda26.accept(R8$$SyntheticClass:0)
02-04 02:06:26.242 2747 2909 W System.err: at com.android.internal.util.function.pooled.PooledLambdaImpl.doInvoke(PooledLambdaImpl.java:384)
02-04 02:06:26.242 2747 2909 W System.err: at com.android.internal.util.function.pooled.PooledLambdaImpl.invoke(PooledLambdaImpl.java:204)
02-04 02:06:26.242 2747 2909 W System.err: at com.android.internal.util.function.pooled.OmniFunction.run(OmniFunction.java:87)
02-04 02:06:26.242 2747 2909 W System.err: at android.os.Handler.handleCallback(Handler.java:958)
02-04 02:06:26.242 2747 2909 W System.err: at android.os.Handler.dispatchMessage(Handler.java:99)
02-04 02:06:26.242 2747 2909 W System.err: at android.os.Looper.loopOnce(Looper.java:230)
02-04 02:06:26.242 2747 2909 W System.err: at android.os.Looper.loop(Looper.java:319)
02-04 02:06:26.242 2747 2909 W System.err: at android.os.HandlerThread.run(HandlerThread.java:67)
02-04 02:06:26.242 2747 2909 W System.err: at com.android.server.ServiceThread.run(ServiceThread.java:46)
02-04 02:06:26.676 2747 4203 W System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.ComponentName.getPackageName()' on a null object reference
02-04 02:06:26.676 2747 4203 W System.err: at com.samsung.android.server.wifi.tcp.SemWifiTransportLayerMonitor.getCurrentPackageInfo(SemWifiTransportLayerMonitor.java:15)
02-04 02:06:26.676 2747 4203 W System.err: at com.samsung.android.server.wifi.tcp.SemWifiSwitchForIndividualAppsService.handleMessage(SemWifiSwitchForIndividualAppsService.java:52)
02-04 02:06:26.676 2747 4203 W System.err: at android.os.Handler.dispatchMessage(Handler.java:106)
02-04 02:06:26.676 2747 4203 W System.err: at android.os.Looper.loopOnce(Looper.java:230)
02-04 02:06:26.676 2747 4203 W System.err: at android.os.Looper.loop(Looper.java:319)
02-04 02:06:26.677 2747 4203 W System.err: at android.os.HandlerThread.run(HandlerThread.java:67)
02-04 02:06:47.293 2747 4292 W System.err: java.io.FileNotFoundException: /proc/10631/io_record_control: open failed: ENOENT (No such file or directory)
02-04 02:06:47.299 2747 4292 W System.err: at libcore.io.IoBridge.open(IoBridge.java:574)
02-04 02:06:47.300 2747 4292 W System.err: at java.io.FileOutputStream.<init>(FileOutputStream.java:259)
02-04 02:06:47.300 2747 4292 W System.err: at java.io.FileOutputStream.<init>(FileOutputStream.java:208)
02-04 02:06:47.300 2747 4292 W System.err: at java.io.FileWriter.<init>(FileWriter.java:96)
02-04 02:06:47.300 2747 4292 W System.err: at com.android.server.am.Pageboost$IoRecord.write(Pageboost.java:1711)
02-04 02:06:47.300 2747 4292 W System.err: at com.android.server.am.Pageboost$IoRecord.getResultFromKernel(Pageboost.java:1935)
02-04 02:06:47.300 2747 4292 W System.err: at com.android.server.am.Pageboost$PageboostHandler.handleMessage(Pageboost.java:2463)
02-04 02:06:47.300 2747 4292 W System.err: at android.os.Handler.dispatchMessage(Handler.java:106)
02-04 02:06:47.300 2747 4292 W System.err: at android.os.Looper.loopOnce(Looper.java:230)
02-04 02:06:47.300 2747 4292 W System.err: at android.os.Looper.loop(Looper.java:319)
02-04 02:06:47.300 2747 4292 W System.err: at android.os.HandlerThread.run(HandlerThread.java:67)
02-04 02:06:47.300 2747 4292 W System.err: at com.android.server.ServiceThread.run(ServiceThread.java:46)
02-04 02:06:47.301 2747 4292 W System.err: Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
02-04 02:06:47.301 2747 4292 W System.err: at libcore.io.Linux.open(Native Method)
02-04 02:06:47.301 2747 4292 W System.err: at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
02-04 02:06:47.301 2747 4292 W System.err: at libcore.io.BlockGuardOs.open(BlockGuardOs.java:274)
02-04 02:06:47.301 2747 4292 W System.err: at libcore.io.IoBridge.open(IoBridge.java:560)
02-04 02:06:47.301 2747 4292 W System.err: ... 11 more
What else I noticed:
- When you navigate through open apps in the background but don’t switch, the game is still running and the music can still be heard, but it stops after a few (4?) seconds because the game crashes.
- In the ‘Recent Apps’ screen, switch to another app and the music can still be heard. The game is not being sent to background.
- Send the app directly to the background and bring it back, it doesn’t crash.
- I tried @alanFlickGames Flick Solitaire. The same behavior applies. It crashes.
- I followed the same steps with Candy Crush Saga to see how other engines/frameworks behave. In this case, the game audio is immediately paused when ‘Recent Apps’ screen is on screen. Game doesn’t crash.
Conclusion:
I believe Solar2D framework is not pausing the application or the sound layer properly when the user opens the ‘Recent Apps’ (or say, switch between apps UI). As @chodongwon82 reported, the behavior might vary between Samsung and other Android devices but this is definitely not handled the right away on Android 14 Samsung devices and it’s not working right on Android emulation for Windows 11(Amazon App Store).
I’ll put all of this together and create an issue on Github repo, hopefully tomorrow.