Android WebView 加载失败(net::ERR_CLEARTEXT_NOT_PERMITTED)
解锁正确姿势
首先保证App申明了网络权限
<uses-permission android:name="android.permission.INTERNET" />
解决办法(1):
在Application中打开一个开关
<manifest ...>
<application
...
android:usesCleartextTraffic="true"
...>
...
</application>
</manifest>
解决办法(2):<br />res 下新建 xml 目录,创建文件:network_security_config.xml ,内容如下:
<?xml version=”1.0” encoding=”utf-8”?>
在 AndroidManifest.xml 的 application 标签添加配置:
解决办法(3):【推荐】<br />服务器和本地应用都改用 https
解决办法(4):<br />targetSdkVersion 降级回到 27
<a name="1TRKs"></a>
### Uncaught TypeError: Cannot read property 'getItem' of null
WebSettings settings = mWebView.getSettings(); settings.setDomStorageEnabled(true);//开启DOM
<a name="b382e7c6"></a>
### gradle使用dokka插件出现Exception while loading package-list from ExternalDocumentationLinkImp
请求不到 package-list,翻墙即可解决<br />不翻墙的解决方案如下:
dokka { outputFormat = ‘javadoc’ outputDirectory = javadoc.destinationDir
configuration {
externalDocumentationLink {
noJdkLink = true
noStdlibLink = true
noAndroidSdkLink = true
url = new URL("https://developer.android.google.cn/reference/")
packageListUrl = new URL("https://developer.android.google.cn/reference/package-list")
}
}
}
[https://github.com/Kotlin/dokka/issues/213#](https://github.com/Kotlin/dokka/issues/213#)<br />[https://www.cnblogs.com/zhhiyp/p/9484544.html](https://www.cnblogs.com/zhhiyp/p/9484544.html)
<a name="Kv9SS"></a>
### More than one file was found with OS independent path 'lib/armeabi/xxxx.so'
so 重复
// 在build.gradle(Module: app)里面,加上一句: packagingOptions { exclude ‘lib/armeabi/xxx.so’ // 或者 pickFirst ‘lib/armeabi/xxx.so’ }
<a name="3b5dJ"></a>
### Go to the documentation to learn how to Fix dependency resolution errors.
依赖库版本冲突<br />解决方法 1:
subprojects { configurations.all { … resolutionStrategy.eachDependency { details -> if (details.requested.group == ‘androidx.annotation’) { details.useVersion “1.1.0” } … } } }
解决方法 2:
[https://www.jianshu.com/p/25286dd8bd09](https://www.jianshu.com/p/25286dd8bd09)
<a name="41sHy"></a>
### gradle使用dokka插件出现Exception while loading package-list from ExternalDocumentationLinkImp
请求不到 package-list,翻墙即可解决<br />不翻墙的解决方案如下:
dokka { outputFormat = ‘javadoc’ outputDirectory = javadoc.destinationDir
configuration {
externalDocumentationLink {
noJdkLink = true
noStdlibLink = true
noAndroidSdkLink = true
url = new URL("https://developer.android.google.cn/reference/")
packageListUrl = new URL("https://developer.android.google.cn/reference/package-list")
}
}
}
[https://github.com/Kotlin/dokka/issues/213#](https://github.com/Kotlin/dokka/issues/213#)<br />[https://www.cnblogs.com/zhhiyp/p/9484544.html](https://www.cnblogs.com/zhhiyp/p/9484544.html)
<a name="6ca21055"></a>
### A POM cannot have multiple artifacts with the same type and classifier
- What went wrong:
Execution failed for task ‘:emao-lib:lib-base:uploadToLocalSnapshot’.
Could not publish configuration ‘archives’ A POM cannot have multiple artifacts with the same type and classifier. Already have MavenArtifact lib-base:aar:aar:null, trying to add MavenArtifact lib-base:aar:aar:null. ```
原因:上传的 artifacts 中包含多个 aar
处理方案:请参考 https://www.yuque.com/ypwcode/alcnpk/maven-fa-bu-aar