英文:
cordova-plugin-scanbot-sdk not working in android 31+
问题
无法在发布版本中使cordova-plugin-scanbot-sdk插件工作(在调试模式下构建时可以工作),我的所有插件都是最新版本,我的Cordova和Cordova Android也是最新的。
我可以在应用程序中使用相机和文件系统而没有任何问题,但如果我尝试使用Scanbot,应用程序会停留在这个屏幕上,但不会要求用户授予使用相机的权限。我还尝试手动在config.xml中添加相机权限:
<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>
但这并没有起作用。
英文:
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.
答案1
得分: 1
请按照以下方式更改您的配置:
<platform name="android">
<config-file target="app/src/main/AndroidManifest.xml" parent="/manifest">
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
</config-file>
</platform>
另外,请使用最新的Cordova版本为app/src/main/AndroidManifest.xml
指定相对路径。
在修改config.xml后,请按照以下步骤进行操作:
cordova platform rm android
cordova platform add android
英文:
Please change your configuration as below
<platform name="android">
<config-file target="app/src/main/AndroidManifest.xml" parent="/manifest">
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
</config-file>
</platform>
also, specify the relative path for app/src/main/AndroidManifest.xml
with the latest Cordova version.
and follow the below steps after you modify the config.xml
cordova platform rm android
cordova platform add android
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论