我在config.xml中声明了权限,但在phonegap构建编译后AndroidManifest.xml为空。它没有在编译日志中列出。我应该如何修改config.xml?
我的config.xml中有关权限声明的代码:
<platform name="android">
<preference name="android-minSdkVersion" value="19"/>
<preference name="android-targetSdkVersion" value="28" />
<config-file parent="/manifest" target="AndroidManifest.xml" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.INTERNET" />
</config-file>
<edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
<application android:usesCleartextTraffic="true"
android:networkSecurityConfig="xml/network_security_config.xml" />
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
</edit-config>
</platform>
您好,请检查我的代码步骤1将此代码放入AndroidManifest.xml
<application
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true">
第2步network_security_config.xml创建res \ xml \ network_security_config.xml
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">cart.demoproject.info</domain> //put your domain name
<domain includeSubdomains="true">82.90.247.111</domain>// put your domain ip address
</domain-config>
</network-security-config>