Android(安卓)Studio的几个Error与解决方案:“NDK not configured”;“Received close_notify during handshake”
16lz
2021-01-25
Android Studio的几个Error与解决方案
- NDK not configured. Download it with SDK manager.
- 问题
- 解决问题
- Received close_notify during handshake.
- 问题
- 解决问题
- 参考
NDK not configured. Download it with SDK manager.
问题
新安装的Android Studio报出以下错误:
其实,已经安装了NDK。但我还是点击Update试了试。然后就遇到了另一个问题:==Could not find method ndkVersion() for arguments on object of type com.android.build.==如下图:
解决问题
通过点击提示Open File发现文件的android标签的最下面有这么一行:
ndkVersion '21.2.6472646'
这行就是问题所在了,但去掉后还会出现最开始的NSK not configured的错误,套娃出现。这是因为项目中没有配置NDK的路径,编译时找不到了,所以打开local.properties文件,发现果然没有ndk的配置,加上本机的NDK路径:
ndk.dir=D\:\\AndroidSDK\\ndk\\16.1.4479499sdk.dir=D\:\\AndroidSDK
再次编译,SUCCESSFUL!
Received close_notify during handshake.
问题
Android Studio报出以下错误:Received close_notify during handshake.
问题存在原因:这是Android编译错误,jcenter里面的东西下载不了引起的。
解决问题
在项目的build.gradle文件中将jcenter()换成阿里的源,具体示例代码如下。
//jcenter()maven{ url'http://maven.aliyun.com/nexus/content/groups/public/' }maven{ url'http://maven.aliyun.com/nexus/content/repositories/jcenter'}
修改之后再重新Sync Project即可。
整体代码如下。
buildscript { repositories { google() //jcenter() maven{ url'http://maven.aliyun.com/nexus/content/groups/public/' } maven{ url'http://maven.aliyun.com/nexus/content/repositories/jcenter'} } dependencies { classpath 'com.android.tools.build:gradle:4.0.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }}allprojects { repositories { google() //jcenter() maven{ url'http://maven.aliyun.com/nexus/content/groups/public/' } maven{ url'http://maven.aliyun.com/nexus/content/repositories/jcenter'} }}task clean(type: Delete) { delete rootProject.buildDir}
参考
- https://blog.csdn.net/u012558210/article/details/106427634/
- https://blog.csdn.net/lxy1740/article/details/104606385/
- https://blog.csdn.net/qq_33618456/article/details/75808153
更多相关文章
- 一款常用的 Squid 日志分析工具
- GitHub 标星 8K+!一款开源替代 ls 的工具你值得拥有!
- RHEL 6 下 DHCP+TFTP+FTP+PXE+Kickstart 实现无人值守安装
- Linux 环境下实战 Rsync 备份工具及配置 rsync+inotify 实时同步
- android AlertDialog或toast显示错误 Unable to add window toke
- Android(安卓)出现 avc: denied { execmod }如何处理?
- armeabi和armeabi-v7a
- 使用SVN管理Android工程
- 使用HTTPclient访问豆瓣API问题