@@ -170,3 +170,62 @@ Please note, if you are choosing to not use a dependency manager, you must keep
170170 ```
171171
1721726 . ` pod install`
173+
174+ # ## "Failed to load [...] native module"
175+
176+ If you' re getting a `Failed to load [...] native module` error, it means that some native code hasn' t been injected to your native project.
177+
178+ # ### iOS
179+
180+ If you' re using Cocoapods, check that your `ios/Podfile` file contains the right pods :
181+
182+ - `Failed to load Analytics native module`, look for the core native module:
183+ ```ruby
184+ pod ' RNAnalytics ' , :path => ' ../ node_modules/ @segment / analytics- react- native'
185+ ```
186+ - `Failed to load [...] integration native module`, look for the integration native module, example with Google Analytics:
187+ ```ruby
188+ pod ' RNAnalyticsIntegration - Google - Analytics ' , :path => ' ../ node_modules/ @segment / analytics- react- native- google- analytics'
189+ ```
190+
191+ Also check that your `Podfile` is synchronized with your workspace, run `pod install` in your `ios` folder.
192+
193+ If you' re not using Cocoapods please check that you followed the [iOS support without CocoaPods ](# ios-support-without-cocoapods) instructions carefully.
194+
195+ # ### Android
196+
197+ Check that ` android/app/src/main/.../MainApplication.java` contains a reference to the native module :
198+
199+ - ` Failed to load Analytics native module` , look for the core native module :
200+
201+ ` ` ` java
202+ import com.segment.analytics.reactnative.core.RNAnalyticsPackage;
203+
204+ // ...
205+
206+ @Override
207+ protected List<ReactPackage> getPackages() {
208+ return Arrays.<ReactPackage>asList(
209+ new MainReactPackage(),
210+ // ...
211+ new RNAnalyticsPackage()
212+ );
213+ }
214+ ` ` `
215+
216+ - ` Failed to load [...] integration native module` , look for the integration native module , example with Google Analytics:
217+
218+ ` ` ` java
219+ import com.segment.analytics.reactnative.integration.google.analytics.RNAnalyticsIntegration_Google_AnalyticsPackage;
220+
221+ // ...
222+
223+ @Override
224+ protected List<ReactPackage> getPackages() {
225+ return Arrays.<ReactPackage>asList(
226+ new MainReactPackage(),
227+ // ...
228+ new RNAnalyticsIntegration_Google_AnalyticsPackage()
229+ );
230+ }
231+ ` ` `
0 commit comments