b站视频讲解传送门
android_studio安装包:https://developer.android.google.cn/studio?hl=zh-cn
下载安装
开始创建hello-world
1.删除缓存 文件
下载gradle文件压缩:gradle-8.9用自己创建项目时自动生成的版本即可,不用和我一样
https://mirrors.cloud.tencent.com/gradle//gradle-8.9-all.zip
将gradle文件放置到gradle目录下的wrapper里面
阿里云仓库地址
书写gradle配置
#Thu Nov 14 10:38:33 CST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=gradle-8.9-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
pluginManagement {
repositories {
maven {url=uri("https://maven.aliyun.com/repository/google")}
maven {url=uri("https://maven.aliyun.com/repository/central")}
maven {url=uri("https://maven.aliyun.com/repository/gradle-plugin")}
google {
content {
includeGroupByRegex("com\\.android.*")
includeGroupByRegex("com\\.google.*")
includeGroupByRegex("androidx.*")
}
}
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
maven {url=uri("https://maven.aliyun.com/repository/google")}
maven {url=uri("https://maven.aliyun.com/repository/central")}
google()
mavenCentral()
}
}
rootProject.name = "My Application-hello-world"
include(":app")
创建成功