Open atinder opened 7 years ago
This would be great. Any hints on how to implement this? I could give it a try.
Its working. Tested for react-native-facebook-login!
@prtkkmrsngh how'd you get it to work? I'm trying to do the same for react-native-facebook-login
I'm trying to do this in a dynamic way using this package:
<string name="facebook_app_id">appIDhere</string>
@joncursi edit strings.xml like this
<string name="facebook_app_id">@string/FACEBOOK_APP_ID</string>
Note: FACEBOOK_APP_ID should be present in .env and if you are using different files for different environment (eg. staging, production) then in them too.
This is working on my computer but is not working on Bitrise build system
String.xml
<resources>
<string name="facebook_app_id">@string/FACEBOOK_APP_ID</string>
<string name="fb_login_protocol_scheme">@string/FACEBOOK_LOGIN_PROTOCOL_SCHEME</string>
</resources>
I have aunique .env
file
FACEBOOK_APP_ID=00000001
FACEBOOK_LOGIN_PROTOCOL_SCHEME=fb00000001
:app:processReleaseResources/Users/vagrant/git/android/app/build/intermediates/res/merged/release/values/values.xml:923:36-59:
AAPT: No resource found that matches the given
name (at 'facebook_app_id' with value '@string/FACEBOOK_APP_ID').
Does anybody here use a build system and had similar problems ?
Same problem here @alfonsodev Locally it's no issue, but on a CI/CD environment (budydbuild in my case) it does not work.
Did you find any solution?
@fforres Yes, in my particular case the problem was that
on the build steps I'm moving the folder after cloning it,
but mv
command wasn't copying hidden files by default,
so the .env
file didn't get copied and therefore the issue.
The solution was to run shopt -s dotglob
before mv
command so that .env
gets copied over with the src files.
I hope it helps!
Same problem here.Any update?
Any news on that?
Try it
<resources>
<string name="facebook_app_id">{$FACEBOOK_APP_ID}</string>
<string name="fb_login_protocol_scheme">{$FACEBOOK_LOGIN_PROTOCOL_SCHEME}</string>
</resources>
I am trying to access the string from .env in strings.xml but it shows the error: resource string/APP_NAME (aka com.APP:string/APP_NAME) not found
. Any update?
Looks like any access to string xml results on not found only on CI. Also looking for a solution
this issue happened to me as well but only on CircleCI pipeline, not happening in local, I don't know why
any update on it? I am also facing the same issue. Locally it works in a perfect way but not on CI.
@KFrysztak for me the issue is that I'm decrypting the env file in the first job of the NPM packages installation, not in the APK build job, and it turns out that the ENV file does not exist because I need it to persist in the workspace, but this is not wise, I've put the env decryption step in the APK build job, before the step of the assemble release step, and it worked as expected.
I am trying to access the string from .env in strings.xml but it shows the error:
resource string/APP_NAME (aka com.APP:string/APP_NAME) not found
. Any update?
any workaround?
App works fine when using env vars in AndroidManifest.xml but crashes when using env vars inside strings.xml
Edit: Basically my question is related to react-native-facebook-account-kit I want to fetch following info from .env