Giter Site home page Giter Site logo

Comments (17)

prtkkmrsngh avatar prtkkmrsngh commented on June 22, 2024 14

@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.

from react-native-config.

alfonsodev avatar alfonsodev commented on June 22, 2024 8

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 ?

from react-native-config.

alfonsodev avatar alfonsodev commented on June 22, 2024 1

@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!

from react-native-config.

justinmoon avatar justinmoon commented on June 22, 2024

This would be great. Any hints on how to implement this? I could give it a try.

from react-native-config.

prtkkmrsngh avatar prtkkmrsngh commented on June 22, 2024

Its working. Tested for react-native-facebook-login!

from react-native-config.

joncursi avatar joncursi commented on June 22, 2024

@prtkkmrsngh how'd you get it to work? I'm trying to do the same for react-native-facebook-login

from react-native-config.

joncursi avatar joncursi commented on June 22, 2024

I'm trying to do this in a dynamic way using this package:

  <string name="facebook_app_id">appIDhere</string>

from react-native-config.

fforres avatar fforres commented on June 22, 2024

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?

from react-native-config.

sundariragavan avatar sundariragavan commented on June 22, 2024

Same problem here.Any update?

from react-native-config.

lucianomlima avatar lucianomlima commented on June 22, 2024

Any news on that?

from react-native-config.

mchjohn avatar mchjohn commented on June 22, 2024

Try it

<resources>
    <string name="facebook_app_id">{$FACEBOOK_APP_ID}</string>
    <string name="fb_login_protocol_scheme">{$FACEBOOK_LOGIN_PROTOCOL_SCHEME}</string>
</resources>

from react-native-config.

Makhdoom-Sharif avatar Makhdoom-Sharif commented on June 22, 2024

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?

from react-native-config.

LuizCristino avatar LuizCristino commented on June 22, 2024

Looks like any access to string xml results on not found only on CI. Also looking for a solution

from react-native-config.

tkyr-hh avatar tkyr-hh commented on June 22, 2024

this issue happened to me as well but only on CircleCI pipeline, not happening in local, I don't know why

from react-native-config.

KFrysztak avatar KFrysztak commented on June 22, 2024

any update on it? I am also facing the same issue. Locally it works in a perfect way but not on CI.

from react-native-config.

tkyr-hh avatar tkyr-hh commented on June 22, 2024

@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.

from react-native-config.

MhtChawlaRutrust avatar MhtChawlaRutrust commented on June 22, 2024

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?

from react-native-config.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.