Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ React Native Brownfield is an open source project and will always remain free to

Like the project? ⚛️ [Join the team](https://callstack.com/careers/?utm_campaign=Senior_RN&utm_source=github&utm_medium=readme) who does amazing stuff for clients and drives React Native Open Source! 🔥

## Troubleshooting

For troubleshooting common issues, please refer to [TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md).

## Contributors

Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):
Expand Down
9 changes: 9 additions & 0 deletions docs/TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
This section provides a troubleshooting guide for common issues encountered when using the `react-native-brownfield` library. If you face any problems not covered here, please refer to the official documentation or reach out to the community for support.

## [Android] `Error: duplicate resources` during `:app:mergeReleaseAssets`

An error like `Error: duplicate resources` during the `:app:mergeReleaseAssets` phase may occur if you have upgraded your React Native version from a version less than `0.82.0`, to a version greater than or equal to (>=) `0.82.0`. This is because RN 0.82.0 changed the path to which the JS bundle is written to from `build/generated/assets/createBundleReleaseJsAndAssets/` to `build/generated/assets/react/release/`, and analogously changed the path for `res/createBundleReleaseJsAndAssets/`. The brownfield Gradle plugin adds both directories to the source sets, potentially causing a conflict of artifacts. To fix this, just once clean your build directory (precisely, the `app/build/` directory) and rebuild the project. All subsequent builds should work fine.

## [iOS] `No script URL provided` in Release configuration

If you encounter this error, most likely you have missed a setup step and are missing `ReactNativeBrownfield.shared.bundle = ReactNativeBundle` before your call to `startReactNative`.
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,16 @@ object RNSourceSets {
}

private fun configureSourceSets() {
androidExtension.sourceSets.getByName("main") {
it.assets.srcDirs("$appBuildDir/generated/assets/createBundleReleaseJsAndAssets")
it.res.srcDirs("$appBuildDir/generated/res/createBundleReleaseJsAndAssets")
it.java.srcDirs("$moduleBuildDir/generated/autolinking/src/main/java")
androidExtension.sourceSets.getByName("main") { sourceSet ->
for (bundlePathSegment in listOf(
"createBundleReleaseJsAndAssets", // outputs for RN <= 0.81
"react/release" // outputs for RN >= 0.82
)) {
sourceSet.assets.srcDirs("${appBuildDir}/generated/assets/$bundlePathSegment")
sourceSet.res.srcDirs("$appBuildDir/generated/res/$bundlePathSegment")
}

sourceSet.java.srcDirs("$moduleBuildDir/generated/autolinking/src/main/java")
}

androidExtension.sourceSets.getByName("release") {
Expand Down
Loading