1

I've installed react-native-localization in my react native project (v0.6). Library is not supporting autolinker yet so I need to disable it for iOS and Android in react-native.config.js.

I already tried to add dependencies in react-native.config.js. After that, I did react-native link react-native-localization command and build an app.

This is my react-native.config.js file:

'use strict';

const ios = require('@react-native-community/cli-platform-ios');
const android = require('@react-native-community/cli-platform-android');

module.exports = {
  dependencies: {
    'react-native-localization': {
      platforms: {
        android: null, // disable Android platform, other platforms will still autolink if provided
        ios: null,
      },
    },
  },
  commands: [...ios.commands, ...android.commands],
  platforms: {
    ios: {
      linkConfig: ios.linkConfig,
      projectConfig: ios.projectConfig,
      dependencyConfig: ios.dependencyConfig,
    },
    android: {
      linkConfig: android.linkConfig,
      projectConfig: android.projectConfig,
      dependencyConfig: android.dependencyConfig,
    },
  },
  /**
   * Used when running RNTester (with React Native from source)
   */
  reactNativePath: '.',
  project: {
    ios: {
      project: './RNTester/RNTester.xcodeproj',
    },
    android: {
      sourceDir: './RNTester',
    },
  },
};

Error in simulator says: "Please check your configuration. Did you run 'react-native link'?

Bartson
  • 93
  • 1
  • 8

1 Answers1

0

As now, react-native has added the support for CocoaPods inside of his projects. (https://github.com/facebook/react-native/releases)

Sadly, i don't know why, but the autolinking feature never works for me on iOS but always goes trough in Android. The only solution i found is to do a react-native link only for iOS (renaming the android folder to something else), then do cd ios and pod install. After that, in the majority of the cases, it would work out of the box, while other libs needs still to be updated to have a full integration with RN 0.60.

Hope all this will be fixed soon but until that we only have to wait and hope that the libs work without any other complications

Auticcat
  • 4,359
  • 2
  • 13
  • 28