Skip to content

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

@gararanjeet

Description

@gararanjeet

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions