Comments (25)
from rocketx.
AGP:4.1.3, Gradle:6.9.1
from rocketx.
@yygutn 1、确认一下 根目录/.gradle/.rockect/ 文件夹下面 查看 aar 缓存是否生成
2、开启log ,看下app module 在编译时 真实依赖了都有哪些 dependency(方便的话贴出 log )
RocketX {
openLog = true
}
from rocketx.
- 缓存的aar看到是有的
- 2次log如下
第一次无缓存构建:
RocketXPlugin : module name==>:app; countTime=120977685412869
RocketXPlugin : module name==>:xxx; countTime=120855765741363
RocketXPlugin : module name==>:xxx; countTime=93230015559288
RocketXPlugin : module name==>:xxx; countTime=47267792949056
RocketXPlugin : module name==>:xxx; countTime=29509068282074
RocketXPlugin : module name==>:xxx; countTime=115951466596807
RocketXPlugin : module name==>:xxx; countTime=206120250491680
RocketXPlugin : module name==>:xxx; countTime=58726335255833
RocketXPlugin : module name==>:xxx; countTime=128225437637407
RocketXPlugin : count time====>>>> 280
RocketXPlugin : ======project name: app==========
RocketXPlugin : =====Config name:implementation =====
RocketXPlugin : dependency:215916012
RocketXPlugin : dependency:DefaultExternalModuleDependency{group='xxx', name='xxx', version='xxx', configuration='default'}
RocketXPlugin : dependency:406621706
RocketXPlugin : dependency:DefaultProjectDependency{dependencyProject='project ':xxx'', configuration='default'}
RocketXPlugin : dependency:207109915
RocketXPlugin : dependency:DefaultProjectDependency{dependencyProject='project ':xxx'', configuration='default'}
RocketXPlugin : dependency:725216927
RocketXPlugin : dependency:DefaultProjectDependency{dependencyProject='project ':xxx'', configuration='default'}
RocketXPlugin : dependency:1995587624
RocketXPlugin : dependency:DefaultProjectDependency{dependencyProject='project ':xxx'', configuration='default'}
RocketXPlugin : dependency:308012433
RocketXPlugin : dependency:DefaultProjectDependency{dependencyProject='project ':xxx'', configuration='default'}
RocketXPlugin : dependency:1200697010
RocketXPlugin : dependency:DefaultProjectDependency{dependencyProject='project ':xxx'', configuration='default'}
RocketXPlugin : dependency:849807987
RocketXPlugin : dependency:DefaultExternalModuleDependency{group='xxx', name='xxx', version='xxx', configuration='default'}
RocketXPlugin : dependency:-1663809308
RocketXPlugin : dependency:DefaultExternalModuleDependency{group='xxx', name='xxx', version='xxx', configuration='default'}
RocketXPlugin : ======project name: ========== end
RocketXPlugin : ======project name: xxx==========
RocketXPlugin : ======project name: ========== end
RocketXPlugin : ======project name: xxx==========
RocketXPlugin : ======project name: ========== end
RocketXPlugin : ======project name: xxx==========
RocketXPlugin : ======project name: ========== end
RocketXPlugin : ======project name: xxx==========
RocketXPlugin : ======project name: ========== end
RocketXPlugin : ======project name: xxx==========
RocketXPlugin : ======project name: ========== end
RocketXPlugin : ======project name: xxx==========
RocketXPlugin : ======project name: ========== end
RocketXPlugin : ======project name: xxx==========
RocketXPlugin : ======project name: ========== end
RocketXPlugin : ======project name: xxx==========
RocketXPlugin : ======project name: ========== end
第二次构建:无任何改动
RocketXPlugin : module name==>:app; countTime=120977685412869
RocketXPlugin : module name==>:xxx; countTime=120855765741363
RocketXPlugin : module name==>:xxx; countTime=93230015559288
RocketXPlugin : module name==>:xxx; countTime=47267792949056
RocketXPlugin : module name==>:xxx; countTime=29509068282074
RocketXPlugin : module name==>:xxx; countTime=115951466596807
RocketXPlugin : module name==>:xxx; countTime=206120250491680
RocketXPlugin : module name==>:xxx; countTime=58726335255833
RocketXPlugin : module name==>:xxx; countTime=128225437637407
RocketXPlugin : hasChangeMap {}
RocketXPlugin : count time====>>>> 324
RocketXPlugin : ======project name: app==========
RocketXPlugin : =====Config name:implementation =====
RocketXPlugin : dependency:215916012
RocketXPlugin : dependency:DefaultExternalModuleDependency{group='xxx', name='xxx', version='xxx', configuration='default'}
RocketXPlugin : dependency:849807987
RocketXPlugin : dependency:DefaultExternalModuleDependency{group='xxx', name='xxx', version='xxx', configuration='default'}
RocketXPlugin : dependency:-1663809308
RocketXPlugin : dependency:DefaultExternalModuleDependency{group='xxx', name='xxx', version='xxx', configuration='default'}
RocketXPlugin : ======project name: ========== end
RocketXPlugin : ======project name: xxx==========
RocketXPlugin : ======project name: ========== end
RocketXPlugin : ======project name: xxx==========
RocketXPlugin : ======project name: ========== end
RocketXPlugin : ======project name: xxx==========
RocketXPlugin : ======project name: ========== end
RocketXPlugin : ======project name: xxx==========
RocketXPlugin : ======project name: ========== end
RocketXPlugin : ======project name: xxx==========
RocketXPlugin : ======project name: ========== end
RocketXPlugin : ======project name: xxx==========
RocketXPlugin : ======project name: ========== end
RocketXPlugin : ======project name: xxx==========
RocketXPlugin : ======project name: ========== end
RocketXPlugin : ======project name: xxx==========
RocketXPlugin : ======project name: ========== end
from rocketx.
@yygutn 第二次怎么剩下这么点:
RocketXPlugin : ======project name: app==========
RocketXPlugin : =====Config name:implementation =====
RocketXPlugin : dependency:215916012
RocketXPlugin : dependency:DefaultExternalModuleDependency{group='xxx', name='xxx', version='xxx', configuration='default'}
RocketXPlugin : dependency:849807987
RocketXPlugin : dependency:DefaultExternalModuleDependency{group='xxx', name='xxx', version='xxx', configuration='default'}
RocketXPlugin : dependency:-1663809308
RocketXPlugin : dependency:DefaultExternalModuleDependency{group='xxx', name='xxx', version='xxx', configuration='default'}
RocketXPlugin : ======project name: ========== end
少了的module依赖是哪些?本来是通过 implemntation 依赖进来的吗?
from rocketx.
@trycatchx 少了的是 implementation project 依赖进来的业务module
from rocketx.
@yygutn 子 module 是否有 使用 flavorImplement/ debugImplement 这样的依赖方式?
from rocketx.
@trycatchx 有一个debug模块可能用了debugImplement,不过不太确定,我印象中是debug的build type去Implement的一些测试模块
from rocketx.
debugImplement 是支持的。 不过 app module 和 其他的业务 module 的 buildType 需要一致
from rocketx.
明天再去瞅瞅怎么写的……build type都是一样的,没有变种
from rocketx.
@yygutn 项目在你那边,你可以先自行查看 DependenciesHelper.getFirstLevelParentDependencies 这个方法加入打印,看下 依赖是否有断掉?这个是每一个 module 变成 aar 之后 会把 aar 依赖交到 parent 。最后通过 DependenciesHelper.addAarDependencyToProject 这个方法加入(也可以加入打印)。基本可以看到流程在哪里断的。
from rocketx.
@yygutn 你可以帮忙分析一下,找到问题反馈 或者你 提PR 均可
from rocketx.
@trycatchx 行,明天看看
from rocketx.
@yygutn 顺便确定一下 。 根目录/.gradle/.rockect/ 文件夹下面 你项目所有的 module 对应的 aar (9 个?) 全部生成了没。在 addAarDependencyToProject 这个方法是否执行,并把 aar 依赖添加进去。
上面确定一下,基本就知道原因了。
from rocketx.
@trycatchx 加了些日志,addAarDependencyToProject 没有执行,getFirstLevelParentDependencies对应每一个project的configList是空的
getFirstLevelParentDependencies ----- start, project=xxx
getFirstLevelParentDependencies: project:app, add config:configuration ':app:implementation'
getFirstLevelParentDependencies: project:app, configList:[configuration ':app:implementation']
getFirstLevelParentDependencies: project:xxx, configList:null
getFirstLevelParentDependencies: project:yyy, configList:null
getFirstLevelParentDependencies: project:yyy, configList:null
getFirstLevelParentDependencies: project:yyy, configList:null
getFirstLevelParentDependencies: project:yyy, configList:null
getFirstLevelParentDependencies: project:yyy, configList:null
getFirstLevelParentDependencies: project:yyy, configList:null
getFirstLevelParentDependencies: project:yyy, configList:null
getFirstLevelParentDependencies ----- end, {project ':app'=[configuration ':app:implementation']}
应该是问题在这里
getAarByArtifacts-----artifacts.size=0
getAarByArtifacts-----listArtifact=[]
getAarByArtifacts-----aarList=[]
modifyDependencies-----artifactAarList=[]
DependenciesHelper#getAarByArtifacts
------ childProject.configurations.maybeCreate("default").artifacts 这个字段是空的
from rocketx.
DependenciesHelper#getAarByArtifacts
------ childProject.configurations.maybeCreate("default").artifacts 这个字段是空的
这个没有关系的,这个是指通过特殊的 依赖导进来的的譬如项目build.gradle使用了这种代码:
configurations.maybeCreate("default")
artifacts.add("default", file('lib-xx.aar'))
getFirstLevelParentDependencies 的 log 目前看起来是有问题的,你需要在 ChildProjectDependencies 这个类里面的 init 代码块最后一行加入(目的看下项目所有 module 本身获取的config 依赖 有没有问题) :
LogUtil.d("ChildProjectDependencies project:"+ project)
LogUtil.d("ChildProjectDependencies allConfigList:"+ allConfigList)
from rocketx.
ChildProjectDependencies project:project ':app'
ChildProjectDependencies allConfigList:[configuration ':app:implementation', configuration ':app:api', configuration ':app:compileOnly']
ChildProjectDependencies project:project ':x'
ChildProjectDependencies allConfigList:[configuration ':x:implementation', configuration ':x:api', configuration ':x:compileOnly']
ChildProjectDependencies project:project ':y'
ChildProjectDependencies allConfigList:[configuration ':y:implementation', configuration ':y:api', configuration ':y:compileOnly']
ChildProjectDependencies project:project ':z'
ChildProjectDependencies allConfigList:[configuration ':z:implementation', configuration ':z:api', configuration ':z:compileOnly']
ChildProjectDependencies project:project ':a'
ChildProjectDependencies allConfigList:[configuration ':a:implementation', configuration ':a:api', configuration ':a:compileOnly']
ChildProjectDependencies project:project ':b'
ChildProjectDependencies allConfigList:[configuration ':b:implementation', configuration ':b:api', configuration ':b:compileOnly']
ChildProjectDependencies project:project ':c'
ChildProjectDependencies allConfigList:[configuration ':c:implementation', configuration ':c:api', configuration ':c:compileOnly']
ChildProjectDependencies project:project ':d'
ChildProjectDependencies allConfigList:[configuration ':d:implementation', configuration ':d:api', configuration ':d:compileOnly']
ChildProjectDependencies project:project ':e'
ChildProjectDependencies allConfigList:[configuration ':e:implementation', configuration ':e:api', configuration ':e:compileOnly']
from rocketx.
@yygutn 不好意思。好像没有看到依赖,log 需要改一下:
LogUtil.d("ChildProjectDependencies project:" + project)
allConfigList.forEach {
LogUtil.d("ChildProjectDependencies config ==== :" + it)
it.allDependencies.forEach {
LogUtil.d("ChildProjectDependencies dependency:" + it)
}
LogUtil.d("ChildProjectDependencies config end ===" )
}
from rocketx.
@trycatchx
其余依赖的project module没有输出
少了2个debug下的依赖
RocketXPlugin : ChildProjectDependencies project:project ':app'
RocketXPlugin : ChildProjectDependencies allConfigList:[configuration ':app:implementation', configuration ':app:api', configuration ':app:compileOnly']
RocketXPlugin : =====ChildProjectDependencies=====Config name:implementation =====
RocketXPlugin : dependency:215916012
RocketXPlugin : dependency:DefaultExternalModuleDependency{group='xxx', name='xxx', version='xxx', configuration='default'}
RocketXPlugin : dependency:1021555846
RocketXPlugin : dependency:DefaultProjectDependency{dependencyProject='project ':a'', configuration='default'}
RocketXPlugin : dependency:1618947996
RocketXPlugin : dependency:DefaultProjectDependency{dependencyProject='project ':b'', configuration='default'}
RocketXPlugin : dependency:1601133444
RocketXPlugin : dependency:DefaultProjectDependency{dependencyProject='project ':c'', configuration='default'}
RocketXPlugin : dependency:1222693562
RocketXPlugin : dependency:DefaultProjectDependency{dependencyProject='project ':d'', configuration='default'}
RocketXPlugin : dependency:1836512183
RocketXPlugin : dependency:DefaultProjectDependency{dependencyProject='project ':e'', configuration='default'}
RocketXPlugin : dependency:464613922
RocketXPlugin : dependency:DefaultProjectDependency{dependencyProject='project ':f'', configuration='default'}
RocketXPlugin : dependency:849807987
RocketXPlugin : dependency:DefaultExternalModuleDependency{group='xxx', name='xxx', version='xxx', configuration='default'}
RocketXPlugin : dependency:-1663809308
RocketXPlugin : dependency:DefaultExternalModuleDependency{group='cxxx', name='xxx', version='xxx', configuration='default'}
from rocketx.
@yygutn 是的 debug 的implement 是遗漏了。所以你编译不过的内容主要是这两个 module 吗?
from rocketx.
@yygutn 是的 debug 的implement 是遗漏了。所以你编译不过的内容主要是这两个 module 吗?
那倒不是,只是debug的依赖,没有也不影响
from rocketx.
先尝试一下补上去:
//单独的 buildconfig
val buildTypeConfigName = it.buildType + suffix.capitalize()
val buildTypeConfiguration = project.configurations.maybeCreate(buildTypeConfigName)
if (!allConfigList.contains(buildTypeConfiguration)) {
allConfigList.add(buildTypeConfiguration)
}
from rocketx.
没用0-0
钉钉or微信沟通一下吧- -有点长
from rocketx.
帮忙排查一下红框内的这个条件语句。 理论 module a b c d 的 parent 都是 app ,也就是 获取出来的 MutableList 不能为空。
from rocketx.
使用 'io.github.trycatchx:rocketx:1.0.10' 版本解决。
from rocketx.
Related Issues (20)
- 修改commonUI 源码依赖不生效,还是打包成aar HOT 4
- No static field xxx of type I in class Lcom/xxx/xxx/BR; HOT 1
- 请问改为发布到远端maven仓库有示例吗,需要改哪些地方呢 HOT 3
- demo 编译报错 HOT 4
- kapt: java.lang.ClassNotFoundException: com.google.gson.annotations.SerializedName HOT 1
- 使用kapt没生成对应类 HOT 1
- Cannot change dependencies of dependency configuration ':xxx:api' after it has been included in dependency resolution. HOT 1
- Execution failed for task ':xxx:kaptDebugKotlin HOT 2
- AGP 7.2.2 sync 失败 HOT 5
- Cannot change dependencies of dependency configuration ':app:implementation' after it has been included in dependency resolution. HOT 1
- 引入其他asm插桩插件导致编译失败: zip END header not found HOT 1
- a模块布局xml引用b模块资源文件会编译报错,第一次可以编译通过,之后就报错了 HOT 2
- 请教一下,这部分禁用transform任务的逻辑,有没有办法在build.gradle里面写,而不是在插件里? HOT 1
- Execution failed for task ':app:checkDevDebugAarMetadata' HOT 3
- 针对 Flutter 项目需要额外的处理吗 HOT 1
- demo编译爆错 HOT 2
- 项目是老项目,没有适配androidX,使用rocketX插件编译不了
- gradle 编译没法使用
- 目前还不支持 includeBuild
- 没有适配AndroidStudio新UI
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rocketx.