AllInOneYT / react-native-thermal-printer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[TypeError: null is not an object (evaluating 'ThermalPrinterModule.printTcp')]

marchetb opened this issue · comments

Hello !

In first place, thanks for the module !
But I'm facing an issue that I don't understand ?
I followed the README line by line and when I tried to print via Android Emulator, the try/catch show me the error that ThermalPrinterModule il null.

Any help ?

Best regards,

Hello first of all, make sure you re-run the whole app.

  1. Ctrl + C on your command line
  2. don't forget to stop the metro
  3. re-run the app, for me it is react native run-android or yarn android

Try to rebuild your application if it still doesn't work

Thanks Man !
My app was an old expo project and was ejected so I was starting the project with expo run:android
I tried react-native run-android and It works perfectly !

Interesting, I've never used expo before. Glad it worked :)

commented

Thanks Man ! My app was an old expo project and was ejected so I was starting the project with expo run:android I tried react-native run-android and It works perfectly !

Could you help me to do the same, i am trying to implement this in a expo app , now i did expo prebuild instead of eject , but so far i didnt managed to run this successfully

Thanks Man ! My app was an old expo project and was ejected so I was starting the project with expo run:android I tried react-native run-android and It works perfectly !

Could you help me to do the same, i am trying to implement this in a expo app , now i did expo prebuild instead of eject , but so far i didnt managed to run this successfully

Hi,,
it's been a while since I haven't done any expo/react-native coding. I don't know about new things of expo, but at the time of this ticket, ejecting the app out of expo was mandatory.

I see that expo eject is deprecated now. But I remember something about autolinking native modules ?
Or you can try npx expo prebuild with the --clean flag ?