当前位置: 首页 > news >正文

安卓教材学习

文章目录

  • 教材学习
    • 第一行代码 Android 第3版
      • 环境配置
      • gradle配置
      • 下载包出现问题

教材学习

摘要:选了几本教材《第一行代码 Android 第3版》,记录一下跑案例遇到的问题,和总结一些内容。

第一行代码 Android 第3版

环境配置

在这里插入图片描述

gradle配置

  • gradle的插件版本是3.4.0
  • gradle的版本是5.1.1
  • gradle的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.0'agp_version = '3.5.2'}ext.kotlin_version = '1.3.50'//    ext.kotlin_version = '1.4.3'repositories {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_version1"classpath "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.properties,win系统应该在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:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-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.parallel=true
#Thu Oct 05 22:36:26 CST 2023
# systemProp.http.proxyHost=
# systemProp.http.proxyPort=
http://www.lryc.cn/news/183175.html

相关文章:

  • C++设计模式-生成器(Builder)
  • CTFHUB - SSRF
  • 边缘计算网关
  • 1800_vim的宏录制功能尝试
  • Ultra-Fast-Lane-Detection-v2 {后处理优化}//参考
  • 【面试题精讲】Java静态方法和实例方法有何不同?
  • 【数据结构】布隆过滤器
  • linux基础4---内存
  • 图论---拓扑排序
  • java Spring Boot 将日志写入文件中记录
  • Android 开发错误集合
  • VSCode个人设置习惯
  • 代码随想录训练营二刷第四十七天 | 70. 爬楼梯 (进阶) 322. 零钱兑换 279.完全平方数
  • beego-简单项目写法--后续放到git上
  • 【算法|动态规划No.9】leetcodeLCR 091. 粉刷房子
  • 基于SpringBoot的图书进销存管理系统
  • 回归预测 | MATLAB实现PSO-SVR粒子群优化支持向量机回归多输入单输出预测
  • vue3使用v-model控制子组件进行双向数据绑定
  • .netCore .net5,6,7 存日志文件
  • 【数据结构---排序】很详细的哦
  • GitHub爬虫项目详解
  • 辅助驾驶功能开发-功能对标篇(7)-NOA领航辅助系统-上汽荣威
  • 第0次 序言
  • ESP32设备驱动-OLED显示单个或多个DS18B20传感器数据
  • MongoDB快速上手
  • maven 初学
  • 解决WPF+Avalonia在openKylin系统下默认字体问题
  • 智能合约漏洞,Dyna 事件分析
  • Elasticsearch基础篇(四):Elasticsearch7.x的官方文档学习(Set up Elasticsearch)
  • 二叉树的遍历方式和代码