android - 无法使用 dynamicFeatures 运行 Espresso
问题描述
当我尝试运行检测单元测试时,我遇到了启用动态功能的清单合并问题。
我尝试将模块添加为“androidTestImplementation 项目”,但由于它们是“功能”而不是“模块”,因此它不起作用。无论如何,我觉得这一步太晚了,因为此时添加动态功能已经失败。这是清单合并问题:
insertion/build/intermediates/tmp/manifest/androidTest/debug/manifestMerger.xml
Android resource linking failed
构建.gradle
android {
...
dynamicFeatures = [":feature1", ":feature2"]
}
其他人有同样的问题吗?
解决方案
我通过在我的动态功能模块中为 androidTest 添加应用程序依赖项来修复它
implementation project(':app')
androidTestImplementation project(':app')
推荐阅读
- jmeter - JMeter 在长场景下失败
- d3.js - D3.js - X 轴未出现在散点图上
- qt - 如何在自定义 Qt 类上安装事件过滤器?
- android - Android Firebase RealtimeDatabase 日期作为日期对象
- python-3.x - 例外:无法处理非唯一的多索引
- ios - 上传到 Firebase 的视频时长为 0 秒?
- sql - Microsoft SQL Server - 条件变量赋值
- javascript - 我的 discord.js 机器人似乎同时运行多个实例
- typescript - 按键获取字符串数组
- swift - 如何解决此错误:一行上的连续语句必须用“;”分隔