Skip to content
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

Cannot select ROM directory on latest nightly with Android 15 #1385

Open
jalavosus opened this issue Feb 16, 2025 · 16 comments
Open

Cannot select ROM directory on latest nightly with Android 15 #1385

jalavosus opened this issue Feb 16, 2025 · 16 comments

Comments

@jalavosus
Copy link

jalavosus commented Feb 16, 2025

  • Device model: Pixel 8a
  • Android version: Android 14 15

Problem:
melonDS does not request any storage permissions from the operating system, making it impossible to select a ROM directory.

Steps to reproduce (if applicable):

  1. Install latest melonDS nightliy
  2. Attempt to choose a ROM folder
  3. There is no way to actually select a folder for use, as the app does not request any storage permissions
@rafaelvcaetano
Copy link
Owner

The storage permission kind of no longer exists nowadays. Users give permission by selecting the files or folders through the system's file picker.
Which folder are you choosing? There are some folders that the system does not allow you to choose, such as the root directory or, in some devices, the Downloads folder.

@jalavosus
Copy link
Author

Appreciate the response.

Using the file picker, I create a new folder in what I'm assuming is /sdcard/ (adb shell confirms this), but regardless of how many times I attempt it, I can't grant permission whatsoever.

If this has something to do with the fact that I sideloaded the latest nightly and didn't download melon from the Play store, then uh, womp.

@rafaelvcaetano
Copy link
Owner

Do you think you could upload a video showing the steps you are taking in the app?

@jalavosus
Copy link
Author

@jalavosus
Copy link
Author

jalavosus commented Feb 17, 2025

Oh, sweet god, I'm a dumbass. I'm in Android 15. That's... That's a huge difference

@jalavosus jalavosus changed the title Cannot select ROM directory on latest nightly with Android 14 Cannot select ROM directory on latest nightly with Android 15 Feb 17, 2025
@rafaelvcaetano
Copy link
Owner

I can't reproduce the issue, but the video really helps me understand what's going on. I'll see what I can find.

@jalavosus
Copy link
Author

Just for extra reproduction help:

  • downloaded the nightly APK from here
  • issue happens regardless of whether I do adb install or install it from a file explorer (I've tried both inbuilt [Files by Google] and CX)
  • this also happens with the current version available on the Play store, so I don't think it's related to any recent MelonDS4A updates.

I'm not an Android developer, but I am a developer in general, so let me know if there's anything I can do to help out.

@FATCatAndroid12
Copy link

Image
Can you try that?

@rafaelvcaetano
Copy link
Owner

I tried running the app on a remote device from Firebase, but they only have Pixel 8a running Android 14 and couldn't reproduce this.
Did you try the app when running Android 14? If so, do you remember if it worked fine?
On a different note, does the OpenGL renderer work well for you? Or is it completely broken?

@jalavosus
Copy link
Author

jalavosus commented Feb 21, 2025

@Fatcat2024-cpu I did actually check that first before posting here (though I appreciate you checking that I checked!)

I only have this one option in that menu, and showing hidden files does not change anything.

Image

It seems that the app just can't get the directory tree view for /sdcard (/storage/emulated/0). After looking through some Android dev permissions documents, the permission(s) I thought would have caused this problem would have caused this problem from Android 11, so I have no clue what's going on.

@rafaelvcaetano since I'll have some time this weekend, I'll see if I can get some debug logs for you.

@jalavosus
Copy link
Author

jalavosus commented Feb 21, 2025

Ah, neat, here's one thing I can provide immediately. Ran adb logcat and saw this cute lil nugget:

02-21 16:00:09.841 10818 13905 W ExternalStorage: Error in checking file equality check.
02-21 16:00:09.841 10818 13905 W ExternalStorage: java.nio.file.NoSuchFileException: /storage/emulated
02-21 16:00:09.841 10818 13905 W ExternalStorage: 	at sun.nio.fs.UnixFileSystemProvider.isSameFile(UnixFileSystemProvider.java:344)
02-21 16:00:09.841 10818 13905 W ExternalStorage: 	at java.nio.file.Files.isSameFile(Files.java:1504)
02-21 16:00:09.841 10818 13905 W ExternalStorage: 	at com.android.externalstorage.ExternalStorageProvider.isRestrictedPath(ExternalStorageProvider.java:352)
02-21 16:00:09.841 10818 13905 W ExternalStorage: 	at com.android.externalstorage.ExternalStorageProvider.shouldHideDocument(ExternalStorageProvider.java:313)
02-21 16:00:09.841 10818 13905 W ExternalStorage: 	at com.android.internal.content.FileSystemProvider.queryChildDocuments(FileSystemProvider.java:414)
02-21 16:00:09.841 10818 13905 W ExternalStorage: 	at com.android.internal.content.FileSystemProvider.queryChildDocuments(FileSystemProvider.java:385)
02-21 16:00:09.841 10818 13905 W ExternalStorage: 	at android.provider.DocumentsProvider.queryChildDocuments(DocumentsProvider.java:618)
02-21 16:00:09.841 10818 13905 W ExternalStorage: 	at android.provider.DocumentsProvider.query(DocumentsProvider.java:935)
02-21 16:00:09.841 10818 13905 W ExternalStorage: 	at android.content.ContentProvider$Transport.query(ContentProvider.java:296)
02-21 16:00:09.841 10818 13905 W ExternalStorage: 	at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:107)
02-21 16:00:09.841 10818 13905 W ExternalStorage: 	at android.os.Binder.execTransactInternal(Binder.java:1391)
02-21 16:00:09.841 10818 13905 W ExternalStorage: 	at android.os.Binder.execTransact(Binder.java:1335)
02-21 16:00:09.841 10818 13905 W FileSystemProvider: Queried directory "primary:" is hidden

Different but possibly related bit, happens whenever I open the file picker: 02-21 16:15:00.857 26268 26268 E oid.documentsui: No package ID ff found for resource ID 0xffffffff.

It could be that FileUtils isn't getting the /0 end of /storage/emulated/0? This is beyond my realm of knowledge.

@jalavosus
Copy link
Author

Did you try the app when running Android 14? If so, do you remember if it worked fine?
On a different note, does the OpenGL renderer work well for you? Or is it completely broken?

I did not try it on 14, unfortunately. And I have no clue if the OpenGL renderer works, since I can't load up any ROMs 😢

@wolfdewitte
Copy link

For what it's worth, I'm using a Pixel 9 on Android 15 and was able to set the ROM directory fine using the latest nightly build.

This is what the directory view looks like on my end:
Image

I understand this probably isn't very helpful, but since I'm also using a Pixel device on Android 15 I thought I'd share my experience.

@jalavosus
Copy link
Author

@wolfdewitte are you rooted? Just out of curiosity, since I'm running stock.

@wolfdewitte
Copy link

@wolfdewitte are you rooted? Just out of curiosity, since I'm running stock.

No, I'm using stock Android as well.

@rafaelvcaetano
Copy link
Owner

Thanks for keeping this discussion going guys! All the information you have gathered is really useful.

I also managed to kind of reproduce this on a Samsung device. However, the UI is slightly different and it still allows me to select other directories from a side menu, which kind of acts as a workaround. I'll keep investigating.
Image Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants