react-native-star-io10 icon indicating copy to clipboard operation
react-native-star-io10 copied to clipboard

Invariant: Native Module Cannot be Null (Expo)

Open mnm458 opened this issue 2 years ago • 9 comments

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 avatar Dec 08 '21 11:12 mnm458

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

mnm458 avatar Dec 08 '21 11:12 mnm458

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

gare-bear avatar Jan 18 '22 18:01 gare-bear

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.

kickbk avatar Jan 18 '22 20:01 kickbk

@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

gare-bear avatar May 26 '22 20:05 gare-bear

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.

kickbk avatar May 28 '22 18:05 kickbk

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

felipesoares6 avatar Aug 03 '22 18:08 felipesoares6

@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 avatar Oct 24 '22 15:10 jongbelegen

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

jongbelegen avatar Nov 01 '22 15:11 jongbelegen