Closed Jy1211a closed 11 months ago
加载游戏文件时,执行EmulatorManager.getInstance().startGame(mAct, MyEmulatorActivity::class.java,romFile)后显示无法加载游戏对话框。(权限已经给予)
提供一下日志
I also have this problem
I did not make any changes in the source. I just wrote the following path to read the nes file
val romFile = File(Environment.getExternalStorageDirectory().path + "/Download/contra.nes")
Although I have given access to the memory, I get the following error
java.io.FileNotFoundException: /storage/emulated/0/Download/contra.nes: open failed: EACCES (Permission denied)
I did not make any changes in the source. I just wrote the following path to read the nes file
val romFile = File(Environment.getExternalStorageDirectory().path + "/Download/contra.nes")
Although I have given access to the memory, I get the following error
java.io.FileNotFoundException: /storage/emulated/0/Download/contra.nes: open failed: EACCES (Permission denied)
You should grant data read and write permissions to your application first,Android6.0+ need dynamic apply sensitive permissions,Or you can set application settings for open RW permission!
I did not make any changes in the source. I just wrote the following path to read the nes file
val romFile = File(Environment.getExternalStorageDirectory().path + "/Download/contra.nes")
Although I have given access to the memory, I get the following error
java.io.FileNotFoundException: /storage/emulated/0/Download/contra.nes: open failed: EACCES (Permission denied)
Is that Android Q or higher?You need to adapt to a higher version of the Android API feature.(however you can put the nes rom file in source code of assets,It can also achieve file loading!)
Thank Beseting I solved the problem We can only read the files that we have saved in the allowed folders of Android.
For example, we can create a folder named x in the download folder and then save the .nes file in it. And finally call this route download/x/contra.nes
Some allowed Android folders: Download Documents Music Pictures And ...
加载游戏文件时,执行EmulatorManager.getInstance().startGame(mAct, MyEmulatorActivity::class.java,romFile)后显示无法加载游戏对话框。(权限已经给予)