2

Android Studio / Gradle 升级后的 flatDir 找不到/不生效问题

 3 years ago
source link: http://i.lckiss.com/?p=6965
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Android Studio / Gradle 升级后的 flatDir 找不到/不生效问题

2021-06-14

上周无意间升级了 AS 从 4.1 升级到 4.2,这周运行代码发现两个本地的 aar 包死活找不到。而在此之前是可以的。

我之前的配置是这样用的:

这是位于项目顶层的 gradle 配置文件,修正后为:

以下为推论:

以往的 gradle,会在根 gradle 配置文件中将相对路径转化为绝对路径后,再分发给各子 module,而新版中,先将相对路径下放到子 module ,再由子 module 的 gradle 脚本去解析为绝对路径,这就导致某些依赖于根目录的位置在子 module 中不再适用,也就是位置对不上,那么改用绝对路径即可。又或者,每个子 module 单独配置 repositories


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK