When building from the CLI, Cordova adds unnecessary permissions to androidmanifest.xml
•
Android
I used the CLI to build my Cordova application and added a media plug-in
'Cordova build' will automatically add android.permission.record_ Audio is added to my androidmanifest.xml, even if I don't have the permission
So how do I delete it? Every time I build a publication, permissions are added to APK
resolvent:
In the project, edit the file plugins / org.apache.cordova.media/plugin.xml, and you will see the Android specific configuration
<platform name="android">
<config-file target="res/xml/config.xml" parent="/*">
<feature name="Media" >
<param name="android-package" value="org.apache.cordova.media.AudioHandler"/>
</feature>
</config-file>
<config-file target="AndroidManifest.xml" parent="/*">
<uses-permission android:name="android.permission.RECORD_AUdio" />
<uses-permission android:name="android.permission.MODIFY_AUdio_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
</config-file>
...
Delete the line < uses permission Android: name = "Android. Permission. Record_audio" / > so that permissions will not be added each time you build
Since the permission has been added to androidmanifest.xml, you must delete it manually, and then it will not be returned at the next build
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码