You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/autolinking.md
+5-12Lines changed: 5 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ Each platform defines its own [`platforms`](./platforms.md) configuration. It in
29
29
30
30
## Platform iOS
31
31
32
-
The [react-native/scripts/react_native_pods.rb](https://github.com/facebook/react-native/blob/master/packages/react-native/scripts/react_native_pods.rb) script required by `Podfile`requires the [native_modules.rb](https://github.com/react-native-community/cli/blob/main/packages/cli-platform-ios/native_modules.rb) script, which gets the package metadata from `react-native config` during install phase and:
32
+
The [react-native/scripts/react_native_pods.rb](https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb) script required by `Podfile` gets the package metadata from `react-native config` command during install phase and:
33
33
34
34
1. Adds dependencies via CocoaPods dev pods (using files from a local path).
35
35
1. Adds build phase scripts to the App project’s build phase. (see examples below)
@@ -44,11 +44,11 @@ See example usage in React Native template's [Podfile](https://github.com/react-
44
44
45
45
## Platform Android
46
46
47
-
The [native_modules.gradle](https://github.com/react-native-community/cli/blob/main/packages/cli-platform-android/native_modules.gradle) script is included in your project's `settings.gradle` and `app/build.gradle`files and:
47
+
The [`autolinkLibrariesWithApp`](https://github.com/facebook/react-native/blob/8c50bf0beb17ced7fdafeae7a734edfc03e6e0b2/packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt#L162) function from React Native Gradle Plugin (RNGP) must be registered in your project's `settings.gradle`file and called in `app/build.gradle`file and:
48
48
49
49
1. At build time, before the build script is run:
50
-
1.A first Gradle plugin (in `settings.gradle`) runs `applyNativeModulesSettingsGradle` method. It uses the package metadata from `react-native config` to add Android projects.
51
-
1.A second Gradle plugin (in `app/build.gradle`) runs `applyNativeModulesAppBuildGradle` method. It creates a list of React Native packages to include in the generated `/android/build/generated/rn/src/main/java/com/facebook/react/PackageList.java` file.
50
+
1.RNGP plugin registered in `settings.gradle` runs `autolinkLibrariesFromCommand()` method. It uses the package metadata from `react-native config` to add Android projects.
51
+
1.Then in `app/build.gradle` it runs `autolinkLibrariesWithApp()` method. It creates a list of React Native packages to include in the generated `/android/build/generated/rn/src/main/java/com/facebook/react/PackageList.java` file.
52
52
1. When the new architecture is turned on, the `generateNewArchitectureFiles` task is fired, generating `/android/build/generated/rn/src/main/jni` directory with the following files:
53
53
-`Android-rncli.cmake` – creates a list of codegen'd libs. Used by the project's `CMakeLists.txt`.
54
54
-`rncli.cpp` – registers codegen'd Turbo Modules and Fabric component providers. Used by `MainApplicationModuleProvider.cpp` and `MainComponentsRegistry.cpp`.
@@ -68,7 +68,7 @@ See example usage in React Native template:
68
68
69
69
You’re already using Gradle, so Android support will work by default.
70
70
71
-
On the iOS side, you will need to ensure you have a Podspec to the root of your repo. The `react-native-webview` Podspec is a good example of a [`package.json`](https://github.com/react-native-community/react-native-webview/blob/master/react-native-webview.podspec)-driven Podspec. Note that CocoaPods does not support having `/`s in the name of a dependency, so if you are using scoped packages - you may need to change the name for the Podspec.
71
+
On the iOS side, you will need to ensure you have a Podspec to the root of your repo. The `react-native-webview` Podspec is a good example of a [`package.json`](https://github.com/react-native-community/react-native-webview/blob/main/react-native-webview.podspec)-driven Podspec. Note that CocoaPods does not support having `/`s in the name of a dependency, so if you are using scoped packages - you may need to change the name for the Podspec.
72
72
73
73
### Pure C++ libraries
74
74
@@ -167,13 +167,6 @@ module.exports = {
167
167
168
168
There is nothing extra you need to do - monorepos are supported by default.
169
169
170
-
Please note that in certain scenarios, such as when using Yarn workspaces, your packages might be hoisted to the root of the repository. If that is the case, please make sure that the following paths are pointing to the
171
-
correct location and update them accordingly:
172
-
173
-
- path to `native_modules.rb` in your `ios/Podfile` (the right path should be resolved automatically in react-native >0.73)
174
-
- path to `native_modules.gradle` in your `android/settings.gradle`
175
-
- path to `native_modules.gradle` in your `android/app/build.gradle`
176
-
177
170
Dependencies are only linked if they are listed in the package.json of the mobile workspace, where "react-native" dependency is defined. For example, with this file structure:
0 commit comments