januslo / react-native-bluetooth-escpos-printer

React-Native plugin for the bluetooth ESC/POS & TSC printers.
MIT License
368 stars 425 forks source link

Undefined is not an object BluetoothTscPrinter.Direction #43

Open savageangelz opened 5 years ago

savageangelz commented 5 years ago

hello, i added your package through yarn add, does adding that way causing the library to break or something?

i don't really use BluetoothTscPrinter on my screen, even tho i excluded it. the error came from index.js in the library.

Screenshot_20190403-125830_Aulia

my MainApplication.java `package com.rnfirebasedemo;

import android.app.Application;

import com.facebook.react.ReactApplication; import cn.jystudio.bluetooth.RNBluetoothEscposPrinterPackage; import com.learnium.RNDeviceInfo.RNDeviceInfo; import com.oblador.vectoricons.VectorIconsPackage; import com.kishanjvaghela.cardview.RNCardViewPackage; import com.swmansion.gesturehandler.react.RNGestureHandlerPackage; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.react.shell.MainReactPackage; import com.facebook.soloader.SoLoader;

import java.util.Arrays; import java.util.List;

public class MainApplication extends Application implements ReactApplication {

private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { @Override public boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; }

@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
        new RNBluetoothEscposPrinterPackage(),
        new RNDeviceInfo(),
        new VectorIconsPackage(),
        new RNCardViewPackage(),
        new RNGestureHandlerPackage()
  );
}

@Override
protected String getJSMainModuleName() {
  return "index";
}

};

@Override public ReactNativeHost getReactNativeHost() { return mReactNativeHost; }

@Override public void onCreate() { super.onCreate(); SoLoader.init(this, / native exopackage / false); } } `

my MainActivity.java `package com.rnfirebasedemo; import android.content.Intent;

import com.facebook.react.ReactActivity;

public class MainActivity extends ReactActivity { /**

Would be grateful if anyone could provide any solution for this. thanks!

savageangelz commented 5 years ago

Found the solution for this problem, falling back to 0.0.4 resolve the error. Looking forward for the bugfix! (Y)

januslo commented 5 years ago

what is your RN version, 0.0.4-0.0.5 just update example RN version to 0.57.8, nothing more.

nowarzz commented 5 years ago

I have same problems

nowarzz commented 5 years ago

Sorry. I forgot to run to android... It solved after I re-run to android

harnie2275 commented 2 years ago

I am facing the same issues for a month now. Please I need help, using it for a vital project.

My RN version is "react-native": "0.65.1",

Simulator Screen Shot - iPhone 12 - 2021-12-10 at 13 54 58