question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: null is not an object (evaluating '_reactNative.NativeModules.DialogAndroid.show'

See original GitHub issue

Hello I’m getting that error and I don’t understand why ?

Here is my code

_selectForm = async () => {
    try {
      const { selectedItem } = await DialogAndroid.showPicker('Pick a form', null, {
        items: [
          { label:'12 Months', id:'12-months' },
          { label:'16 Months', id:'16-months' },
          { label:'20 Months', id:'20-months' }
        ]
      });
      if (selectedItem) {
        // when negative button is clicked, selectedItem is not present, so it doesn't get here
        console.log('You selected item:', selectedItem);
        this.props.navigation.navigate("CollectingDataScreen", {
          form: selectedItem
        });
      }
    } catch(e) {
      console.log("DIALOG ANDROID EROOR ... ", e);
    }
  }

And after installing, the version from package.json is "react-native-dialogs": "^1.0.4"

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
vonovakcommented, Feb 10, 2020

this error is caused by the fact that the native module is not correctly linked; follow https://github.com/aakashns/react-native-dialogs#manual-linking or if you’re on RN0.60 or newer, compiling should just work because of autolinking

1reaction
TxusBlackcommented, May 6, 2019

Look, I’m having this error:

59443153_2066218993678616_583027078694174720_n

And in this case, my code is:

dialog = () => {
    const options = [
        { label: 'Most Votes (Likes + Dislikes)', value: 'thumbs' },
        { label: 'Most Likes', value: 'thumbs-up' },
        { label: 'Most Dislikes', value: 'thumbs-down' },
        { label: 'Recent Activity', value: 'recent' },
        { label: 'Most Comments', value: 'comments' },
        { label: 'Most Helpful Comments', value: 'helpful-comments' },
        { label: 'Cancel', value: 'cancel' }
      ];

      const { selectedItem } = await DialogAndroid.showPicker('im a title', null, {
        items: options.slice(0, options.length - 1), // no cancel button
        idKey: 'value',
        positiveText: null,
        negativeText: 'Cancel'
      });

      if (selectedItem) {
        // when negative button is clicked, selectedItem is not present, so it doesn't get here
        console.log('You picked:', selectedItem);
      }
}
<TouchableOpacity style={styles.lastItem} onPress={this.dialog}>
    <Text style={styles.name}>{this.state.notificationSelected}</Text>
</TouchableOpacity>
Read more comments on GitHub >

github_iconTop Results From Across the Web

null is not an object evaluating '_reactNative.NativeModules ...
If you are using expo, this issue occurs if you a running your app on a device that is running on iOS 14....
Read more >
null is not an object (evaluating '_reactNative.NativeModules ...
Hi I'm new to react native and I have an expo app that I am trying to use this package in in order...
Read more >
Android custom native module
I followed the steps but when i run expo start and scan the qr code i got this error : TypeError: null is...
Read more >
null is not an object (evaluating 'nativemodules[sqlite][method ...
I am trying to use the react-native-sqlite-storage library but I can't seem find any solution to this error. I have looked around for...
Read more >
null is not an object (evaluating 'RNPurchases ...
I installed the expo managed workflow and also followed the revenuecat/react-native-purchases guide and trying a simple code to setDebugLogs ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found