My Android app uses Google Payments and I store the API Keys in a values xml that is not added to VCS (used .gitignore file). I reference the value as R.string.api_licence
from my code.
When I setup travis for CI, it was complaining that R.string.api_licence
was not found. As a work around, I checked in a dummy text file with empty value for the key and rename the extension to xml from travis build script.
While this is working for now,
1 - This doesn't seem like a perfect solution
2 - Android Studio complains that the dummy txt file name should be of xml extension, and I have to delete it locally to work, which leads me to accidentally commit and break the builds sometimes
Travis script file: https://github.com/midhunhk/message-counter/blob/master/.travis.yml
Notes: I am a self taught Android developer. I don't require the real API keys to be used for CI process. I did some considerable research on this topic and couldn't get a specific answer to my problem.
I think the following approach can be used for solving this issue. I never got to test this as I changed my API implementation and may not need to store the API key in the source code.
https://docs.travis-ci.com/user/environment-variables/#Defining-Variables-in-Repository-Settings
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments