-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
PlatformException(no_available_camera, No cameras available for taking pictures., null) #62669
Comments
Hi @krupalbhardiya, I used |
@darshankawar this code runs well in debug builds but it crashes the App in release build. App can't even start. It crashes from the start. So I have to remove the whole code in order to start the App. |
Hi @krupalbhardiya, |
@darshankawar should i switch to master branch ? |
@darshankawar after switching to master branch and creating the release build variant of the App no longer crashes the App. |
@darshankawar i have tried your solution, but i get the same error as @krupalbhardiya . Are there other solutions? |
@Knupper , issue is resolved in master branch. you can switch to master branch of flutter or wait till the latest version is available in stable branch. |
@krupalbhardiya i switched to the master branch, but have still the same output. When i start the ImagePicker with
Switching to the master/beta channel have not changed anything. Any other ideas are welcome :) |
I took another look into it, the example project works for me, but when i change the |
I had the same error, my Changing these to 29 fixed the issue for me. |
The issue does still reproduce with targetSdkVersion 30 on Flutter Channel beta, 1.22.0-12.1.pre. |
This seems to be an issue with targeting api version to 30. |
@darshankawar i have tried it today, with this permission it works fine with tagetSdk30. |
@darshankawar You are A LIFE-SAVER! Only way to compatible with two packages 'geolocator' and 'image_picker'. |
resolveActivity(intent) might return false on android 11+_even though startActivity(intent) would succeed. Instead of introducing a <queries> entry we can just try to start the activity and catch the exception if that doesn't work. Properly fixes flutter/flutter#62669. Ref: https://cketti.de/2020/09/03/avoid-intent-resolveactivity/
resolveActivity(intent) might return false on android 11+_even though startActivity(intent) would succeed. Instead of introducing a <queries> entry we can just try to start the activity and catch the exception if that doesn't work. Properly fixes flutter/flutter#62669. Ref: https://cketti.de/2020/09/03/avoid-intent-resolveactivity/
resolveActivity(intent) might return false on android 11+_even though startActivity(intent) would succeed. Instead of introducing a <queries> entry we can just try to start the activity and catch the exception if that doesn't work. Properly fixes flutter/flutter#62669. Ref: https://cketti.de/2020/09/03/avoid-intent-resolveactivity/
resolveActivity(intent) might return false on android 11+_even though startActivity(intent) would succeed. Instead of introducing a <queries> entry we can just try to start the activity and catch the exception if that doesn't work. Properly fixes flutter/flutter#62669. Ref: https://cketti.de/2020/09/03/avoid-intent-resolveactivity/
Adding the <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/> permission leads to the warning message:
A better solution is to add <queries> to the manifest file: https://stackoverflow.com/a/63246789/3129257 |
This problem still occurs with target and compile SDK 30 and image_picker=0.7.4. Adding this:
|
Same issue here. Info:
Related SO. Update (Fixed by): <queries>
<intent>
<action android:name="android.media.action.IMAGE_CAPTURE" />
</intent>
</queries> |
resolveActivity(intent) might return false on android 11+_even though startActivity(intent) would succeed. Instead of introducing a <queries> entry we can just try to start the activity and catch the exception if that doesn't work. Properly fixes flutter/flutter#62669. Ref: https://cketti.de/2020/09/03/avoid-intent-resolveactivity/
resolveActivity(intent) might return false on android 11+_even though startActivity(intent) would succeed. Instead of introducing a <queries> entry we can just try to start the activity and catch the exception if that doesn't work. Properly fixes flutter/flutter#62669. Ref: https://cketti.de/2020/09/03/avoid-intent-resolveactivity/
resolveActivity(intent) might return false on android 11+_even though startActivity(intent) would succeed. Instead of introducing a <queries> entry we can just try to start the activity and catch the exception if that doesn't work. Properly fixes flutter/flutter#62669. Ref: https://cketti.de/2020/09/03/avoid-intent-resolveactivity/
resolveActivity(intent) might return false on android 11+_even though startActivity(intent) would succeed. Instead of introducing a <queries> entry we can just try to start the activity and catch the exception if that doesn't work. Properly fixes flutter/flutter#62669. Ref: https://cketti.de/2020/09/03/avoid-intent-resolveactivity/
resolveActivity(intent) might return false on android 11+_even though startActivity(intent) would succeed. Instead of introducing a <queries> entry we can just try to start the activity and catch the exception if that doesn't work. Properly fixes flutter/flutter#62669. Ref: https://cketti.de/2020/09/03/avoid-intent-resolveactivity/
resolveActivity(intent) might return false on android 11+_even though startActivity(intent) would succeed. Instead of introducing a <queries> entry we can just try to start the activity and catch the exception if that doesn't work. Properly fixes flutter/flutter#62669. Ref: https://cketti.de/2020/09/03/avoid-intent-resolveactivity/
resolveActivity(intent) might return false on android 11+_even though startActivity(intent) would succeed. Instead of introducing a <queries> entry we can just try to start the activity and catch the exception if that doesn't work. Properly fixes flutter/flutter#62669. Ref: https://cketti.de/2020/09/03/avoid-intent-resolveactivity/
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Steps to Reproduce
Taking pictures using camera crashes the Plugin (Image Picker by Flutter)
This plugin works in Emulator and Physical device with Android API <=29.
On Android Platform API 30, the plugin crashed with no available cameras exception.
I've used the system default camera app in Android API 30 and is opens up the camera and captures the image on the other hand, plugin shows exception of no cameras available for taking pictures.
All Runtime permissions are allowed and static manifest permissions are also declared.
Expected results:
Open Camera and Take picture from system default Camera App.
Actual results:
PlatformException(no_available_camera, No cameras available for taking pictures., null)
Logs
PlatformException(no_available_camera, No cameras available for taking pictures., null)[√] Flutter (Channel stable, v1.17.5, on Microsoft Windows [Version 10.0.18363.720], locale en-US)
• Flutter version 1.17.5 at D:\flutter_sdk
• Framework revision 8af6b2f (4 weeks ago), 2020-06-30 12:53:55 -0700
• Engine revision ee76268252
• Dart version 2.8.4
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
• Android SDK at D:\android_sdk
• Platform android-30, build-tools 30.0.1
• ANDROID_HOME = D:\android_sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
X Android license status unknown.
Try re-installing or updating your Android SDK Manager.
See https://developer.android.com/studio/#downloads or visit visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions.
[√] Android Studio (version 4.0)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 47.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[√] VS Code, 64-bit edition (version 1.47.3)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 3.12.2
[√] Connected device (1 available)
• sdk gphone x86 64 • emulator-5554 • android-x64 • Android 11 (API 30) (emulator)
The text was updated successfully, but these errors were encountered: