8

What I want to do & the problem

I updated my Android Studio and Android Gradle Plugin to 3.0.0 and my Gradle Wrapper to 4.2.1 and want to build & deploy my Android Gradle project on a device via IDE.

  • Building succeeds
  • When I try to deploy my :app module to a connected device, I receive the error:

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

Details about the project (simplified)

The project consists of:

  • a :library module
  • an :app module which builds the app's apk and uses the :library module
  • an :integration-test module which:
    • uses the "com.android.test" plugin
    • dependents on the :app module via targetProjectPath ':app' & targetVariant 'debug'
    • and contains instrumented tests on the :app functions
    • only contains a 'main' folder (the test plugin does not support others)

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>

Last time it worked was with: - Build Tools 2.2.3, Gradle 3.4.1 and Android Studio 2.3.3

Question

Did anyone get a (integration-)test module using the com.android.test plugin containing (with an AndroidManifest file) to run with Android Gradle Plugin 3.0.0? If so, would you provide a sample which I can use to fix my setup?

hb0
  • 3,350
  • 3
  • 30
  • 48
  • 1
    The good news is that you're not crazy as I'm seeing this as well. The bad news is that I don't have an answer for you yet. Upvoted. – Andrew Westberg - BCSH Oct 27 '17 at 15:12
  • The bug is still there with version 3.0.1 :( The only workaround which worked so far is to disable instant run or use build tools 2.2.3, gradlew 3.4.1 and Android Studio 2.3.3. – hb0 Dec 04 '17 at 09:00

2 Answers2

6

Go to Android Studio > Preferences > Instant Run > Uncheck "Enable instant run..."

avelyne
  • 710
  • 6
  • 15
  • Thanks for your answer. I'll check it out as soon as I am back at the office and have time. I'll keep you updated. – hb0 Oct 31 '17 at 14:09
  • But ofc, this would be more a workaround than a solution/hint, what's wrong with the setup. Do you have any details or maybe a link to an open issue about this problem? – hb0 Nov 01 '17 at 08:22
  • I thought the 3.0.1 update fixed it but it seems that it only was the case because instant run was not applied by Android Studio that time (the app was not yet installed on the test device). Now I get the same error. Your workaround fixed it: I can deploy changes to a device. Thus, I upvote it, but I cannot mark it as accepted as it's just a workaround. :/ Thanks anyway brother! – hb0 Dec 04 '17 at 08:52
1

Fixed by Change-Id: I443aa157de5f9f49441e61f26f52d0176e44502d

Fixed will be in Android Studio 3.1 canary 6 +

If any issue persists, please report at Google issue tracker they will re-open to examine.

Prags
  • 2,457
  • 2
  • 21
  • 38
  • Thanks for reporting this here. As soon as the Update rolls in and I can confirm this, I'll mark your answer as solution. Cheers! – hb0 Dec 16 '17 at 20:31
  • With Android Studio 3.1.2 Build #AI-173.4720617 it's still not working: com.android.build.gradle.internal.scope.MissingTaskOutputException: No output of type: INSTANT_RUN_MERGED_MANIFESTS – hb0 Apr 26 '18 at 11:01