aclec / expo-zebra-scanner

11 stars 4 forks source link

Error when npm start. #4

Closed dragoslavIvkovic closed 1 year ago

dragoslavIvkovic commented 1 year ago

Android Bundling complete 2293ms ERROR Error: Cannot find native module 'ExpoZebraScanner', js engine: hermes ERROR Invariant Violation: "main" has not been registered. This can happen if:

aclec commented 1 year ago

Hi,

Have you created a custom expo development build ? You can't use my module in Expo GO because the native code is not include.

dragoslavIvkovic commented 1 year ago

No, I can't find solution with expo documentation.

aclec commented 1 year ago

https://docs.expo.dev/develop/development-builds/create-a-build/

dragoslavIvkovic commented 1 year ago

So I can't check my app on device every time I change something, I need to build every time?

aclec commented 1 year ago

It's a custom Expo GO but with the native code that you have added. Expo GO is a development build with all expo packages.

dragoslavIvkovic commented 1 year ago

Do have any documentation? I can't scan code on zebra device with this.

Your app just crashed. See the error below.
java.lang.RuntimeException: Error receiving broadcast Intent { act=com.symbol.datawedge.ACTION_BARCODE_SCANNED flg=0x10 (has extras) } in expo.modules.zebrascanner.BarcodeReceiver@6e89904
  android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1590)
  android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA.run(Unknown Source:2)
  android.os.Handler.handleCallback(Handler.java:938)
  android.os.Handler.dispatchMessage(Handler.java:99)
  android.os.Looper.loop(Looper.java:223)
  android.app.ActivityThread.main(ActivityThread.java:7747)
  java.lang.reflect.Method.invoke(Native Method)
  com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:952)
Caused by java.lang.IllegalArgumentException: Cannot create an event emitter for the module that isn't present in the module registry.
  expo.modules.kotlin.AppContext.eventEmitter(AppContext.kt:259)
  expo.modules.kotlin.modules.Module$moduleEventEmitter$2.invoke(Module.kt:21)
  expo.modules.kotlin.modules.Module$moduleEventEmitter$2.invoke(Module.kt:21)
  kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
  expo.modules.kotlin.modules.Module.getModuleEventEmitter(Module.kt:21)
  expo.modules.kotlin.modules.Module.sendEvent(Module.kt:28)
  expo.modules.zebrascanner.ExpoZebraScannerModule$definition$1$1$1.invoke(ExpoZebraScannerModule.kt:55)
  expo.modules.zebrascanner.ExpoZebraScannerModule$definition$1$1$1.invoke(ExpoZebraScannerModule.kt:55)
  expo.modules.zebrascanner.BarcodeReceiver.onReceive(ExpoZebraScannerModule.kt:31)
  android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1580)
  android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA.run(Unknown Source:2)
  android.os.Handler.handleCallback(Handler.java:938)
  android.os.Handler.dispatchMessage(Handler.java:99)
  android.os.Looper.loop(Looper.java:223)
  android.app.ActivityThread.main(ActivityThread.java:7747)
  java.lang.reflect.Method.invoke(Native Method)
  com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:952)
aclec commented 1 year ago

Have you created the DataWedge configuration like I said in the README and enroll the custom build in it on your zebra device ?

aclec commented 1 year ago

Are you using expo sdk 49 ?

dragoslavIvkovic commented 1 year ago

Thank you very much for your patience. Everything works perfectly now!! The problem was that there were two profiles with the same settings. I'm using 49.

nagy135 commented 2 months ago

Hello, can you please help me how to enable that Intent? I am pretty new to native development and message "Enable Intent bellow" doesnt help me much, can we add some link to relevant documentation? :)

aclec commented 2 months ago

Hello, can you please help me how to enable that Intent? I am pretty new to native development and message "Enable Intent bellow" doesnt help me much, can we add some link to relevant documentation? :)

Hi, In the dataWedge directory, you have screens of the configuration that you need to do

nagy135 commented 2 months ago

damn thanks, that will help for sure! ....just a note, I would never look there, if its supposed to be for documentation purpose, it should definitelly be in a folder "docs" or be linked in readme, to avoid confused people like me 😅