React-native-config: Migrating to RN 61.2 Androind

Created on 17 Oct 2019  路  5Comments  路  Source: luggit/react-native-config

We manage to make react-native-config works on IOS but we android we have an issue on the line we have to add to the android/app/build.gradle

apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"

The error is

Project with path ':react-native-config' could not be found in project ':app'

Most helpful comment

for me react-native-config works fine on android, but it does't work when I create production apk.
Hope someone will fix this soon

All 5 comments

for me react-native-config works fine on android, but it does't work when I create production apk.
Hope someone will fix this soon

I can't even get it to work on Android in any case, works perfectly fine in iOS though. Can't even build the app due to something at this line failing.

FAILURE: Build failed with an exception.

* Where:
Script '.../node_modules/react-native-config/android/dotenv.gradle' line: 84

* What went wrong:
Execution failed for task ':app:generateDebugBuildConfig'.
> dotenv_25ey16mhu5xyad5po03b3lkl1$_run_closure2$_closure8$_closure9$_closure10

@ajouve I was in the exact same situation and I solved it by running
react-native unlink --platforms android react-native-config

Maybe in issue #400 I made a response that could help you.
See here.

This worked for me when migrating RN from 0.59.10 to 0.60.6 馃殌

https://github.com/luggit/react-native-config/issues/400#issuecomment-586769134

Make sure that react-native-config is not present in the dependencies object on react-native.config.js, or that it does NOT have:

platforms: {
  android: null
}
Was this page helpful?
0 / 5 - 0 ratings