harwey / cups4j

Cups4j Java printing library for CUPS/IPP
http://cups4j.org
GNU Lesser General Public License v3.0
130 stars 64 forks source link

Failed resolution of: Lorg/apache/http/client/config/RequestConfig; #74

Open gararanjeet opened 11 months ago

gararanjeet commented 11 months ago

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. WhatsApp Image 2023-11-03 at 01 04 08

react-native : 0.70.14 gradle version: 7.5.1