React-native-navigation: v3 react-native auto linking broken only on Android

Created on 16 Oct 2019  路  4Comments  路  Source: wix/react-native-navigation

Issue Description

Hello! I am using react-native-navigation v3. Android auto-linked Native modules no longer work.

Steps to Reproduce / Code Snippets / Screenshots

  1. Set up v3 react-native-navigation
  2. Add a native module like Async Storage
  3. Android application throws errors about the native module.

This is true for react-native-async-storage, react-native-cookies, react-native-device-info


Environment

  • React Native Navigation version: ^3.2.0
  • React Native version: 0.61.1
  • Platform(s) (iOS, Android, or both?): Android
  • Device info (Simulator/Device? OS version? Debug/Release?): Emulator, Pixel XL API 29

Most helpful comment

Awesome thank you @JongtaekChoi and @heroic.

For future reference:

@Override
public List<ReactPackage> createAdditionalReactPackages() {
  return new PackageList(this).getPackages();
}

Fixes auto linking in v3.

All 4 comments

Does your MainApplication.java file include the following line?

new PackageList(this).getPackages() 

I think it must be included to auto-link native packages.
But I cannot find it at react-native-navigation v3.
I don't know it is the right way but I added this snippet to createAdditionalReactPackages() method.

Yeah. I was having the same error. Recheck your MainApplication.java. @JongtaekChoi 's changes will help.

Got it thanks! I鈥檒l try this out today, let you know how it goes.

Awesome thank you @JongtaekChoi and @heroic.

For future reference:

@Override
public List<ReactPackage> createAdditionalReactPackages() {
  return new PackageList(this).getPackages();
}

Fixes auto linking in v3.

Was this page helpful?
0 / 5 - 0 ratings