带有即时应用程序的android体系结构组件

编程入门 行业动态 更新时间:2024-10-27 21:23:42
本文介绍了带有即时应用程序的android体系结构组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想为即时应用程序准备好我的应用程序. 我创建了一个应用程序模块,基本模块和功能模块. 如果我在这种配置下运行项目,一切都会很好.

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体系结构组件

本文发布于:2023-11-11 16:40:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1579004.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:体系结构   应用程序   组件   android

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!