You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Android Studio Ladybug | 2024.2.1 Canary 8
Build #AI-242.20224.300.2421.12279409, built on August 27, 2024
Runtime version: 21.0.3+-12099254-b509.4 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.awt.windows.WToolkit
Windows 10.0
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 2048M
When your dependency is something other than a local library or file tree, Gradle looks for the files in whichever online repositories are specified in the dependencyResolutionManagement { repositories {...} } block of your settings.gradle file. The order in which you list each repository determines the order in which Gradle searches the repositories for each project dependency. For example, if a dependency is available from both repository A and B, and you list A first, Gradle downloads the dependency from repository A.
By default, new Android Studio projects specify Google's Maven repository, and the Maven central repository as repository locations in the project's settings.gradle file, as shown below:
Studio 版本
先升级了IDE,版本信息如下
Gradle 版本
其实试了好几个版本,最终用的是7.5. 这里的url可以直接上镜像。
这里有一个坑 之前用的URL都是
bin
结尾的,下载没问题编译报错!改成了all
正常。配置如下:几个概念
plugin设置方法
整体结构
repositories官方说明
When your dependency is something other than a local library or file tree, Gradle looks for the files in whichever online repositories are specified in the
dependencyResolutionManagement { repositories {...} }
block of your settings.gradle file. The order in which you list each repository determines the order in which Gradle searches the repositories for each project dependency. For example, if a dependency is available from both repository A and B, and you list A first, Gradle downloads the dependency from repository A.By default, new Android Studio projects specify Google's Maven repository, and the Maven central repository as repository locations in the project's settings.gradle file, as shown below:
正片开始
settings.gradle.kts 职责加强
pluginManagement
设置插件相关的资源路径。这里的resolutionStrategy
因为有的插件格式不标准,需要重新定义一下名字。dependencyResolutionManagement
设置依赖相关的资源路径, 这里设置过的话,就不能在build.gradle.kts
里设置了Project : build.gradle.kts
这里去掉了以前的 buildScript classpath相关的写法,只保留了
plugins
。并且在
gradle\libs.versions.toml
里做常量管理app: build.gradle.kts
buildSrc
里写,但是网络问题,依赖下载不下来,先写在这里。The text was updated successfully, but these errors were encountered: