PabloMK7 / citra

A Nintendo 3DS Emulator
GNU General Public License v2.0
3.75k stars 635 forks source link

Android version crashes on game launch after rotation option commit #193

Closed DavidRGriswold closed 4 months ago

DavidRGriswold commented 4 months ago

Is there an existing issue for this?

Affected Build(s)

eafb03ad38ebd2e051f426ba5d4582819d33d974

Description of Issue

On this commit, and a few commits before, when I build the android version and run it it crashes immediately when I try to run a game. Error in logcat is below.

I used the debugger and stepped through and it seems there is an issue with the Settings somewhere? The "Renderer" settings array was coming up empty, creating the null pointer exception.

The current master branch at @newhinton fork does NOT cause that issue for me, so it must be something in one of the commits between the two?

I don't THINK it's related, but I do get a linker error sometimes too, during the pre-build: clang++: error: invalid linker name in argument '-fuse-ld=gold' . It still builds despite the error so I doubt its the issue, but I don't understand how all these parts connect well enough to be sure. I'm building on a macbook air m2.

Expected Behavior

Doesn't crash

Reproduction Steps

Build the current code for android, run a game. Boom, crash.

Log File

don't have a log file, but the relevant section in logcat:

FATAL EXCEPTION: main
                                                                                                    Process: org.citra.citra_emu.canary.debug, PID: 9911
                                                                                                    java.lang.RuntimeException: Unable to start activity ComponentInfo{org.citra.citra_emu.canary.debug/org.citra.citra_emu.activities.EmulationActivity}: java.lang.NullPointerException: null cannot be cast to non-null type org.citra.citra_emu.features.settings.model.IntSetting
                                                                                                        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4164)
                                                                                                        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4322)
                                                                                                        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
                                                                                                        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139)
                                                                                                        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96)
                                                                                                        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2685)
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:106)
                                                                                                        at android.os.Looper.loopOnce(Looper.java:230)
                                                                                                        at android.os.Looper.loop(Looper.java:319)
                                                                                                        at android.app.ActivityThread.main(ActivityThread.java:8919)
                                                                                                        at java.lang.reflect.Method.invoke(Native Method)
                                                                                                        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578)
                                                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
                                                                                                    Caused by: java.lang.NullPointerException: null cannot be cast to non-null type org.citra.citra_emu.features.settings.model.IntSetting
                                                                                                        at org.citra.citra_emu.activities.EmulationActivity.enableFullscreenImmersive(EmulationActivity.kt:183)
                                                                                                        at org.citra.citra_emu.activities.EmulationActivity.onCreate(EmulationActivity.kt:83)
                                                                                                        at android.app.Activity.performCreate(Activity.java:8975)
                                                                                                        at android.app.Activity.performCreate(Activity.java:8944)
                                                                                                        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1456)
                                                                                                        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4146)
                                                                                                        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4322) 
                                                                                                        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) 
                                                                                                        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139) 
                                                                                                        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96) 
                                                                                                        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2685) 
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:106) 
                                                                                                        at android.os.Looper.loopOnce(Looper.java:230) 
                                                                                                        at android.os.Looper.loop(Looper.java:319) 
                                                                                                        at android.app.ActivityThread.main(ActivityThread.java:8919) 
                                                                                                        at java.lang.reflect.Method.invoke(Native Method) 
                                                                                                        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578) 
                                                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103) 

System Configuration

Samsung Galaxy S23

DavidRGriswold commented 4 months ago

Update after more testing: It is the rotation option commit 93025c95f2ce4baed37a7b587236f12ef667c540 that breaks the build for me - I tested up to the commit right before it. Will try reverting that commit now and keep everything else (including my PR) on my personal build and see if everything works as expected...

DavidRGriswold commented 4 months ago

Yes, confirmed. I reverted that commit but kept everything else including my own PR for the separated custom layouts, and everything works fine. @newhinton feel free to reach out for more info about my crash if you wish, since that would clearly be a nice feature!

But for now, @PabloMK7 , I suggest reverting that commit.

newhinton commented 4 months ago

Huh, that is weird, i never got a null-pointer in that place. I will have to take a look at why that might be the case

newhinton commented 4 months ago

@PabloMK7 It seems the rotation issue was fixed. Should i recreate the PR? @DavidRGriswold Can you confirm the issue is fixed for you? The master branch of my fork should be up-to-date with the rotation and the fix.