hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
11.45k stars 2.19k forks source link

Crash when selecting memory stick on sdcard (Android Lollipop) #14821

Closed KaiFujiro closed 3 years ago

KaiFujiro commented 3 years ago

Game or games this happens in

I haven't played game

What area of the game / PPSSPP

I haven't played game

What should happen

Why in ppsspp version v1.11.3-1293-g16e820eda Can't select sdcard as memory stick? when i choose on the menu "create or choose psp a folder" my ppsspp crashes immediately. In build version v1.11.2-309-g8e90d0644 you can choose by typing the location to be created on the memory stick. Example set like this: Storage/ExtSdCard/android/data/org.ppsspp.ppsspp

I try it on Android 5.1.1

Logs

No response

Platform

Android

Mobile phone model or graphics card

J1 Ace J111F

PPSSPP version affected

v1.11.3-1293-g16e820eda

Last working version

v1.11.2-309-g8e90d0644

Graphics backend (3D API)

OpenGL / GLES

Checklist

hrydgard commented 3 years ago

Thanks for reporting, this is very useful!

I'm going to test on some old phones, and see if I can reproduce this. If you can figure out how to get ADB logs from the crash, those could also be useful.

KaiFujiro commented 3 years ago

I'll take the logcat

ghost commented 3 years ago

I also have this problem before https://github.com/hrydgard/ppsspp/issues/14544 I will try the latest build again on my ancient phone and see if I can reproduce this.

hrydgard commented 3 years ago

Thanks, please do.

Maybe for some older devices, we're gonna end up having to add back the option to type the path in...

KaiFujiro commented 3 years ago

Here is the logcat

https://drive.google.com/file/d/1-bgM9d-AKXRbQJdxlro8zgPMTd6AUQk3/view?usp=drivesdk

KaiFujiro commented 3 years ago

Thanks, please do.

Maybe for some older devices, we're gonna end up having to add back the option to type the path in...

Yes, I like it

ghost commented 3 years ago

Crashes again. Screenshot_2021-09-10-19-36-44

KaiFujiro commented 3 years ago

Crashes again. Screenshot_2021-09-10-19-36-44

Just be patient, we wait for the bot to make a new build

ghost commented 3 years ago

Crashes again. Screenshot_2021-09-10-19-36-44

Just be patient, we wait for the bot to make a new build

IKT lol 😁

hrydgard commented 3 years ago

Ok, thanks for testing and the logs!

I'll get this fixed later.

KaiFujiro commented 3 years ago

Ok, thanks for testing and the logs!

I'll get this fixed later.

Thx <3

ghost commented 3 years ago

Change title to (Android) (Lollipop) crash when selecting external sdcard path.

hrydgard commented 3 years ago

Super confusing stack traces in that logcat! Thanks for getting them, though!

I'm charging up some old devices to try to repro...

Digging up even older devices now.

Anyway, I'm gonna disable this option on Android 9 and lower anyway, because the folder selector just generally doesn't work properly until Android 10 (and barely until 11, really). Will add back the type-in field.

unknownbrackets commented 3 years ago

It did seem like half a stack trace, strangely. An adb logcat from a PC would probably be more detailed...

With that change merged, is it still crashing?

-[Unknown]

KaiFujiro commented 3 years ago

It did seem like half a stack trace, strangely. An adb logcat from a PC would probably be more detailed...

With that change merged, is it still crashing?

-[Unknown]

My ppsspp doesn't crash anymore, but why can't the file path be found? I wrote it right "/storage/extsdcard/android/data/org.ppsspp.ppsspp" even by adding /storage/extsdcard/android/data/org.ppsspp.ppsspp/files. Still same

KaiFujiro commented 3 years ago

Here

logcat_09-11-2021_10-28-42.txt

ghost commented 3 years ago

It did seem like half a stack trace, strangely. An adb logcat from a PC would probably be more detailed... With that change merged, is it still crashing? -[Unknown]

My ppsspp doesn't crash anymore, but why can't the file path be found? I wrote it right "/storage/extsdcard/android/data/org.ppsspp.ppsspp" even by adding /storage/extsdcard/android/data/org.ppsspp.ppsspp/files. Still same

Try this if its work /storage/sdcard1/android/data/org.ppsspp.ppsspp

KaiFujiro commented 3 years ago

oh no, it crashes again, when I select a specific folder outside of android/data. Examples like this: storage/extsdcard/PSP. the "PSP" folder I made myself, maybe it can be detected, even crash

KaiFujiro commented 3 years ago

It did seem like half a stack trace, strangely. An adb logcat from a PC would probably be more detailed... With that change merged, is it still crashing? -[Unknown]

My ppsspp doesn't crash anymore, but why can't the file path be found? I wrote it right "/storage/extsdcard/android/data/org.ppsspp.ppsspp" even by adding /storage/extsdcard/android/data/org.ppsspp.ppsspp/files. Still same

Try this if its work /storage/sdcard1/android/data/org.ppsspp.ppsspp still undetected

ghost commented 3 years ago

change sdcard1 to sdcard0 still undetected? Maybe try to put your sdcard number instead of sdcard? example mine is /storage/3136-6161/PSP

KaiFujiro commented 3 years ago

change sdcard1 to sdcard0 still undetected? Maybe try to put your sdcard number instead of sdcard? example mine is /storage/3136-6161/PSP

Well, it works, but there are no folders like textures or save data

KaiFujiro commented 3 years ago

change sdcard1 to sdcard0 still undetected? Maybe try to put your sdcard number instead of sdcard? example mine is /storage/3136-6161/PSP

Also on my phone, "sdcard0" and "ExtSdCard" are different.

what I see in the root folder, sdcard0 is still in device storage, and not on the external sdcard

ghost commented 3 years ago

Still crashing on my ancient phone :(

java.lang.RuntimeException: Unable to start activity ComponentInfo{org.ppsspp.ppsspp/org.ppsspp.ppsspp.PpssppActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.io.File.getAbsolutePath()' on a null object reference
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2521)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2601)
    at android.app.ActivityThread.access$800(ActivityThread.java:178)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1470)
    at android.os.Handler.dispatchMessage(Handler.java:111)
    at android.os.Looper.loop(Looper.java:194)
    at android.app.ActivityThread.main(ActivityThread.java:5637)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
    at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:107)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.io.File.getAbsolutePath()' on a null object reference
    at org.ppsspp.ppsspp.NativeActivity.Initialize(NativeActivity.java:403)
    at org.ppsspp.ppsspp.NativeActivity.onCreate(NativeActivity.java:602)
    at org.ppsspp.ppsspp.PpssppActivity.onCreate(PpssppActivity.java:120)
    at android.app.Activity.performCreate(Activity.java:6100)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1112)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2468)
    ... 11 more
KaiFujiro commented 3 years ago

@hrydgard Wow, I found the solution, so now the letters we type must match the name of the storage location. correct example like this: /storage/extSdCard/Android/data/org.ppsspp.ppsspp

not like this: storage/extsdcard/android/data/org.ppsspp.ppsspp.

The key is in the name "extSdCard" and "Android" If you write it wrong, then it won't be detected

KaiFujiro commented 3 years ago

In the past in version v1.11.2-309-g8e90d0644 just writing it like "storage/extsdcard/android/data/org.ppsspp.ppsspp" it worked immediately, as long as you know what your sdcard's name is, some only have the name "extsdcard" and have a number.

hrydgard commented 3 years ago

Oh, I suppose it would be possible to automatically match the case... The check might have gotten a little too strict (previously no check was done at all, which also had issues of course)

hrydgard commented 3 years ago

Merged a fix for that, it should now work at least as well as before.

I think we're all good here now, closing.

ghost commented 3 years ago

My ancient phone still crashing.

java.lang.RuntimeException: Unable to start activity ComponentInfo{org.ppsspp.ppsspp/org.ppsspp.ppsspp.PpssppActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.io.File.getAbsolutePath()' on a null object reference
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2521)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2601)
    at android.app.ActivityThread.access$800(ActivityThread.java:178)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1470)
    at android.os.Handler.dispatchMessage(Handler.java:111)
    at android.os.Looper.loop(Looper.java:194)
    at android.app.ActivityThread.main(ActivityThread.java:5637)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
    at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:107)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.io.File.getAbsolutePath()' on a null object reference
    at org.ppsspp.ppsspp.NativeActivity.Initialize(NativeActivity.java:403)
    at org.ppsspp.ppsspp.NativeActivity.onCreate(NativeActivity.java:602)
    at org.ppsspp.ppsspp.PpssppActivity.onCreate(PpssppActivity.java:122)
    at android.app.Activity.performCreate(Activity.java:6100)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1112)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2468)
    ... 11 more
ghost commented 3 years ago

Last working build https://github.com/hrydgard/ppsspp/commit/c7d344875d6d20f4d386defa4e074b7e3c7fa064 Screenshot_2021-09-12-10-32-59

First break build https://github.com/hrydgard/ppsspp/commit/35ad3106ff89d8c5a73e09fdca5d291e755f35a1 Screenshot_2021-09-12-10-34-20 My sdcard is read-only but it shouldn't crash.

unknownbrackets commented 3 years ago

Thanks, that's helpful. Try again after db21d0e builds.

-[Unknown]

ghost commented 3 years ago

Confirmed fixed by https://github.com/hrydgard/ppsspp/commit/db21d0e7fcc60cd86f8a20e72e7805d457cf6759