1

I declared the permission in config.xml but the AndroidManifest.xml is empty after phonegap build compiling. It is not be listed in the compiling log. How should I modify my config.xml?

The codes of my config.xml about permission declaring:

<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>
蔡永賢
  • 11
  • 1

1 Answers1

0

hello please check my code step 1 put this code in AndroidManifest.xml

<application
        android:networkSecurityConfig="@xml/network_security_config"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true">

step 2 network_security_config.xml
create 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>