Im trying to run this code:
gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestIdToken(getString(R.string.default_web_client_id))
.requestEmail()
.build();
but the R.string.default_web_client_id
part isnt working (Cannot resolve symbol ‘default_web_client_id’).
i know that the ‘default_web_client_id’ string exists, but it isnt at the String XML, its in a generated ‘values.xml’
am i doing something wrong or it should be working?
3
Answers
you need to put it inside
I think your app will not going to crash anywhere. Just Android Studio’s IDE will produce that error. You can ignore that.
I don’t understand that why not put the string into strings.xml? (app/src/main/res/values/strings.xml) or put it into a separate class that contains some constant variables.
I use a class named
Configs.java
to save these variables.