8

我想做什么&问题

我将我的 Android Studio 和 Android Gradle 插件更新为 3.0.0,将我的 Gradle Wrapper 更新为 4.2.1,并希望通过 IDE 在设备上构建和部署我的 Android Gradle 项目。

  • 构建成功
  • 当我尝试将我的 :app 模块部署到连接的设备时,我收到以下错误:

    错误:配置项目“:集成测试”时出现问题。变体“调试”没有类型为“INSTANT_RUN_MERGED_MANIFESTS”的输出

有关项目的详细信息(简化)

该项目包括:

  • 一个:库模块
  • 一个:app 模块,它构建应用程序的 apk 并使用 :library 模块
  • 一个:integration-test 模块,它:
    • 使用“com.android.test”插件
    • 通过 targetProjectPath ':app' & targetVariant 'debug' 依赖于 :app 模块
    • 并包含对 :app 功能的仪器测试
    • 仅包含一个“主”文件夹(测试插件不支持其他)

设置.gradle

include :library
include :app
include :integration-test

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.domain.integration_test">

<!-- from https://stackoverflow.com/questions/45631959/how-to-place-android-instrumentation-test-files-outside-of-project-directory -->
<!-- Specify runner and target application package -->
<instrumentation
    android:name="android.support.test.runner.AndroidJUnitRunner"
    android:functionalTest="false"
    android:handleProfiling="false"
    android:label="Tests for com.domain.pro.client"
    android:targetPackage="com.domain.pro.client"/>

<application>
    <uses-library android:name="android.test.runner" />
</application>

上次使用的是: - Build Tools 2.2.3、Gradle 3.4.1 和 Android Studio 2.3.3

问题

有没有人使用包含(带有 AndroidManifest 文件)的 com.android.test 插件获得(集成)测试模块,以便与Android Gradle Plugin 3.0.0一起运行?如果是这样,您能提供一个我可以用来修复我的设置的示例吗?

4

2 回答 2

6

转到 Android Studio > 首选项 > 即时运行 > 取消选中“启用即时运行...”

于 2017-10-30T12:53:58.220 回答
1

由更改 ID 修复:I443aa157de5f9f49441e61f26f52d0176e44502d

固定将在 Android Studio 3.1 canary 6 +

如果任何问题仍然存在,请在Google 问题跟踪器上报告,他们将重新打开以进行检查。

于 2017-12-16T08:19:51.007 回答