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<void, void> {
constructor(props: any) {
super(props)
console.log('Config', JSON.stringify(Config))
}
}
Config returns null.
Any suggestions?
React Native:
61Android:
AndroidXThere seems to be an issue with assembling for release when using ProGuard:
In short, attempting to build via
./gradlew assembleRelease -x bundleReleaseJsAndAssetsbuilds the project just fine, but it results in RN Config Reader throwing the following error:The app assembles and works just fine using
assembleDebug. All of the build variant BuildConfig files are properly automatically generated with the correct values.Configreturnsnull.Any suggestions?