网站欢迎界面设计,前端和后端哪个前景好,国内便宜机票网站建设,中国网络经纪人Android Studio运行kotlin项目#xff0c;一直Read timed out
下载别人的Kotlin项目#xff0c;导入as后#xff0c;运行app一直失败#xff0c;提示Read timed out#xff0c;有2种解决办法
第一种方式#xff1a;gradle.properties
修改kotlin项目种的gradle.proper…Android Studio运行kotlin项目一直Read timed out
下载别人的Kotlin项目导入as后运行app一直失败提示Read timed out有2种解决办法
第一种方式gradle.properties
修改kotlin项目种的gradle.properties文件
systemProp.http.keepAlivetrue
systemProp.http.keepAliveDuration600000第二种方式使用aliyun mavengradle7.0
修改settings.gradle文件
pluginManagement {repositories {gradlePluginPortal()google()mavenCentral()}
}
dependencyResolutionManagement {repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)repositories {maven {allowInsecureProtocol trueurl http://maven.aliyun.com/nexus/content/groups/public/}maven {allowInsecureProtocol trueurl http://maven.aliyun.com/nexus/content/repositories/jcenter}maven {allowInsecureProtocol trueurl http://maven.aliyun.com/nexus/content/repositories/google}maven {allowInsecureProtocol trueurl http://maven.aliyun.com/nexus/content/repositories/gradle-plugin}google()mavenCentral()maven { url https://jitpack.io }}
}
rootProject.name Shlla
include :app修改项目目录中的build.gradle文件
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {repositories {maven {allowInsecureProtocol trueurl http://maven.aliyun.com/nexus/content/groups/public/}google()mavenCentral()}dependencies {// 这里指定的是grade的版本与你自己grade版本对上就可以了// 太无语了其实咱们就根据下面plugins中的版本一样 就可以了// 不用跟自己的grade保持一致要低一点也没关系反正我是比自己的grade低下面有图咱们可以改成跟自己的grade一致试试看classpath com.android.tools.build:gradle:7.3.1// NOTE: Do not place your application dependencies here; they belong// in the individual module build.gradle files}
}
plugins {id com.android.application version 7.3.1 apply falseid com.android.library version 7.3.1 apply falseid org.jetbrains.kotlin.android version 1.7.20 apply false
}
task clean(type: Delete) {delete rootProject.buildDir
}依赖还是在app目录下的build.gradle中增加与修改。
参考
2022 最新 Android studio添加阿里云Aliyun Maven仓库
在 build.gradle.kts 添加 maven 仓库
Android Studio : Read timed out和connect timed out的解决方法