-
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
[image_picker] losing connection with device #48016
Comments
Hi @maheshmnj |
thanks for that info I tried it on an android as well as ios device,it works without a problem with the latest version of the image picker. 0.6.2+3 |
This issue still persists in This is frustrating as it is an important feature for an app. |
Can you try with |
Hey @maheshmnj, If I release an update for the app with the latest version of the plugin, I am not sure how will it work on redmi6a and realme 3 pro. Because these were the client's device running the release apk.It would be a huge problem if it fails to work as releasing frequent updates becomes frustrating for clients to keep on updating the app. I checked 0.6.2+3 on 1gb ram device (to see if low ram is the issue), it worked smoothly.
The above code stores clicked images in a list. |
Hey, I am having the same issue on Android, after I click the tick on Camera to accept the picture, the App crashes with no errors Device: OS Version: Plugin version: Code: |
I am using the latest image picker plugin it works well .is there any specific reason to use the camera plugin?if not, Can you try removing the camera plugin from pubspec.yaml
|
Using Flutter version 1.12.13+hotfix.5, i'm also experiencing issues with the image_picker package. On Android, if I use the gallery as a source and select an image it works fine. If I use gallery as the source, but select the back button on my device, the app crashes with no logs. Furthermore, If I use the camera as the source, I can capture and recapture images, but when I select "OK" to confirm the image, the app, again, crashes with no logs. I'm using the latest image_picker and camera plugin versions. I have also tried removing the camera plugin from pubspec.yaml, but the behaviour is exactly the same with or without it. This also crashes on an emulator. |
Whenever I use camera as the source for image picker on Android Q, the device immediately loses connection with no explanation or errors. I can see the camera, take the image but when confirming the image nothing happens. If i select the "X", my app restarts because it had initially crashed opening the camera. This only happens on android. When testing this on a simulator, I get an error stating "Camera Error Can't connect to the camera" I have attempted flutter pub cache repair, as well as using "flutter clean" multiple times. Does anyone have any suggestions?
|
I have the same problem when I use it in iOS emulator,it will lost the connection with the devices.The image_picker from the lastest 0.6.3+1 to 0.6.0.Only 0.5.4+3 or the older version it works nomal. |
Still losing connection and app restarts every time, not even sometimes. Device: Redmi 7 I've tested in Mi A3, Nokia 6.1 Plus and Motorola E5. Works perfectly in those. |
Still waiting for a solution. This is a severe crash and I've no idea what's going wrong in this particular Xiaomi device. |
Also occurring still on a One Plus device. Fine on Samsung S10. Wondering if there’s something different for specific device brands. |
I am facing this problem now, when i run the app on a virtual device it works fine, but when i run it into my xiaomi device it stop debbugin in vscode and pop to the main activity, i need help |
Hey I am also facing this issue and app restarts every time, not even sometimes. Device: Moto g 7 play |
i am also facing same issue with xiaomi phone. image_picker: ^0.6.4 |
I also have the same problem. Detaching device when opening image picker. |
this issue is in debug mode only, if you build the app in release mode, it works perfectly fine. |
yes Everyone who is facing this issue please try the release version of the app,for me the debug verison works well too |
Hi, any solution to this problem yet? I get a lot of reports of problems selecting images from the camera. Also, Crashlytics can't log where the crash is coming from. |
Use a different package. :( It's the only solution.
|
I tried putting a |
Is this issue still valid with the latest image_picker: ^0.8.2 ?, I could not reproduce it on k20 Pro, Incase if anyone wants to try here is the sample code with the updated API. https://gist.github.com/maheshmnj/666de97c013a804b8b343966fca0941c (Note: No configuration is required for Android for image_picker ^0.8.1 and above, meaning you can just add the plugin and try the sample code ) flutter doctor -v
|
Crashes while taking picture using camera. Is there any other solution ? Shows - Lost connection to device. Using latest image_picker: ^0.8.2. Devices: |
Lost connection to device. |
maybe related #87896 |
Hello everyone! After countless fails with "lost connection with device" while trying to pick an image from gallery, I found a plugin which met my demands: "photo_manager" plugin, alone, or used also here: https://pub.dev/packages/wechat_assets_picker Although it does not directly load the gallery and you pick from it and it goes back to the app, in this case the plugin loads the images of your device as assets, and you can access any image from any folder, and you can choose how to display those images, like a grid view "emulating" your gallery. I hope it helps you as it helped me! :D |
Device: Xiaomi A2 lite (Android One device) Step to reproduce: Image picker pick multiple image then app crashed (losing connection with device) |
Using the image_picker with image_cropper sorted the issue for me. I can't really explain it, but it did sort it for me. |
@OlaleyeJumoke Can you try to explain? |
Can't find a way to fix this in my app. Will have to use the |
Still crashes and shows blank screen sometimes. Works fine on emulator though. |
almost 2 years and many updates later, and this is still broken on a physical android device. I'm over it |
This comment has been minimized.
This comment has been minimized.
@Abhijithsp we've had very similar reports. Our solution has been to bundle different camera modules into the app and let the user try different plugins via a settings screen. It's been needlessly troublesome - especially since the |
This is not something that can be fixed in the plugin; it is not technically a bug, although I understand the frustration with the effect it has on the experience. The reason that there aren't any logs or crash reports is that the app isn't crashing, it's being terminated by the OS to free memory, because while the image picker activity is active the Flutter application is technically a background app, and thus subject to collection by the OS when there is memory pressure.
The only way to avoid this would be to implement a custom, in-application image picker experience from scratch. That's out of scope of this plugin—but is something that interested members of the community could certainly build. (The reason this is specific to Android is that on iOS the system model is extremely different; instead of providing a standard set of activities for operations like these, the OS provides components that are displayed within the application, so the application that's doing the image selection is in the foreground the entire time. If at some point Android provides a similar component, Given that this is, within the constrains of the way Android activities work, not something we can change, I'm going to close this. #93807 tracks improving the README to make this more clear. |
@stuartmorgan - this is a most excellent insight! Thank you Do you have any articles we can read about how Android chooses which apps to terminate in the background? ie: does it select those using the most memory? If so, it may mean that we may have an undetected memory leak. |
Android documentation discusses it at a very high level, but there is (likely by design) not a clearly described set of rules; it's up to the OS to decide when to terminate processes, and which ones. Given that how recently used the process was is called out as one factor that's likely to be considered, it could very well be the case that on some devices the image picker is using so much memory that all other non-essential processes are killed. |
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 |
I am trying to use image_picker^0.6.1+11 to capture images from camera as the source it works fine for the first time but when I try to retake the image the app crashes with a log lost connection to the device without any exception or error.
UseCase: I want to capture three images from camera and view them in an imageview.
I have tested the app on the latest flutter master and stable channels but has same issue here's my
flutter doctor -v
outputSteps to Reproduce
pubspec.yaml
it crashes
Logs
The text was updated successfully, but these errors were encountered: