react-native-inappbrowser: I am getting null is not an object (evaluating 'RNInAppBrowser')

I have linked the RNInAppBrowser manually and it showing the error as "null is not an object (evaluating ‘RNInAppBrowser’)

Also If I run pod install it shows below error. But the RNInAppBrowser automatically shows in the pod file. I not added it manually.

[!] CocoaPods could not find compatible versions for pod “RNInAppBrowser”: In Podfile: RNInAppBrowser (from ../node_modules/react-native-inappbrowser-reborn)

Specs satisfying the RNInAppBrowser (from …/node_modules/react-native-inappbrowser-reborn) dependency were found, but they required a higher minimum deployment target.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments

@sadikyalcin as far as I know, this happens when Autolinking is not working as expected, can you try linking manually and let me know if this fix that problem? Thanks in advance!

@anagar23 @Devecstatic instead of put bad reactions, I invite you to attach the code of your project or send a link of your repository, have a happy new year! 👍

Try the last version 3.3.3! 👍

@sadikyalcin as far as I know, this happens when Autolinking is not working as expected, can you try linking manually and let me know if this fix that problem? Thanks in advance!

Thanks for the quick response. Ye manual linking seems to work.

For the newest version of ReactNative 0.69 The autolinking might not work so you need to just run pod install and that is it.

cd ios
pod install

This will auto-link it

@jdnichollsc I’m having the same issue. RN: 0.61.5

async openLink() {
    console.log('@browser: ', InAppBrowser);
    try {
      await InAppBrowser.isAvailable();
      InAppBrowser.open('https://www.google.com', {
        // iOS Properties
        dismissButtonStyle: 'cancel',
        preferredBarTintColor: 'gray',
        preferredControlTintColor: 'white',
        // Android Properties
        showTitle: true,
        toolbarColor: '#6200EE',
        secondaryToolbarColor: 'black',
        enableUrlBarHiding: true,
        enableDefaultShare: true,
        forceCloseOnRedirection: true,
      }).then(result => {
        Alert.alert(JSON.stringify(result));
      });
    } catch (error) {
      Alert.alert(error.message);
    }
  }

LOG @browser: {"close": [Function close], "closeAuth": [Function closeAuth], "isAvailable": [Function isAvailable], "open": [Function open], "openAuth": [Function openAuth]}

Screenshot 2020-04-20 at 16 14 51

Nevermind, I figured it out. I was adding it to a third party NPM when I should be also adding it to the client

I am using Xcode 10.1. Why it not worked in expo?