star-micronics / react-native-star-io10

react-native-star-io10 is a library for supporting application development for Star Micronics devices.
Other
83 stars 54 forks source link

Invariant: Native Module Cannot be Null (Expo) #35

Closed mnm458 closed 2 months ago

mnm458 commented 2 years ago

Hi there,

I am trying to use this lib for a ios build and when debugging in metro I get the "Native Module Cannot be Null" error (please see screenshot attached). It goes away when I comment the printing code so it is definitely coming from this, I have installed npm package and have listed the package "react-native-star-io10" in my package.json as well but no luck.

I have been trying to solve this for a while, would greatly appreciate any help :)

image

mnm458 commented 2 years ago

I was able to get this working on a separate project (bare react-native workflow) as I ran pod install but I can't seem to get it to work in expo

gare-bear commented 2 years ago

I don't think this can run in Expo. Our SDK requires platform-specific features; Bluetooth and BLE to name a few.

kickbk commented 2 years ago

It should work with an Expo development client. You probably won't even need a config plugin looking at the install instructions Most likely just infoPlist/permission settings It would require some testing of course. Maybe @mnm458 or others have a device and wouldn't mind trying it out? If there are issues, please share with the Expo community via Discord. This could be a nice addition to expo.

gare-bear commented 2 years ago

@kickbk @mnm458 I came across some useful info in the React Native documentation.

From the Caveats section,

"Because you don't build any native code when using Expo to create a project, it's not possible to include custom native modules beyond the React Native APIs and components that are available in the Expo client app."

So until that changes from the React Native side, we will not be able to support the Expo client

kickbk commented 2 years ago

I already created (with the help of the expo team) a fork that works with a custom expo client. I just need to find the time to clean it up and share. It is highly likely that if you have a project that requires this library, you'd be ok with a custom Expo client. You'd be handling native via a config plugin.

felipesoares6 commented 1 year ago

Hey @kickbk I think I'm having the same issue, could you please share this fork?

jongbelegen commented 1 year ago

@felipesoares6 looks like this is the fork: https://github.com/star-micronics/react-native-star-io10/compare/master...kickbk:react-native-star-io10:master

jongbelegen commented 1 year ago

I made a fork that contains some of these fixes, you can try them out by using:

"react-native-star-io10": "https://github.com/jongbelegen/react-native-star-io10",

In your package.json

bandit-ibayashi commented 7 months ago

I have posted a workaround that we think is relevant to this issue at Issue #90. We would appreciate it if you could refer to this.

can-miki commented 2 months ago

Have you found a solution to this problem? We will close this issue once, but if the issue is still not resolved, please reopen it or post a new issue.