https://kotlinlang.org logo
#android
Title
# android
d

David Martin

01/18/2020, 2:15 PM
Hi guys, have you ever faced this problem before? I've got this error as the attached image, the red rectangle is the file under generated folder, the blue rectangle is my strings file. I don't understand why Android Studio(AS) autogenerate a "google_api_key" even when I deleted my own key then rebuild the project. But if I re-add my own key then AS throw an error as you can see. Thanks in advance about your help.
google 1
stackoverflow 4
Even when I create new project and create new strings file then this error rise again.
r

rkeazor

01/19/2020, 1:57 AM
Try stackoverflow. this workspace is more for Kotlin related questions
a

Andrew

01/19/2020, 2:51 AM
All the string resources should go in strings.xml, since you have some defined in values.xml the build process is auto-merging them with the strings.xml file.
Also for constants like api keys you should be doing something like this. https://richardroseblog.wordpress.com/2016/05/29/hiding-secret-api-keys-from-git/
d

David Martin

01/19/2020, 12:33 PM
@Andrew No, the values is auto-generated file, I don't have any values file.
6 Views