android – Variant debug没有类型为INSTANT_RUN_MERGED_MANIFESTS的输出

我想做什么&问题

我将我的Android Studio和Android Gradle插件更新到3.0.0,将我的Gradle Wrapper更新到4.2.1并且想要构建&通过IDE在设备上部署我的Android Gradle项目.

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

Error:A problem occurred configuring project ‘:integration-test’.
Variant ‘debug’ has no output with type ‘INSTANT_RUN_MERGED_MANIFESTS’

项目详情(简化)

该项目包括:

> a:库模块
> an:构建app的apk并使用:library模块的app模块
> an:集成测试模块:

>使用“com.android.test”插件
>依赖于:app模块通过targetProjectPath’:app’& targetVariant’debug’
>并包含:app功能的检测测试
>仅包含’main’文件夹(测试插件不支持其他文件夹)

settings.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

是否有人使用com.android.test插件(使用AndroidManifest文件)与Android Gradle Plugin 3.0.0一起运行(集成)测试模块?如果是这样,你会提供一个我可以用来修复我的设置的样本吗?

解决方法

转到Android Studio>偏好>即时运行>取消选中“启用即时运行…”

相关文章

Android 如何解决dialog弹出时无法捕捉Activity的back事件 在...
Android实现自定义带文字和图片的Button 在Android开发中经常...
Android 关于长按back键退出应用程序的实现最近在做一个Andr...
android自带的时间选择器只能精确到分,但是对于某些应用要求...