qt for android 报错解决记录
问题描述1
编译项目时显示网络超时连接
Exception in thread “main” java.net.ConnectException: Connection timed out: connect
这里编译报错的原因是gradle文件下载不成功,第一次编译安卓都得去下载,时间比较长。可以自己去下载,放到一下路径即可解决问题。
也可以重新指定本地路径
问题描述2
编译项目时报:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android-build'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.41.
————————————————
解决方法是加上以下链接
原build.grade部分代码如下:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
}
}
repositories {
google()
jcenter()
}
修改后
buildscript {
repositories {
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/repository/public' }
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
}
}
repositories {
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/repository/public' }
google()
jcenter()
}
终究还是网络原因导致资源下载失败,重新配置去阿里云的资源库下载