Anke
December 20, 2019, 12:53am
1
See here:
My Samsung S10+ updated last night from Android 9 to Android 10. Now I’m getting the following error when I try to use the camera app in Kodular: Error 201 The camera did not return an image Are there any other permissions that need to be granted...
Reading time: 1 mins 🕑
Likes: 14 ❤
https://groups.google.com/forum/#!searchin/mitappinventortest/camera$20android$2010|sort:date/mitappinventortest/tERag1ZlqZQ/WHWHSRkPCgAJ
2 Likes
How about the permission WRITE_MEDIA_STORAGE ?
Anke
December 20, 2019, 1:21pm
3
This is an old (outdated) permission regarding the external SD card.
There is no longer any reference to this:
https://developer.android.com/reference/android/Manifest.permission
opened 02:29PM - 08 Aug 16 UTC
closed 10:53PM - 20 Sep 16 UTC
enhancement
after upgrading to a SGS7 with Marshmallow (Android 6.0.1), I stumbled across a … problem of Syncthing not preceeding with its work (given, some sync jobs existed and were partly synced to some SD card folder already. Looking into the web interface revealed, that all missing items suffered from permission problems.
Rooting option wasn't the real McCoy either, since it behaved strangely (don't remember details, sorry). Searching the net up and down finally stumbled me across some thread, that work around that issue by adding
```
<item name="android.permission.WRITE_MEDIA_STORAGE" granted="true" flags="0" />
```
in the perms section of the affected package in /data/system/packages.xml.
Given, that this has to be repeated after any update, I kindly request this permission for the official release.
### Version Information
```
App Version: 0.14.3
Syncthing Version: 0.8.1
Android Version: Android 6.0.1
```
Anke
December 20, 2019, 1:32pm
4
Btw, no Camera issues with Thunkable X on Android 10.
Here are the Manifests (permissions) from AI2, Kodular and Thunkable :
Here is the logcat from an OnePlus 6 (API 29) on AI2 (nb181):
logcat_OP6_API29.txt (18.0 KB)
I think I’ve identified the problem. Please try the test server here . It has a new companion and build servers with a potential fix.
1 Like
Anke
December 20, 2019, 9:08pm
6
Yes, both work, Companion & APK.
(checked on an OnePlus 6, Android 10)
Anke
December 20, 2019, 9:28pm
7
So what was the problem if it isn’t too complex to explain?
Android Q is moving away from the idea of the external storage as a globally writable space. Apps that target SDK 29, like the Camera app bundled with it, will abide by this constraint. However, we were handing the Camera app a target file for the image that would violate this constraint. The file won't get created, so App Inventor thinks that nothing was returned (which I guess is true, but not for the reason it thinks). The change I implemented uses the FileProvider (added in Nougat, SDK 24) to get a content URI that the Camera can use to write the image back to the app.
Proposed change on GitHub if you're interested:
mit-cml:ucr
← ewpatton:hotfix/camera-error-android10
opened 08:18PM - 20 Dec 19 UTC
Since Android 10 will no longer allow for writing to arbitrary locations on the … SDK card, the Camera app fails to write back to the file URI we provide it. This change makes it so that starting on Nougat and higher we hand a file provider URI back that will allow the camera to write the file back to a location controlled by the Companion / compiled apps.
NB: I've only tested this with emulators running SDK 29 and SDK 7 so far.
Change-Id: Ic6ce87045adcda73e657f60f0dcbac71cf13b8e9
2 Likes
Anke
December 20, 2019, 9:46pm
9
Of course, thanks.
I posted this link in the Kodular forum.
1 Like
Would be good to make it public
1 Like
For anyone experiencing this problem, the potential fix is now available to test on ai2-test.appinventor.mit.edu:
It is now running the latest version of our master and “ucr” branches along with code from three pull requests that haven’t been merged.
An important (and still being tested) change is the addition of a new “dictionary” block type. Check it out!
This is a Components release, so a new Companion is needed (version 2.56t1u). More information as well as the feedback document is at:
http://appinv.us/ai2testfeedback
1 Like