View the Secrets Gradle Plugin for Android.IgnoreList.add("sdk.*") // Ignore all keys matching the regexp "sdk.*" IgnoreList.add("keyToIgnore") // Ignore the key "keyToIgnore" Configure which keys should be ignored by the plugin by providing regular expressions. This file can beĭefaultPropertiesFileName = '' A properties file containing default secret values. PropertiesFileName = "secrets.properties" The plugin defaults to "local.properties" Optionally specify a different file name containing your secrets. In Android Studio, open your project-level adle file and edit Optionally edit the properties of the plugin to specify a different secrets file or other properties. In your AndroidManifest.xml file, go toĬom._KEY and update the android:value attribute.Open the local.properties in your project level directory, and then add theįollowing code.Open your module-level adle file and add the following code to the.Id '.crets-gradle-plugin' version '2.0.1' apply false In Android Studio, open your project-level adle file and add the followingĬode to the dependencies element under buildscript.Must appear before any other statements in the script. In your top-level adle file, include the.To install the Secrets Gradle Plugin for Android in your Google Maps project: The plugin then exposes those propertiesĪs variables in the Gradle-generated BuildConfig class and in the Android manifest file.įor a complete example of using the Secrets Gradle Plugin for Android to access an API key,ĭocumentation on GitHub for the latest system requirements and installation instructions. The Secrets Gradle Plugin for Android reads secrets, including the API key, fromĪ properties file not checked into a version control system. Which is located in the root directory of your project and then use the Instead, you should store it in the local.properties file, Google strongly recommends that you not check an API key into your Prepare for Google Play data disclosure requirements.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |