secrets-gradle-plugin
secrets-gradle-plugin copied to clipboard
Installation instructions throwing UnknownPluginException
Installation calls for adding com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:1.3.0
as a dependency classpath and com.google.android.libraries.mapsplatform.secrets-gradle-plugin
to plugins
block, this results in
Exception is:
org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (plugin dependency must include a version number for this source)
What has worked for me and is documented here and here is to add id "com.google.secrets_gradle_plugin" version "0.6.1"
to the plugins dsl and not adding the dependency classpath.
The installation instructions are included in Maps SDK Quickstart and don't seem to be working as expected.
To reproduce:
- Install via Maps SDK Quickstart or from the repo instructions
- Sync or build your app
Hi @doneill, the instructions on the Maps SDK Quickstart and in this repo are the most up-to-date recommendation. The reason the plugin ID changed is because the plugin artifacts were migrated from Gradle Plugin Portal to Google Maven.
Can you share you project-level build.gradle
file and your app-level build.gradle
file here? Thanks
Hi @arriolac, thanks for the quick reply. Maybe there is a hard requirement to have a project level build.gradle
and app-level build.gradle
as in my reproduction I have a single build.gradle
, below is what works:
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
// ...
}
}
plugins {
id "com.google.secrets_gradle_plugin" version "0.6.1"
}
This throws the exception:
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:1.3.0"
}
}
plugins {
id "com.google.android.libraries.mapsplatform.secrets-gradle-plugin"
}
Exception:
Exception is:
org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (plugin dependency must include a version number for this source)
A couple things to try:
(1) Specify the version of the plugin in the plugins block and try to rebuild.
plugins {
id "com.google.android.libraries.mapsplatform.secrets-gradle-plugin" version "1.3.0"
}
If that doesn't work, you may need to add the following in your settings.gradle
file:
pluginManagement {
repositories {
google()
}
}
Let me know if any of this resolves your issue.
As a side note, I'm curious why your project only has a single build.gradle
file?
Neither of those worked, I had tried using the version explicitly prior.
Single build file for single module project.
Did you get a different exception?
@doneill were you able to resolve this issue?
Please reopen if you are still seeing this.
Hi @arriolac Yes, I continue to get the exceptions I described in the description. The workaround I suggested still works so I apologize for moving on. If you want to continue to investigate the issue or cannot reproduce I can try to isolate outside of my project?
Did you get a different exception?
No
Using groovy dsl
plugins {
id "com.google.android.libraries.mapsplatform.secrets-gradle-plugin
}
results in
Plugin [id: 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'] was not found in any of the following sources:
Exception is:
org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (plugin dependency must include a version number for this source)
Adding a version results in
Exception is:
org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin', version: '2.0.0'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin:com.google.android.libraries.mapsplatform.secrets-gradle-plugin.gradle.plugin:2.0.0')
Searched in the following repositories:
Gradle Central Plugin Repository
It looks like Google Maven is not in the search path. Perhaps adding the following to your build.gradle
file would do the trick?
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:1.3.0"
}
}
// ...and also the following
allprojects {
repositories {
google()
mavenCentral()
}
}
If you can also isolate outside of your project and share here that would be great so I can debug it on my end. Thanks