csath / csath/react-native-config-reader
Enabling ProGuard results in "Could not find BuildConfig class" error when attempting to assembleRelease
- Dominant language
- Objective-C
- Stars
- 47
- Forks
- 17
- PR merge metrics
- No merged PRs in 30d
Description
**React Native**: `61`
**Android**: `AndroidX`
There seems to be an issue with assembling for release when using ProGuard:
```
android() {
...
buildTypes {
debug {
buildConfigField "String", "FOO", "\"bar\""
}
release {
buildConfigField "String", "FOO", "\"baz\""
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
}
}
...
}
```
In short, attempting to build via `./gradlew assembleRelease -x bundleReleaseJsAndAssets` builds the project just fine, but it results in RN Config Reader throwing the following error:
```
ReactNative: RNConfigReader: Could not find BuildConfig class
```
The app assembles and works just fine using `assembleDebug`. All of the build variant BuildConfig files are properly automatically generated with the correct values.
```
import Config from 'react-native-config-reader'
export default class Root extends React.Component {
constructor(props: any) {
super(props)
console.log('Config', JSON.stringify(Config))
}
}
```
`Config` returns `null`.
Any suggestions?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.