Open ythy opened 5 days ago
后续,试图将 buildSrc
适用到包含proguard
项目中,失败。
因为关键性的systemProp.org.gradle.internal.http.connectionTimeout=1200
这个属性是 gradle 8.5.0
新增的。同时APG版本7.2的时候,会报错 Cannot use @TaskAction annotation on method IncrementalTask.
如果升级AGP到8+, 又报错API 'android.registerTransform' is removed with Android Gradle plugin 8.x
。
查阅proguard资料,有如下说明:
Since R8 is now the default Android shrinker, there is little need or demand for using ProGuard on Android apps. For this reason, we don't have any current plans for further support for AGP.
If there is a need or a use-case, one route for the community to take would be for AGP support to be implemented in a manner similar to the ProGuard Maven plugin: as a separate project that implements a ProGuard AGP plugin calling out to ProGuard.
R8 is compatible with ProGuard keep rules, so the manual and tools like the ProGuard Playground can be used with R8 configurations.
人家摆烂了。剧终,不适用了先
buildSrc
作为一个公共目录,按照教程只需要如此这般就能生效↓build.gradle.kts
\buildSrc\src\main\kotlin\com\xx\sss\gradle\Configuration.kt
然后
Configuration.compileSdk
一系列就能在app:build.gradle.kts
里用了。事实上呢,
buildSrc
会不断的触发下面类似的请求, 你的开发环境如果访问不到https://repo.gradle.org/gradle/list/libs-releases/
,那就完啦。官方issue里有人提过这个问题,貌似没有被采纳😓 https://github.com/gradle/gradle/pull/29798 https://github.com/gradle/gradle/pull/29782
折磨一周多,最终还是发现了解决方法:
gradle.properties
追加以下完结,❀撒花❀