Skip to content

Commit bc948c1

Browse files
authored
add troubleshoot section
1 parent 498c70c commit bc948c1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,20 @@ buildTypes {
142142
- Add `using Config.Reader.RNConfigReader;` to the usings at the top of the file
143143
- Add `new RNConfigReaderPackage()` to the `List<IReactPackage>` returned by the `Packages` method
144144

145+
## Troubleshooting
146+
147+
### Problems with Proguard
148+
149+
When Proguard is enabled (which it is by default for Android release builds), it can rename the BuildConfig Java class in the minification process and prevent `react-native-config-reader` from referencing it. To avoid this, add an exception to android/app/proguard-rules.pro:
150+
151+
`-keep class com.yourNewPackage.BuildConfig { *; }`
152+
153+
com.yourNewPackage should match the package value in your app/src/main/AndroidManifest.xml file.
154+
155+
If using Dexguard, the shrinking phase will remove resources it thinks are unused. It is necessary to add an exception to preserve the build config package name.
156+
157+
`-keepresources string/rn_config_reader_custom_package`
158+
145159

146160
## License
147161
MIT License

0 commit comments

Comments
 (0)