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

Exporting Save Error #22

Open
ProPaint opened this issue Jan 6, 2021 · 17 comments
Open

Exporting Save Error #22

ProPaint opened this issue Jan 6, 2021 · 17 comments

Comments

@ProPaint
Copy link

ProPaint commented Jan 6, 2021

So after building the app I tried to load some saves with success but the export raise an exception.

136449818_124611972808538_2895291072225609398_n
136352643_1340063879662786_3105219950507265603_n

I think it might be due to the fact that I use an Android 11 device.
The backup file is properly exported as shown by the console in Debugger mode.

@kwsch
Copy link
Owner

kwsch commented Jan 6, 2021

Probably due to Android 11:

https://stackoverflow.com/a/64438193
image

<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />

@ProPaint
Copy link
Author

ProPaint commented Jan 7, 2021

I tried adding this to the manifest and it doesn't change anything. I don't understand why it's not woring as I'm still targeting Android 9.
(I tried targetting A11 and opting out of scoped storage without luck, I even lost read access doing that...)

@ChristopherHX
Copy link

ChristopherHX commented Jan 17, 2021

I have had the same problem on Android 9, but I found a Workaround for my device:

  • Move your savefiles to <Internal Storage>/Android/data/com.ProjectPokemon.PKHeX/ (I used the app "Files by Google")
  • Now open your savefiles from <Internal Storage>/Android/data/com.ProjectPokemon.PKHeX/, you might now be able to save changes without changing anything from the app

Edit:
My similar error on Android 9 with a Nokia 8 device is,
The app has storage access allowed. I installed the app via an apk built by github actions. This app might need to use platform specfic Xamarin.Android storage apis to avoid such errors.

Screenshot_20210119-092523

@A5h33p
Copy link

A5h33p commented Feb 19, 2021

Probably due to Android 11:

https://stackoverflow.com/a/64438193
image

<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />

I don't have much experience with this stuff can you explain where exactly I have to put this code, how I open it, e.t.c.?

@swablueme
Copy link

swablueme commented Feb 19, 2021

Probably due to Android 11:
https://stackoverflow.com/a/64438193
image

<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />

I don't have much experience with this stuff can you explain where exactly I have to put this code, how I open it, e.t.c.?

Unfortunately I tried that already and it didn't work! I'm on Android 11. (I think it's supposed to be put with the other permissions under https://github.com/kwsch/PKHeX.Mobile/blob/master/PKHeX.Android/Properties/AndroidManifest.xml) but it didn't do anything😭

I'm way too dumb to figure out the proper solution. So for my rooted Android 11 I just got it to write the edited save file to the PKHeX Backups folder which is located in data/data/com.ProjectPokemon.PKHeX/files (you can't access this folder unless you're rooted) since ProPaint mentioned that backup file writes but not the edited file. So I made a super crappy FileUtil.cs (https://github.com/kwsch/PKHeX.Mobile/blob/master/PKHeX.Mobile/Logic/FileUtil.cs) edit beginning at line 69 which will at least tide me over until the next commits
image

Building on commit 3316752 also raised a build error with regards to line 32 and 33 of https://github.com/kwsch/PKHeX.Mobile/blob/master/PKHeX.Mobile/Logic/BindingUtil.cs

so I did what visual studio code told me to and edited those lines to
image

it seems to work without breaking things.... for now....

@ItsAnthonyyyy
Copy link

I have had the same problem on Android 9, but I found a Workaround for my device:

  • Move your savefiles to <Internal Storage>/Android/data/com.ProjectPokemon.PKHeX/ (I used the app "Files by Google")
  • Now open your savefiles from <Internal Storage>/Android/data/com.ProjectPokemon.PKHeX/, you might now be able to save changes without changing anything from the app

Screenshot_20210613_162108_com ProjectPokemon PKHeX
Screenshot_20210613_162049_com ProjectPokemon PKHeX

This works on Android 10.

@eco9898
Copy link
Contributor

eco9898 commented Oct 2, 2021

Hey, if anyone is having this issue I made an update for android 11 that addresses it :)
Hopefully it will be merged in here but for now you can access it at this fork.

@Isaac22Mora

This comment was marked as off-topic.

@Isaac22Mora
Copy link

and that is the latest update

@kwsch
Copy link
Owner

kwsch commented Jun 11, 2022

@Isaac22Mora that error message is not present in the repo or the pipeline build. Do not report issues with other people's forks/logic.

@TSoli
Copy link

TSoli commented Jan 4, 2023

App just crashes on my phone when I try to export. Running android 13.

@Quorsor
Copy link

Quorsor commented Jan 24, 2023

Same here, app just crashes after clicking export in Android 13.

image

@gazza1988
Copy link

I'm on android 13 and managed to fix it. I'm on a samsun galaxy s21 ultra but I assume settings can be found on other devices.

Basically you need to give pokehex full read/write permissions.

Settings>security and privacy>privacy> permission manager>files

On my phone I didn't have pkhex on the list. However underneath the apps lost is text that says "see more apps that can access all files" in blue and I tap that text and a list of apps appear. Find pkhex in the list and and allow it access.

Once I enabled access I could then write to the drastic folder, no need to move files.

@TSoli
Copy link

TSoli commented Jun 2, 2023

I'm on android 13 and managed to fix it. I'm on a samsun galaxy s21 ultra but I assume settings can be found on other devices.

Basically you need to give pokehex full read/write permissions.

Settings>security and privacy>privacy> permission manager>files

On my phone I didn't have pkhex on the list. However underneath the apps lost is text that says "see more apps that can access all files" in blue and I tap that text and a list of apps appear. Find pkhex in the list and and allow it access.

Once I enabled access I could then write to the drastic folder, no need to move files.

Amazing! Works for me!

@gazza1988
Copy link

I'm on android 13 and managed to fix it. I'm on a samsun galaxy s21 ultra but I assume settings can be found on other devices.

Basically you need to give pokehex full read/write permissions.

Settings>security and privacy>privacy> permission manager>files

On my phone I didn't have pkhex on the list. However underneath the apps lost is text that says "see more apps that can access all files" in blue and I tap that text and a list of apps appear. Find pkhex in the list and and allow it access.

Once I enabled access I could then write to the drastic folder, no need to move files.

Firtger to this post I made.

Seems pkhex saves to a folder and not to drastic folder so some copying may be required but the rest is still relevant.

@DerPannseJim
Copy link

i managed the app to work on A 13 too but each time i open up the modified savestate my old state is loaded. haaaalp. :D

@LeoLionly5
Copy link

I also had some problems when exporting in Android 12 & HarmonyOS, so I made an update on this fork, in case someone like me who loves Gen3/4 but doesn’t have a Windows which is need for PkHex ver. PC.

I'm not familiar with Xamarin, forgive me if my code is not well written

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