我想为即时应用程序准备好我的应用程序. 我创建了一个应用程序模块,基本模块和功能模块. 如果我在这种配置下运行项目,一切都会很好.
I want to make my app ready for instant apps. I have created an app module, base module and a feature module. if I run my project in this configuration everything works great.
当我在基本模块Gradle文件中实现以下代码行时.
when i implement the following lines inside my base module Gradle file.
annotationProcessor "android.arch.lifecycle:compiler:1.0.0" api "android.arch.lifecycle:extensions:1.0.0"Gradle构建成功,但是我丢失了默认活动并且无法运行该项目.默认活动在我的基本模块清单中.
the Gradle build succeeds but I lose my default activity and can't run the project. the default activity is inside my base module manifest.
如果我通过实施更改扩展行.
if i change the extensions line with implementation.
implementation "android.arch.lifecycle:extensions:1.0.0"发生以下错误:
错误:任务':app:preDebugBuild'的执行失败.
Error:Execution failed for task ':app:preDebugBuild'.
Android依赖项"android.arch.lifecycle:runtime"对于编译(1.0.0)和运行时(1.0.3)类路径具有不同的版本.您应该通过DependencyResolution手动设置相同的版本
Android dependency 'android.arch.lifecycle:runtime' has different version for the compile (1.0.0) and runtime (1.0.3) classpath. You should manually set the same version via DependencyResolution
有人知道这个问题可能是什么吗?
does anyone knows what the problem can be?
推荐答案使用支持库26.1.0或更高版本时,其中包含生命周期功能.通过删除以下lib行
When using the support lib 26.1.0 or higher the lifecycle functionality is included inside. by removing the following lib lines
annotationProcessor "android.arch.lifecycle:compiler:1.0.0" api "android.arch.lifecycle:extensions:1.0.0"并且仅使用:
implementation 'com.android.support:appcompat-v7:26.1.0'一切恢复正常.
官方文档参考
更多推荐
带有即时应用程序的android体系结构组件
发布评论