Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android linking issue RN62 #442

Closed
a-eid opened this issue Apr 1, 2020 · 5 comments
Closed

android linking issue RN62 #442

a-eid opened this issue Apr 1, 2020 · 5 comments

Comments

@a-eid
Copy link

a-eid commented Apr 1, 2020

almost a fresh installation of RN 62 and I'm getting the following error when trying to link the lib.

info Linking "react-native-config" Android dependency
error Linking "react-native-config" failed. Run CLI with --verbose flag for more details.
Error: ENOENT: no such file or directory, open '.../android/src/main/res/values/strings.xml'
    at Object.openSync (fs.js:457:3)
    at Object.readFileSync (fs.js:359:35)
    at applyPatch (.../node_modules/@react-native-community/cli-platform-android/build/link/patches/applyPatch.js:42:51)
    at Object.registerNativeAndroidModule [as register] (.../node_modules/@react-native-community/cli-platform-android/build/link/registerNativeModule.js:33:27)
    at .../node_modules/@react-native-community/cli/build/commands/link/linkDependency.js:63:16
    at Array.forEach (<anonymous>)
    at linkDependency (/node_modules/@react-native-community/cli/build/commands/link/linkDependency.js:36:32)
    at async Object.link [as func] (.../node_modules/@react-native-community/cli/build/commands/link/link.js:110:5)
    at async Command.handleAction (.../node_modules/@react-native-community/cli/build/index.js:186:9)
@lesmo
Copy link

lesmo commented Apr 5, 2020

react-native-config supports auto-linking starting with v1.0.0, you shouldn't have to do react-native link react-native-config anymore

@a-eid
Copy link
Author

a-eid commented Apr 5, 2020

@lesmo yeah, auto linking is definitely working on IOS but I'm not having any luck with android with manual or auto linking, I'll try again and comment my findings back here..

@archansel
Copy link

Yup, auto linking not working in android. I'm using RN 0.61.5

@archansel
Copy link

After trying to redo all installation steps, I think I'm missing one crucial step in android (under Extra step for Android)

// 2nd line, add a new apply:
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"

After applying that line, it works in android

@AdamGerthel
Copy link

Perhaps this information ought to be added to the readme? It would be helpful to know that the library supports auto-linking

@a-eid a-eid closed this as completed Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants