Hi Felgo
After last upgrade to Qt 5.13.2 I have a problem with nativeUtils and camera on Android. It was working with Qt 5.12 and now when I use displayCameraPicker I can see this error
W NativeUtils: displayCameraPicker() requires to add a <provider> tag in AndroidManifest since Android 7.0.
Thing is I have provider tag inside <application> and file_paths
<!-- file provider needed for letting external apps (like contacts) read from a file of the app -->
<provider android:name="android.support.v4.content.FileProvider" android:authorities="${applicationId}.fileprovider" android:exported="false" android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths"/>
</provider>
<?xml version="1.0" encoding="utf-8"?>
<paths>
<!-- the FileProvider allows other apps to access files of this app
this maps a file URI to a content URI:
file://<path>/<file>
mapped to:
content://<package-name>.fileprovider/<path-name>/<file>
only the content: URI can be used by external apps like the camera (when targetSdkVersion >= 24)
there are different types of paths that can be mapped:
- nativeUtils.displayCameraPicker() stores the taken picture to the external Pictures directory
- for this, the first entry is necessary.
- add the paths you want to use with nativeUtils.openUrl() below:
- <files-path ...> for FileUtils.DesktopLocation and others
- <cache-path ...> for FileUtils.CacheLocation and others
- <external-path ...> for most other FileUtils locations
- the others are only necessary when using a custom URL
-->
<!-- the path for nativeUtils.displayCameraPicker() -->
<external-files-path name="images" path="Pictures"/>
<!-- app internal cache used with nativeUtils.storeContacts() and FileUtils.CacheLocation: /data/data/<package-name>/cache/<file> -->
<cache-path name="cache" path="."/>
<!-- app internal files, used with FileUtils.DesktopLocation and others: /data/data/<package-name>/files/<file> -->
<!--<files-path name="files" path="."/>-->
<!-- external files belonging to the app, used with most FileUtils locations: /sdcard/Android/data/<package-name>/files/<file> -->
<!--<external-files-path name="external-files" path="."/>-->
<!-- external cache files belonging to the app: sdcard/Android/data/<package-name>/cache/<file> -->
<!--<external-cache-path name="external-cache" path="."/>-->
<!-- global external files: /sdcard/Android/<file> -->
<!--<external-path name="external" path="."/>-->
</paths>
Can this have something to do with my package name and activity name being custom to work with background service ?
<manifest package="mycompany.myapp" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.30" android:versionCode="29" android:installLocation="auto">
<application android:hardwareAccelerated="true" android:name="net.vplay.helper.VPlayApplication" android:label="myapp" android:icon="@drawable/icon" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="mycompany.myapp.GpsActivity" android:label="myapp" android:screenOrientation="portrait" android:launchMode="singleTop">
displayImagePicker works fine.
Best,
Marek