React-native-i18n: Undefined is not an object (evaluating 'RNI18n.getLanguages')

Created on 28 Nov 2017  路  13Comments  路  Source: AlexanderZaytsev/react-native-i18n

This is the same as https://github.com/AlexanderZaytsev/react-native-i18n/issues/114 and https://github.com/AlexanderZaytsev/react-native-i18n/issues/130, which were closed without a solution.

This appears to be a linking issue, since the 'react-native-i18n module is not correctly linked' warning message is logged to the console.

Steps:

(following the setup instructions from the readme)

React Native - 0.37.0
Xcode 9.1

  1. npm install react-native-i18n --save
  2. react-native link
  3. react-native run-ios
  4. Import a file in your project that contains import I18n from 'react-native-i18n';

screen shot 2017-11-27 at 8 21 54 pm

When manually building the project from Xcode and not through the react native cli, everything works fine.

Most helpful comment

@zoontek What happened with the version? The link doesn't work and I can't find the version.

All 13 comments

Im having this issue too.

+1

I think react-native link has been breaking builds recently

For me as well the error occurs. Although build works fine with XCode as mentioned.

This is why native development seems to be best option.

+1

+1

I understand react-native link will modify your Podfile if your dependent packages contain a podspec.

I assume this means the react-native-i18n podspec is broken?

It should be fixed in the new version: https://github.com/AlexanderZaytsev/react-native-i18n/releases/tag/v2.1.0 :)

@zoontek What happened with the version? The link doesn't work and I can't find the version.

So was it fixed? The post by @zoontek says it will be fixed in v2.2.0 but I see the latest version as 2.0.12. Any way we can help to fix?

The version introduce a regression. The next version was the one linked.

Are you all using a Podfile?

I'm using Expo, so no Podfiles for me :).

You can't use this lib with Expo, that's probably why :)

Was this page helpful?
0 / 5 - 0 ratings