Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

“Native module cannot be null” #7

Open
labadze opened this issue Sep 24, 2018 · 9 comments
Open

“Native module cannot be null” #7

labadze opened this issue Sep 24, 2018 · 9 comments

Comments

@labadze
Copy link

labadze commented Sep 24, 2018

Hello, I'm trying to implement PassKit wallet to my app. I'm using expo, so. where is no iOS Android folders, so I'm getting this error “Native module cannot be null”, This error is located in PassKit.ios.js on line 10.
After this I detached app and implemented everything like in. manual but getting same error.

@ikas
Copy link

ikas commented Oct 22, 2018

Having the same problem, in simulator works fine, but on real iOS device throws "Native module cannot be null."

@VamshiKyra
Copy link

pod 'react-native-passkit-wallet', :path => '../node_modules/react-native-passkit-wallet' in Pod file =>
pod install

@labadze
Copy link
Author

labadze commented Mar 9, 2019

Wrote native wallet implementation and implemented it.

@alvarosilvac
Copy link

Still having issues after linking it directly in the Pod file. Any other solution?

@miyabi
Copy link
Owner

miyabi commented May 5, 2019

I couldn't reproduce the error.

This is how I tested:

$ react-native init RNPW
$ cd RNPW
$ npm i --save react-native-passkit-wallet@git://github.com/miyabi/react-native-passkit-wallet.git
$ cd ios
$ pod init
# Follow this instruction: https://github.com/miyabi/react-native-passkit-wallet#cocoapods
# Remove RNPW-tvOSTests block from the target 'RNPW'
$ pod install

App.js would be like this:

import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View} from 'react-native';
import PassKit, { AddPassButton } from 'react-native-passkit-wallet'

type Props = {};
export default class App extends Component<Props> {
  componentDidMount() {
    PassKit.canAddPasses()
      .then((result) => {
        console.log(result)
      });
  }

  render() {
    return (
      <View style={styles.container}>
        <AddPassButton
          style={styles.addPassButton}
          addPassButtonStyle={PassKit.AddPassButtonStyle.black}
          onPress={() => { console.log('onPress') }}
        />
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  addPassButton: {
    width: PassKit.AddPassButtonWidth,
    height: PassKit.AddPassButtonHeight,
  },
});

Could you provide more details?

@liuxiaofeng1981
Copy link

liuxiaofeng1981 commented Apr 4, 2020

Hello all, I'm having the same error 'Native module cannot be null'. And I'm new to RN and I'm using Expo. Is there a way to use this package in an Expo app without ejecting?

@liuxiaofeng1981
Copy link

Hi @labadze , could you share how you got around this issue pls?

@luluhoc
Copy link

luluhoc commented Nov 18, 2022

having the same problem with expo

@ottosamatori
Copy link

news about this problems ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants