react-native-star-io10
react-native-star-io10 copied to clipboard
Invariant: Native Module Cannot be Null (Expo)
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 :)
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
I don't think this can run in Expo. Our SDK requires platform-specific features; Bluetooth and BLE to name a few.
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 @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
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.
Hey @kickbk I think I'm having the same issue, could you please share this fork?
@felipesoares6 looks like this is the fork: https://github.com/star-micronics/react-native-star-io10/compare/master...kickbk:react-native-star-io10:master
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