FishBun icon indicating copy to clipboard operation
FishBun copied to clipboard

[BUG] Camera button does not work for devices targeting Android 11

Open NickalasB opened this issue 5 years ago • 5 comments

Describe the bug The camera button is unresponsive on devices targeting Android 11 (API 30).

To Reproduce Steps to reproduce the behavior:

  1. Update the targetSdkand compileSdk to 30 in the sample app
  2. Address the compile errors around arrayLists
-                path = data!!.getParcelableArrayListExtra(FishBun.INTENT_PATH)
+                path = data?.getParcelableArrayListExtra(FishBun.INTENT_PATH) ?: arrayListOf()
  1. Launch the sample app
  2. Click on ACTIVITY IN STARTACTIVITYFORRESULT(DARK)
  3. Click the + button
  4. Click an album
  5. Click on the camera

Expected behavior The device should ask for camera permission and then launch the camera, where the user can take a photo that will be added to the selected album.

Screenshots ~If applicable, add screenshots to help explain your problem.~

Smartphone (please complete the following information):

  • Device: [Pixel3]
  • OS: [Android 11]
  • ~Browser [e.g. stock browser, safari]~
  • ~Version [e.g. 22]~

Additional context This issue was actually exposed when trying to upgrade our Flutter app that uses the Flutter multi_image_picker plugin.

NickalasB avatar Oct 26 '20 23:10 NickalasB

When will we get update please? Can not launch camera on API level 30.

Yunus0or1 avatar Feb 03 '21 10:02 Yunus0or1

Same issue here.

JarvanMo avatar Apr 18 '21 05:04 JarvanMo

Add this in your AndroidManifest.xml

android:requestLegacyExternalStorage="true"  in application tag

Yunus0or1 avatar Apr 18 '21 08:04 Yunus0or1

thanks

JarvanMo avatar Apr 19 '21 15:04 JarvanMo

based on https://stackoverflow.com/a/64204646/908821 add the following to your manifest

<queries>
    <!-- Camera -->
    <intent>
        <action android:name="android.media.action.IMAGE_CAPTURE" />
    </intent> 
</queries>

angelkoh avatar Apr 26 '21 04:04 angelkoh