-
Notifications
You must be signed in to change notification settings - Fork 71
Description
Hi team,
I tried creating a simple Native Module for react native using this library for my application.
The following is the build.gradle dependence.
dependencies{ implementation group: 'org.cups4j', name: 'cups4j', version: '0.7.9 }
The following is the method that is causing the issue
@ReactMethod
public static void connectToPrinter(String printUrl, Promise promise) {
CupsPrinter cupsPrinter = null;
try{
String address = getAddress(printUrl);
CupsClient cupsClient = new CupsClient(address, 631);
URL printerURL = new URL(printUrl);
cupsPrinter = cupsCllient.getPrinter(printerURL);
}
catch(Exception e){
Log.d("cups", e.getMessage())
}
This is how I'm calling this method
const {CUPSModule} = NativeModules;
const connectToPrinter = async url => {
console.log(CUPSModule);
let res = await CUPSModule.connectToPrinter(url);
console.log(res);
};
The following is the error when calling the method.

react-native : 0.70.14
gradle version: 7.5.1