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

Problem with installing #26

Closed MonstroDev closed 2 years ago

MonstroDev commented 2 years ago

I created a new project (expo bare workflow) and installed react-native-star-io10, after I created a screen based on this example And when I click on "Discovery" button, I was faced with the next error:

Error: TypeError: null is not an object (evaluating '_reactNative.NativeModules.StarDeviceDiscoveryManagerWrapper.init')

Also, I tried to start an example from this repo, but was faced with the same error. I tested only on Android

Any idea what I'm doing wrong?

Tdfrantz commented 2 years ago

I've been fighting the same issue the past couple of days. I think what the problem is, is that expo is not supported. You have to eject (I guess that's the right term) expo and have it build everything natively. In other words, I got it to work by running expo run:android. Note that it will fail the first time (or it did for me at least) because the minimum SDK needs to be set to 23 and by default it is 21, so you can change that in the generated build.gradle file in the android folder and rerun the expo run:android command, and then all should be good.

MonstroDev commented 2 years ago

Hi @Tdfrantz, yes, I found the same solution a few days ago, and all works well. Thanks