怀柔 做网站的,上土巴兔装修土巴兔装修,中国网站建设第一品牌,新手学做网站必备软件文章目录 教材学习第一行代码 Android 第3版环境配置gradle配置下载包出现问题 教材学习 摘要#xff1a;选了几本教材《第一行代码 Android 第3版》#xff0c;记录一下跑案例遇到的问题#xff0c;和总结一些内容。 第一行代码 Android 第3版
环境配置 gradle配置
gradl… 文章目录 教材学习第一行代码 Android 第3版环境配置gradle配置下载包出现问题 教材学习 摘要选了几本教材《第一行代码 Android 第3版》记录一下跑案例遇到的问题和总结一些内容。 第一行代码 Android 第3版
环境配置 gradle配置
gradle的插件版本是3.4.0gradle的版本是5.1.1gradle的jdk版本是1.8 build.gradle配置之所以修改是因为有时候有些包下载不下来可以适当提高gradle版本如7.0下载这些包注意配置一下maven的url出现ssl报错记得 配置allowInsecureProtocol true不知道为什么之后下载完包后运行不了还是把gradle设置为5.1.1才能运行代码。
// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript {ext {agp_version1 3.4.0agp_version 3.5.2}ext.kotlin_version 1.3.50// ext.kotlin_version 1.4.3repositories {maven {allowInsecureProtocol trueurl http://maven.aliyun.com/nexus/content/repositories/jcenter}maven {allowInsecureProtocol trueurl https://maven.aliyun.com/repository/gradle-plugin}google()jcenter()}dependencies {classpath com.android.tools.build:gradle:$agp_version1classpath org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version// NOTE: Do not place your application dependencies here; they belong// in the individual module build.gradle files}
}allprojects {repositories {google()jcenter()}
}task clean(type: Delete) {delete rootProject.buildDir
}
下载包出现问题
可能是因为配置了android studio的代理我的是macos 路径在/Users/用户名/.gradle/gradle.propertieswin系统应该在c盘类似的地方。注释掉配置的代理的2行
## For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
#
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx1024m -XX:MaxPermSize256m
# org.gradle.jvmargs-Xmx2048m -XX:MaxPermSize512m -XX:HeapDumpOnOutOfMemoryError -Dfile.encodingUTF-8
#
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.paralleltrue
#Thu Oct 05 22:36:26 CST 2023
# systemProp.http.proxyHost
# systemProp.http.proxyPort