google / secrets-gradle-plugin

A Gradle plugin for providing your secrets to your Android project.
Apache License 2.0
1.14k stars 99 forks source link

Unable to read values #34

Closed huzaifaaak closed 3 years ago

huzaifaaak commented 3 years ago

During build this error is thrown: Attribute meta-data#com.google.android.geo.API_KEY@value at AndroidManifest.xml:17:9-35 requires a placeholder substitution but no value for <GMP_KEY> is provided.

If I add a sample placeholder in my default config the app seems to build fine but the keys are not read in manifest:

Build.gradle(app):

defaultConfig {
    applicationId "com.projID"
    minSdkVersion rootProject.ext.minSdkVersion
    targetSdkVersion rootProject.ext.targetSdkVersion
    versionCode 3
    versionName "0.1"
    multiDexEnabled true
    manifestPlaceholders=[GMP_KEY: "Google Maps", googleMapApiKey: ""]
}

Build.gradle(root):

ext {
    buildToolsVersion = "29.0.2"
    minSdkVersion = 16
    compileSdkVersion = 29
    targetSdkVersion = 29

    googlePlayServicesVersion = "17.0.0"
    androidMapsUtilsVersion="2.2.5"
}

I have tried manually adding the keys in manifest and that works fine. I am running this with React-Native

huzaifaaak commented 3 years ago

Donwgrade to com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:1.2.0 fixed for me.

arriolac commented 3 years ago

Plugin 1.3.0 should work. What version of AGP are you using?

huzaifaaak commented 3 years ago

I am using 4.2.0 classpath('com.android.tools.build:gradle:4.2.0') and my distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip