React-native, “Native module cannot be null”

前端 未结 12 1126
星月不相逢
星月不相逢 2020-12-09 14:42

I just upgrade React-native from 0.28 to 0.30, and get this error:

\"Native module cannot be null\".

The problem seem to be with the line/package:

12条回答
  •  伪装坚强ぢ
    2020-12-09 15:11

    1- In iOS message is 'Native module cannot be null'

    2- In Android message is 'null is not an object evaluating RNFSManager etc'

    Meaning is the same and solutions are different, for both cases you need to link native library manually.

    Solution for iOS is run pod install in iOS Directory, then react-native run-ios to re-run the app.

    Solution for android is react-native link react-native-fs then react-native run-android to re-run the app.

    Note: In android better is to open project in android studio again to avoid any inconvenience.

提交回复
热议问题