Esri/arcgis-maps-sdk-java-samples

Feedback for new gradle.properties instructions for working with API keys

shellygill opened this issue · 1 comments

I've pulled the latest 100.10 release samples and successfully ran samples using the new API keys workflow. However, I did run in to one problem during this, so perhaps others have found similar.

The new instruction in the readme (https://github.com/Esri/arcgis-runtime-samples-java/blame/master/README.md#L24) asks you to:

Set your API key in the gradle.properties file located in the /.gradle folder within your home directory.

I've previously used this same approach for Android development some time ago - my user gradle.properties file has existing contents (which worked as expected) along the lines of:

SOME_USERNAME="username_string"
SOME_PASSWORD="password_string"

So Initially I tried this same format for the new API key, e.g.

apiKey="api_key_value"

But this doesn't work, I found I have to add the property value without quotes, e.g.

apiKey=api_key_value

I'm not sure if this is down to a difference in gradle versions - very possibly as Android was using a different gradle version for the code I was previously running. Perhaps the expected format of the file can be documented for users who run in to similar, or who don't have the file in the first place therefore would have to go and look up the format to use.

thanks for the feedback Shelly! I think what is happening above is that the SOME_USERNAME syntax looks more like an environment variable that has to be set with a string, whereas the apiKey is a system property that doesn't require a string https://docs.gradle.org/current/userguide/build_environment.html

I will update the readme to reflect this sets a system property and hopefully that will be clearer :)