Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove additional config steps required when running Fabric version on Android #1322

Merged
merged 5 commits into from Feb 17, 2022

Conversation

kmagiera
Copy link
Member

@kmagiera kmagiera commented Feb 15, 2022

Description

This PR simplifies the installation process on Android when using Fabric by removing the step when cpp dependency needs to be manually added to the main app's Android.mk file and also getting rid of the registry call that was ought to be added to ReactNativeHost implementation.

Changes

The following changes has been made:

  1. Added ndk step to the screens library configuration on Android (only when fabric is enabled) + ndk build options
  2. Setup main library's Android.mk such that it can see RN's dependencies from ReactAndroid folder
  3. Load screens native library directly from ScreensPackage which is loaded thanks to autolinking mechanism
  4. Register native components with Fabric's component registry directly in JNI init function such that they are installed when shared library is loaded
  5. Updated instructions how screens can be used with Fabric

Test code and steps to reproduce

Tested this in the following scenarios:

  • build & run FabricExample
  • build & run Example app
  • create new RN68 project, enable fabric, add screens, build & install

@kmagiera kmagiera requested a review from Ubax February 15, 2022 15:28
README-Fabric.md Outdated Show resolved Hide resolved
android/build.gradle Outdated Show resolved Hide resolved
README-Fabric.md Outdated Show resolved Hide resolved
android/build.gradle Outdated Show resolved Hide resolved
@kmagiera kmagiera changed the title Move native lib compilation to screens library project on Android Remove additional config steps required when running Fabric version on Android Feb 16, 2022
Copy link
Contributor

@Ubax Ubax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me

README-Fabric.md Outdated
1. Add latest react-native-screens
2. on iOS
- Install pods using `RCT_NEW_ARCH_ENABLED=1 pod install` (iOS only)
- Install pods using `RCT_NEW_ARCH_ENABLED=1 pod install` – this is a ste
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be this is the same as in Fabric app?

Copy link
Member

@kacperkapusciak kacperkapusciak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Copy link
Contributor

@Ubax Ubax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 🚀
Just fix the typo in docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants