cordova-plugin-scanbot-sdk not working in android 31+ - android

I can't get the cordova-plugin-scanbot-sdk plugin to work with release builds (it works if I build in debug mode), all my plugins are with the latest version, my cordova and cordova android are also up to date.
I can use the camera and filesystem in the app without any problems, but if I try to use the scanbot the app stays on this screen but doesn't ask the user for permission to use the camera. I also tried to add the camera permission manually in config.xml using:
<edit-config file="AndroidManifest.xml" mode="merge" target="/manifest">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
</edit-config>
but it didn't work.
Here is a screenshot of what I see when I try to open the plugin.

Related

ExternalStorage does not create files in release version

The problem is that when developing in the debug version, everything is in order, I can easily write files to memory. But I'm making a release version for Google Play, and the logs show that it simply cannot create a folder / file.
I dug up all the documentation, all the permissions are as written, but apparently I still missed something. Tell me, help
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="30" />
<uses-permission
android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
android:minSdkVersion="30"
tools:ignore="ScopedStorage" />
android:requestLegacyExternalStorage="true"

Ionic - Access denied finding property "vendor.camera.aux.packagelist"

Tring to use opentok in an ionic app and i get this error in log when I try to publish a video
Access denied finding property "vendor.camera.aux.packagelist" Access
denied finding property "vendor.camera.aux.packagelist2"
i hev tried to add these permissions in the app manifist
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
Any help is appreciated. Thanks
First I'd like to declare that i'm not ionic developer but from my experience as android developer you can try to add camera permission or prevent the app from using the camera
see this to know how to add permissions and add this permission
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
else if you want to prevent app from using camera add this
android:hardwareAccelerated="false"
note in ionice 4
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge">
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
</edit-config>
one reason was not having permission to record audio as well

WebRTC in Cordova app: WebContentsDelegate::CheckMediaAccessPermission: Not supported

I was using WebRTC in Cordova app with Cordova 5.2.0 and Cordova Android 4.1 without problems. Since I upgraded to Cordova 6.3.1 and Cordova Android 6.1.1, I get the following error message on the console:
chromium: [ERROR:web_contents_delegate.cc(199)] WebContentsDelegate::CheckMediaAccessPermission: Not supported.
The permissions in the Android manifest include the following:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-feature android:name="android.hardware.camera" android:required="true" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="true" />
so I would say everything should be just fine. But still I am getting this error. I also noticed that once I actually try to start streaming my local video, I also get these error messages:
[ERROR:voe_audio_processing_impl.cc(685)] SetTypingDetectionStatus: not supported
[WARNING:webrtcvoiceengine.cc(882)] SetTypingDetectionStatus(0) failed, err=8003
[ERROR:audio_manager_android.cc(264)] Unable to select audio device!
[ERROR:web_contents_delegate.cc(199)] WebContentsDelegate::CheckMediaAccessPermission: Not supported.
and this info:
[INFO:CONSOLE(0)] "Refused to load the image 'android-webview-video-poster:default_video_poster/8430923907866893907' because it violates the following Content Security Policy directive: "default-src * gap: data: blob: 'unsafe-inline' 'unsafe-eval' ws: wss:". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.
Not sure if the CSP is related to the problem, though. I was trying to fix this, but Meteor (which I am using as a wrapper) won't let me do so.
To answer my own question: Since Android Marshmallow, permissions have to be set programmatically. The settings defined in the manifest are ignored.
I could solve my problem using this Cordova plugin:
https://github.com/NeoLSN/cordova-plugin-android-permissions

Add android.permission.CAMERA with Cordova

I am using the latest version of Cordova (6.3.1) and I want the following permission to appear in the AndroidManifest.xml :
<uses-permission android:name="android.permission.CAMERA" />
Adding this line by hand does not work because the XML is regenerated each time I run the command cordova run android
I have added the cordova-plugin-camera to my project with
cordova plugin add cordova-plugin-camera
This plugin does NOT add the CAMERA permission in the AndroidManifest.xml
I don't know if this is normal
How can I add this permission to my project ?
Edit :
Usually, Cordova plugins are in charge of adding required permissions into the manifest. The camera plugin does not add this specific permission, I wonder :
if the plugin should add this permission (bug ? I have opened an issue on their Jira tracker)
if I can add this permission by hand myself, maybe in the Cordova's config.xml
I don't think the Camera plugin ever added this permission to AndroidManifest.xml. Looking through the Github repo, WRITE_EXTERNAL_STORAGE was added in June 2013 (CB-3654), but I don't see anything for the camera itself. Not sure why that would be, but you can either add the permission to AndroidManifest.xml yourself or add a config-file directive in your project's config.xml file, for example:
<config-file target="AndroidManifest.xml" parent="/*" mode="merge">
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
</config-file>
Are you building native or hybrid app?
For native you can refer this website:
https://developer.android.com/reference/android/hardware/Camera.html

android app force closing in release mode

I have finished developing an Android app. I'm using android studio. Everything is working fine when I normally run the app in debug mode on my device. Not even an exception.
But when I followed Google's guidelines on creating the signed release version of my app and installed it in my device, the app is force closing as soon as I launch it.
I just can't figure out a way to locate what the problem is. I created the release version using the "Generate signed apk" option in the Android studio IDE. Then I copied it in my device and installed the app. And then when I run, it just stops working immediately.
I don't know what more info should I give here because I just can't infer the cause of this issue.
Please help. What can be the possible reasons behind such problems.? And how can I find them?
EDIT:
Everytime I unlock the device, it is displaying the dialog "MyApp has stopped working". There's nothing in the logcat. I have no idea why this might be happening. My app uses these permissions:
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission
android:name="com.mypackagename.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.mypackagename.permission.C2D_MESSAGE" />
I solved the issue on my own.
First of all, you can use a tool named "monitor", present in the android sdk tools to debug your release version. This tool shows everything that happens in your device.
I used the tool and found out that the problem occurred because I had enabled proguard in my app and forgot to add rules for third party libraries used in my app.
So all those who might be facing this problem, check your proguard file and make sure you've added the required rules for all third party libraries as well.

Categories

Resources