Closed JaxkDev closed 2 months ago
The ACTION_PICK_IMAGES documentation says it was added in API level 33, which only came out in late 2022. If you want your app to be usable across a wide range of devices, you should probably use a different API.
Assuming the emulator on both machines was created by Briefcase, you probably created one of them with an older version of Briefcase, and it therefore uses an older API level. Try upgrading Briefcase, then run briefcase run android
and select "Create a new Android emulator".
Both use the default of Pixel 3a with API 34 :(
Ironically the issue emulator is the newest made one but they both are the same as far as I know
Are you absolutely certain? The top screenshot has rounded corners and no navigation buttons at the bottom, while the bottom screenshot has square corners and navigation buttons, which suggests it's older. Check the Android version number in "Settings > About phone".
I shall check now, I know the top is def 34 confirmed in android studio, havent got android studio installed on windows so went off name which said 34
May take a few to check apologies.
Interesting while i was setting up again,
It seems this might all have been because of a stupid typo in the android sdk.
(Running briefcase run android with absolutely nothing on system)
Obviously you have to accept a load of tos and it installs the sdk emulator etc. And the default device it lists:
Select device:
1) @INFO | Storing crashdata in: C:\Users\COMPUT~1\AppData\Local\Temp\\AndroidEmulator\emu-crash-34.2.13.db, detection is enabled for process: 14724 (emulator)
2) @Pixel_3a_API_34_extension_level_7_x86_64 (emulator)
3) Create a new Android emulator
> 2
In future, you can specify this device by running:
$ briefcase run android -d "@Pixel_3a_API_34_extension_level_7_x86_64"
However it then goes to download I assume the API 30 based off this next line:
[android_sdk] Downloading the 'system-images;android-30;google_apis_playstore;x86_64' Android system image...
So i do have a feeling it is indeed the wrong API
@mhsmith
Yup, apologies everyone.
Issue was just a stupid type from Android...
I'm not sure what the root cause of this could be. Did you create this emulator with Android Studio? Maybe you changed its API level at some point but the name remained the same.
Describe the bug
So on my Macbook Air M1 I made some android specific functions to take videos (this works in both environments, and uses
MediaStore.ACTION_VIDEO_CAPTURE
)However when I made the choosing pictures and videos from gallery it worked perfectly on my mac emulators, using
MediaStore.ACTION_PICK_IMAGES
.When then testing it on windows, It comes up saying
ACTION_PICK_IMAGES
doesn't exist...Steps to reproduce
Code used to 'pick an image' from the phones gallery:
Expected behavior
The choose a picture/video pop up to show, as shown below.
Screenshots
Expected Result (As on Mac M1):
Actual Result (As on Win11 machine):
(Notification showing it 'would' crash)
Environment
Working Version:
Not Working Version:
Logs
Working Macbook Air log: briefcase.2024_05_06-21_20_58.run.log
Not Working Windows log: briefcase.2024_05_06-21_21_39.run.log
Additional context
Attempted updating android sdk as suggested in discord, no updates available.