The time needed for this depends largely on the native module and the features you want. If you don't count the feature implementation (so only installing the native module) and if everything goes well, it should not take more than 1 hour.
However, some uncommon packages are more nasty than others on Android, or iOS, or both. So if you install a native module that was not yet used by BAM, I recommend to foresee 3 hours and a TIMEBOX.
Owner: Louis Lagrange
- A React Native app
- A native module you want to install
On Android the step "Make sure it builds well" means:
- build in debug (eg.
react-native run-android
) - build in release (eg.
cd android && ./gradlew assembleRelease
if you didn't edit the default configuration setup) - if it doesn't build well, see the troubleshooting part or ask for help.
On iOS, the step "Make sure it builds well" means:
- build in debug (eg.
react-native run-ios
) - build in release (eg.
react-native run-ios --configuration Release
if you didn't edit the default configuration setup) - if it doesn't build well, see the troubleshooting part or ask for help.
- Create your branch
- Open your project in XCode. It makes XCode happy as it reorganizes your `.pbxproj alphabetically among other things.
- Commit these changes (
.pbxproj
and/orInfo.plist
). This will make the work of your PR reviewer way more easier. yarn add the-native-module
- Commit (eg. "Add the-native-module to node_modules")
- Decide if you want to start with the Android part or the iOS part.
- You'll want to start with the easiest path, so that you can also implement the Javascript side (if there is one) and have a feature working completely for at least one platform.
- Most of the time, Android will be the easiest path, because it's faster to build and easier to debug.
- Follow the below paths depending on whether you chose to start with Android or iOS
Android first | iOS first |
---|---|
|
|
For iOS:
|
For Android:
|
Please make a PR or an issue (and ping the current owner) if you see any other common problems!
If you install a package that uses Google Play Services (com.google.android.gms
), you may encounter issues if you already use a package that needs them.
In order to fix the issues, you'll need to force using a specific version. To do so:
- Search for
com.google.android.gms
in yournode_modules
and filter in.gradle
files - For each dependency, in your
app/build.gradle
, exclude thecom.google.android.gms
group - For each dependency, in your
app/build.gradle
, add compilation of the specific version ofcom.google.android.gms
modules that are needed
Here's an example with:
react-native-maps
that needscom.google.android.gms:play-services-base
andcom.google.android.gms:play-services-maps
react-native-batch-push
that needscom.google.android.gms:play-services-base
andcom.google.android.gms:play-services-gcm
react-native-firebase
that needscom.google.android.gms:play-services-base
but doesn't include it in its dependencies so you don't have to exclude thecom.google.android.gms
group
# `implementation` is the new `compile` starting from Gradle 4
dependencies {
implementation(project(':react-native-maps')){
exclude group: 'com.google.android.gms'
}
implementation(project(':react-native-batch-push')){
exclude group: 'com.google.android.gms'
}
implementation(project(':react-native-firebase')) {
transitive = false
}
implementation "com.google.android.gms:play-services-base:11.4.2"
implementation "com.google.android.gms:play-services-maps:11.4.2"
implementation "com.google.android.gms:play-services-gcm:11.4.2"
implementation "com.google.firebase:firebase-core:11.4.2"
implementation "com.google.firebase:firebase-crash:11.4.2"
For a more general operating process on this, see Handle version conflicts between Gradle dependencies.
Linking adds Lottie-Screenshot
to the HEADER_SEARCH_PATHS
of each config in your .pbxproj
.
Remove it as it conflicts with other Lottie's headers and it is not needed for lottie-react-native
.