net__ERR_CLEARTEXT_NOT_PERMITTED

简介: net__ERR_CLEARTEXT_NOT_PERMITTED

net::ERR_CLEARTEXT_NOT_PERMITTEDcordovaInAppBrowserAndroid

使用 Vue 开发的 Android APP, 然后使用 InAppBrowser 打开一个外部链接, 报错如下

image.png

调整权限配置, 在/android-app/platforms/android/CordovaLib/AndroidManifest.xml 添加如下权限 <uses-permission android:name="android.permission.INTERNET"/><application android:usesCleartextTraffic="true"></application>

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="org.apache.cordova" android:versionName="1.0" android:versionCode="1">
    <uses-permission android:name="android.permission.RECEIVE_SMS"/>
    <uses-permission android:name="android.permission.RECORD_AUDIO"/>
    <uses-permission android:name="android.permission.CAMERA"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.BROADCAST_SMS"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.READ_SMS"/>
    <application android:usesCleartextTraffic="true">
    </application>
</manifest>

备注

通过 Cordova 打包的 APP 可以访问页面,但无法访问接口时,添加如上配置解决问题

目录
相关文章
|
1月前
|
安全 网络安全 数据安全/隐私保护
【Azure Developer】System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel.
System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel.
成功解决:Failed to load resource: net::ERR_FILE_NOT_FOUND
这篇文章提供了解决"Failed to load resource: net::ERR_FILE_NOT_FOUND"错误的步骤,通过修改配置文件中的资源路径设置为相对路径"./"来成功运行打包后的项目。
成功解决:Failed to load resource: net::ERR_FILE_NOT_FOUND
|
3月前
|
Android开发
SocketException: Failed to create server socket(OS Error: Permission denied, errno = 13)
SocketException: Failed to create server socket(OS Error: Permission denied, errno = 13)
55 3
【已解决】kex_exchange_identification: Connection closed by remote host fatal: Could not read from
【已解决】kex_exchange_identification: Connection closed by remote host fatal: Could not read from
|
6月前
|
应用服务中间件 nginx Windows
[emerg] 15060#200: bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket ......
[emerg] 15060#200: bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket ......
192 0
|
6月前
|
Kubernetes 容器
k8s-unable to connect to the server:x509:certificates signed by unknown authority......
k8s-unable to connect to the server:x509:certificates signed by unknown authority......
296 0
|
Web App开发 缓存 JavaScript
问题记录:net::ERR_CERT_DATE_INVALID
问题记录:net::ERR_CERT_DATE_INVALID
561 0
|
Java 关系型数据库 MySQL
14. 成功解决:ERROR:ssl_client_socket_impl.cc(992) handshake failed; returned -1, SSL error code 1, net_error -103
今天使用 Python 的 selenium 时,一直在报如下错误:[30616:22540:0328/093748.004:ERROR:ssl_client_socket_impl.cc(992)] handshake failed; returned -1, SSL error code 1, net_error -100
4183 0
|
jenkins 持续交付 网络安全
2. 成功解决 BUG:Exception when publishing, ...[Failed to connect and initialize SSH connection...
SSH: Connecting from host [WIN-...] SSH: Connecting with configuration [192.168....] ... ERROR: Exception when publishing, exception message [Failed to connect and initialize SSH connection. Message: [Failed to connect session for config [192.168....]. Message [java.net.ConnectException: Connection
1577 0