pedrovgs / Shot

Screenshot testing library for Android
Apache License 2.0
1.18k stars 115 forks source link

Plugin not found issue with new plugin configuration method in gradle #338

Open Venkat-juju opened 1 year ago

Venkat-juju commented 1 year ago

Expected behaviour

Plugin should be downloaded, sync & build successfully

Actual behaviour

Getting plugin not found exception while sync

Steps to reproduce

I'm getting Plugin not found exception with the new method of applying plugins while gradle sync:

Issue image

my settings.gradle file:

pluginManagement {
    repositories {
        gradlePluginPortal()
        google()
        mavenCentral()
    }
    plugins {
        ... some other plugins....
        id 'shot' version '5.14.1'
    }
}

my module level build.gradle file:

plugins {
    id 'shot'
}

I'm not sure if this is the issue with my configuration or plugin side issue. but it works fine for other plugins. Kindly help!

Version of the library

5.14.1

renetik commented 1 year ago

Same issue here..

ParohyGr commented 1 year ago

Same

nicholaslythall commented 1 year ago

I don't believe the plugin is currently published to the Gradle plugin repository. You can work around this in the meantime by adding the following to your settings.gradle.kts file (apologies, I don't have a groovy version on hand)

pluginManagement {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }

    // Manual resolution for plugins that have not yet been published to the gradle plugin portal
    resolutionStrategy {
        eachPlugin {
            when (requested.id.id) {
                "shot" -> useModule(
                    "com.karumi:shot:${requested.version}"
                )
            }
        }
    }
}