Android-SmartWebView
Android-SmartWebView copied to clipboard
Image from camera cannot be uploaded - Possible fix
Describe the bug When i try to choose a picture in a chat webpage inside webview, it works, but if i want to use the camera to take a picture and upload it, it does not work.
Expected behavior If I select the camere instead of the filer, the camera should start, and a image can be taken, confirmed and then it should be uploaded.
Possible solution In my attached project sources the camera upload is working as well with API 29 and 30. Hopefully you can use it to solve the problem.
Device:
- Device name/variant: Huawei P30 Pro (VOG-L29)
- Build 64Bit
- Android Version 10.1 (API 30) and other test device is API 29
Additional context
Good day. When I went to targetSdkVersion 29 loading images from the camera stopped working. SOLVES it by adding the following in AndroidManifest.xml, inside the tag <Application ... ... android: requestLegacyExternalStorage = "true" tools: targetApi = "q">
加上后 android: requestLegacyExternalStorage = "true" tools: targetApi = "q"> 也未起作用 依然不能使用相机
It's actually causing issue from device to device, more than what the SDK is, that's why this certain issue is very difficult to tackle.
Dear mgks
I have the same problem. It is expected to occur due to the lack of WRITE_EXTERNAL_STORAGE permission as android OS 11 (API30) is updated.
Hope for help on how to fix the program
Note https://developer.android.com/about/versions/11/privacy/storage#permissions