os-fileup icon indicating copy to clipboard operation
os-fileup copied to clipboard

Android 11+ Support is needed

Open Andrew-J-Larson opened this issue 4 years ago • 11 comments

Since Android 11 (API 30) is now the target API version for the Google Play store, some work is going to need to be done to allow saving images to the gallery on phones using Android 11+ ...

If I can find a fix, I'll of course send a merge request, but for now I'm still at a loss on how to implement it, but the best bets are using the MediaStore functions.

Andrew-J-Larson avatar Jan 03 '21 09:01 Andrew-J-Larson

sorry for coming late. it's done. let me know if the latest release works fine with your devices, so we can proceed with other fixes.

and thanks for the reminder.

mgks avatar Mar 06 '21 00:03 mgks

Android 11 (API 30) camera can't save photo in real phone. But in emulator camera saves photo "image.jpg" to pictures

ouygunol avatar May 05 '21 12:05 ouygunol

Android 11 (API 30) camera can't save photo in real phone. But in emulator camera saves photo "image.jpg" to pictures

@ouygunol are you making sure the camera permission is given to the app?

Andrew-J-Larson avatar May 05 '21 20:05 Andrew-J-Larson

of course. in api 29 works fine but api 30 i cant solve the problem

ouygunol avatar May 05 '21 21:05 ouygunol

of course. in api 29 works fine but api 30 i cant solve the problem

@ouygunol API 29 likely works fine because of requestLegacyExternalStorage

For the phone that can't save a photo in the phone, does any error show up? Did you make sure to give it a second test too? (I've seen a bug sometimes where first attempt to capture photo doesn't work)

I've yet to test this newest version on my own app, so I can't help too much.

Andrew-J-Larson avatar May 05 '21 21:05 Andrew-J-Larson

Hi, for me its also not woking in Android 11 (API 30) on a real phone. Permissions are all set. Here is the Error Log when running the Os-FileUp App:


java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { act=inline-data (has extras) }} to activity {mgks.os.fileup/mgks.os.fileup.MainActivity}: java.lang.NullPointerException: uriString
        at android.app.ActivityThread.deliverResults(ActivityThread.java:5016)
        at android.app.ActivityThread.handleSendResult(ActivityThread.java:5057)
        at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2067)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7697)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:952)

Caused by: java.lang.NullPointerException: uriString
        at android.net.Uri$StringUri.<init>(Uri.java:496)
        at android.net.Uri$StringUri.<init>(Uri.java:486)
        at android.net.Uri.parse(Uri.java:458)
        at mgks.os.fileup.MainActivity.onActivityResult(MainActivity.java:115)
        at android.app.Activity.dispatchActivityResult(Activity.java:8310)
        at android.app.ActivityThread.deliverResults(ActivityThread.java:5009)

mrfaa avatar May 17 '21 08:05 mrfaa

any update on this issue?

mrfaa avatar Jan 05 '22 09:01 mrfaa

image The buttons are not responding in API 31 while it does work fine in lower API versions.

vrysa avatar Feb 07 '22 18:02 vrysa

image The buttons are not responding in API 31 while it does work fine in lower API versions.

It was fixed by changing the maxSDK version as follows <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="31" in AndroidManifest.xml file

vrysa avatar Feb 10 '22 16:02 vrysa

image The buttons are not responding in API 31 while it does work fine in lower API versions.

It was fixed by changing the maxSDK version as follows <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="31" in AndroidManifest.xml file

That's not going to be feasible for future versions of Android, that just avoids changing the code to make it compatible for future versions.

Andrew-J-Larson avatar Feb 10 '22 16:02 Andrew-J-Larson

will be fixing it by march end.

mgks avatar Feb 25 '22 12:02 mgks