Comments (4)
combuild.isRegisterCompoAuto配置为false的时候,不配置applicationName项目就会构建失败:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':ComponentShare:transformClassesWithComponentCodeForDebug'.
> you should set applicationName in combuild
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
...
Caused by: java.lang.RuntimeException: you should set applicationName in combuild
at com.dd.buildgradle.ComCodeTransform.getRealApplicationName(ComCodeTransform.groovy:133)
at com.dd.buildgradle.ComCodeTransform.transform(ComCodeTransform.groovy:24)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:239)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:235)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)
at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:230)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:50)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:131)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:120)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:99)
... 31 more
combuild.isRegisterCompoAuto配置为false的时候,IApplicationLike的实现类的RegisterCompManual注解不是必须要加的:
>>>> javassist.CtClassType@262c7fb2[public class xxx.browser.BrowserAppLike implements com.luojilab.component.componentlib.applicationlike.IApplicationLike, fields= constructors=javassist.CtConstructor@7eacaec5[public BrowserAppLike ()V], methods=javassist.CtMethod@119b79fc[public onCreate ()V], javassist.CtMethod@59c8eb42[public onStop ()V], ] **manual register?false**
Application is runalone.BrowserApplication
ApplicationLike will be auto register: xxx.browser.BrowserAppLike
>>>
>>>
>>>
>>>
check isRegisterCompoAuto: W:\xxx\build\intermediates\javac\debug\compileDebugJavaWithJavac\classes ; **isRegisterCompoAuto:false**
from jimu.
实际上我更倾向于 调试独立不耦合在组件内,无需走反射直接调试就好了。
可以参考 https://github.com/YummyLau/ComponentPlugin
from jimu.
实际上我更倾向于 调试独立不耦合在组件内,无需走反射直接调试就好了。
可以参考 https://github.com/YummyLau/ComponentPlugin
学习了,站在巨人的肩上走的更远
from jimu.
抱歉时隔两年才答复。
插件配置组件入口(applicationName)是最开始的方案,后来我参与了项目,个人认为方案中的一些做法虽然简单但不简便。所以计划尝试 利用Gradle Transformer 阶段扫描
做 组件发现
取代 组件配置
,出于个人精力受限,印象中整个计划没有全部做完,给大家带来了一些困扰。
- applicationName 配置runalone时Application的入口,这一点没有变
- combuild.isRegisterCompoAuto 意指:runalone时是否织入 ”组件的初始化代码“,但原始方案中,无法对加载顺序,加载时机做任何干涉。
为了解决这些问题,计划中分了几步:
- 先建立排除机制,让指定的组件无法被自动加载,即添加
RegisterCompManual
注解 - 添加一个支持库,让组件的加载可被描述为 ”一系列存在依赖条件的任务“,按照任务图处理加载,这部分工作作为Maat项目单独发布了。这样IApplicationLike就是一个单纯的
注入点
, 用于向加载任务中注入 ”组件初始化逻辑“ - 废除 combuild.isRegisterCompoAuto 等机制,在前面的步骤完成后,我们可以激进的认为:”除了无须自动加载的组件,均可以被自动加载 “(当然,这个想法一定存在争议:是组件决定自己是否应该被加载,还是宿主决定是否自动加载组件)这一步尚未实施
from jimu.
Related Issues (20)
- gradle build慢 HOT 2
- 组件单独调试问题 HOT 2
- app主项目变为lib问题 HOT 1
- 点击消息DEMO后是一个页面1,页面1启动remote页面2 后发送的eventb,在页面2可以看到,但是返回到页面1中却没有显示,是不支持跨进程的事件回调么?
- 我怎么运行不起来呢 HOT 1
- 能否提供环境 HOT 1
- Router.getInstance().getService()返回值能否改成泛型?
- 导入项目的时候报错,大达们怎么解决 HOT 4
- UI 跳转 携带List数据的问题
- 不支持gradle 4.6 HOT 2
- 项目运行不起来解决方案 HOT 2
- 项目运行报错 HOT 4
- FLAG_ACTIVITY_NEW_TASK flag 怎么添加 HOT 1
- 组件里要获得ApplicationContext如何处理,使用反射得到时第一次获取会是null,可能由于太早获取原因
- Sync failed: Could not find com.github.jimu:build-gradle:1.3.4 HOT 3
- JIMU升级到1.3.5的时候出错 HOT 3
- 1.3.5更新到mavenCentral后demo不能运行 HOT 6
- 启用ViewBinding后,runalone中的xml会生成Binding类,在集成打包时binding类找不到runalone中的layout资源,我应该是哪里没配置好,请大佬们指点
- 在gradle plugin 为7.0.0 版本时,编译不通过
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 jimu.