dropbox / dropshots

Easy on-device screenshot testing for Android.
Apache License 2.0
257 stars 17 forks source link

Gradle record screenshot task failing - but works #49

Open ParohyGr opened 1 year ago

ParohyGr commented 1 year ago

When I run the command ./gradlew :app:connectedAndroidTest -Pdropshots.record I get the following error:

* What went wrong:
A problem was found with the configuration of task ':app:update<flavor>DebugAndroidTestScreenshots' (type 'PullScreenshotsTask').
  - Gradle detected a problem with the following location: '.../src/androidTest/screenshots'.

    Reason: Task ':app:mergeBaseDebugAndroidTestAssets' uses this output of task ':app:update<flavor>DebugAndroidTestScreenshots' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.

    Possible solutions:
      1. Declare task ':app:update<flavor>DebugAndroidTestScreenshots' as an input of ':app:mergeBaseDebugAndroidTestAssets'.
      2. Declare an explicit dependency on ':app:update<flavor>DebugAndroidTestScreenshots' from ':app:mergeBaseDebugAndroidTestAssets' using Task#dependsOn.
      3. Declare an explicit dependency on ':app:update<flavor>DebugAndroidTestScreenshots' from ':app:mergeBaseDebugAndroidTestAssets' using Task#mustRunAfter.

How ever, the screenshots are done as expected. Still have to manually delete the screenshots folder in order to have them generated while this error is happening.

rharter commented 1 year ago

Hmm, can you share what version of AGP and Kotlin you're using? It's odd that the error message only mentioned AGP tasks, though it is the Dropshots directory.

On Fri, May 19, 2023, 06:20 Tomas Paronai @.***> wrote:

When I run the command ./gradlew :app:connectedAndroidTest -Pdropshots.record I get the following error:

  • What went wrong: A problem was found with the configuration of task ':app:updateDebugAndroidTestScreenshots' (type 'PullScreenshotsTask').

    • Gradle detected a problem with the following location: '.../src/androidTest/screenshots'.

    Reason: Task ':app:mergeBaseDebugAndroidTestAssets' uses this output of task ':app:updateDebugAndroidTestScreenshots' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.

    Possible solutions:

    1. Declare task ':app:updateDebugAndroidTestScreenshots' as an input of ':app:mergeBaseDebugAndroidTestAssets'.
    2. Declare an explicit dependency on ':app:updateDebugAndroidTestScreenshots' from ':app:mergeBaseDebugAndroidTestAssets' using Task#dependsOn.
    3. Declare an explicit dependency on ':app:updateDebugAndroidTestScreenshots' from ':app:mergeBaseDebugAndroidTestAssets' using Task#mustRunAfter.

How ever, the screenshots are done as expected. Still have to manually delete the screenshots folder in order to have them generated while this error is happening.

— Reply to this email directly, view it on GitHub https://github.com/dropbox/dropshots/issues/49, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ4S3Q3544S3WTYCC77WJTXG5JRPANCNFSM6AAAAAAYHU3RVU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

ParohyGr commented 1 year ago

Gradle: 8.0 AGP: 8.0.1 Kotlin: 1.8.0

vincent-paing commented 1 year ago

Can replicate too.

AGP: 8.1.0 Kotlin : 1.8.10 Gradle: 8.2

I think it has to do with having different flavor of build