januslo / react-native-bluetooth-escpos-printer

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

Could not resolve all dependencies for configuration ':react-native-bluetooth-printer:classpath' #207

Open pravin190786 opened 1 year ago

pravin190786 commented 1 year ago

I am using "react-native": "0.67.4", image

chaudev commented 1 year ago

This is also a big problem for me, I tried changing gradle version and it still fails

pravin190786 commented 1 year ago

Hi @Team is there any fix in progress on this issue

cgm-yemyatthu commented 1 year ago

I do have a same problem yesterday..In case if you have not solved this yet..Plese go to note_modules/react-native-bluetooth-escpos-printer/android/build.gradle and change the line that start with http to https or set allowInsecureProtocol= true. jcenter { url "http//jcenter.bintray.com/" } to jcenter { url "https//jcenter.bintray.com/" } OR jcenter { url "http//jcenter.bintray.com/" ;allowInsecureProtocol = true}.Change the other lines like that as well.

pravin190786 commented 1 year ago

Hi @CGM-YeMyatThu I have made the changes as per your comments still same issue PFA screenshot Using jcenter { url "https//jcenter.bintray.com/" } image

Using jcenter { url "http//jcenter.bintray.com/" ;allowInsecureProtocol = true} image

cgm-yemyatthu commented 1 year ago

I think what you need to update is ..change all those http to https ..in your case ..Error message changed from jcenter to repo.spring.io ..so changes those lines as well..Seem like there is already a PR for this issue..Please check this out https://github.com/januslo/react-native-bluetooth-escpos-printer/pull/181/files

pravin190786 commented 1 year ago

Thanks @CGM-YeMyatThu for the reply

pravin190786 commented 1 year ago

Now getting some other error image

zhenguet commented 1 year ago

This is "react-native-bluetooth-escpos-printer: ^0.0.5"'s error.

error: cannot find symbol import android.support.v4.app.ActivityCompat;

open node_modules\react-native-bluetooth-escpos-printer\android\src\main\java\cn\jystudio\bluetooth\RNBluetoothManagerModule.java and replace

android.support.v4.app.ActivityCompat;
android.support.v4.content.ContextCompat;

to

import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;

visit issues 188

Could not resolve all dependencies for configuration ':react-native-bluetooth-escpos-printer:classpath

open node_modules\react-native-bluetooth-escpos-printer\android\build.gradle and replace as Pull request

visit issues 198

zhenguet commented 1 year ago

Now getting some other error image

with this error. I just start project again.

Roz1c commented 1 year ago

This is "react-native-bluetooth-escpos-printer: ^0.0.5"'s error.

error: cannot find symbol import android.support.v4.app.ActivityCompat;

open node_modules\react-native-bluetooth-escpos-printer\android\src\main\java\cn\jystudio\bluetooth\RNBluetoothManagerModule.java and replace

android.support.v4.app.ActivityCompat;
android.support.v4.content.ContextCompat;

to

import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;

visit issues 188

Could not resolve all dependencies for configuration ':react-native-bluetooth-escpos-printer:classpath

open node_modules\react-native-bluetooth-escpos-printer\android\build.gradle and replace as Pull request

visit issues 198

I followed your answer and now I'm getting this error: image

pravin190786 commented 1 year ago

Hi Team, This library is having some issues so i have dropped this library implementation

Now I have used NeptuneLiteAPI I have integrated React Native and android native code for printing and its working fine

Thanks for your responses...!

amerytcl97 commented 1 year ago

This is "react-native-bluetooth-escpos-printer: ^0.0.5"'s error.

error: cannot find symbol import android.support.v4.app.ActivityCompat;

open node_modules\react-native-bluetooth-escpos-printer\android\src\main\java\cn\jystudio\bluetooth\RNBluetoothManagerModule.java and replace

android.support.v4.app.ActivityCompat;
android.support.v4.content.ContextCompat;

to

import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;

visit issues 188

Could not resolve all dependencies for configuration ':react-native-bluetooth-escpos-printer:classpath

open node_modules\react-native-bluetooth-escpos-printer\android\build.gradle and replace as Pull request visit issues 198

I followed your answer and now I'm getting this error: image

Can you try above solution by changing all http to https and also commenting out compile fileTree line below in

node_modules -> react-native-bluetooth-escpos-printer -> android -> build.gradle

Screenshot 2022-11-06 at 1 55 53 AM

After doing that, clean gradle and re run project. Hope it helps

r083rt commented 1 year ago

This is "react-native-bluetooth-escpos-printer: ^0.0.5"'s error.

error: cannot find symbol import android.support.v4.app.ActivityCompat;

open node_modules\react-native-bluetooth-escpos-printer\android\src\main\java\cn\jystudio\bluetooth\RNBluetoothManagerModule.java and replace

android.support.v4.app.ActivityCompat;
android.support.v4.content.ContextCompat;

to

import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;

visit issues 188

Could not resolve all dependencies for configuration ':react-native-bluetooth-escpos-printer:classpath

open node_modules\react-native-bluetooth-escpos-printer\android\build.gradle and replace as Pull request visit issues 198

I followed your answer and now I'm getting this error: image

Can you try above solution by changing all http to https and also commenting out compile fileTree line below in

node_modules -> react-native-bluetooth-escpos-printer -> android -> build.gradle

Screenshot 2022-11-06 at 1 55 53 AM

After doing that, clean gradle and re run project. Hope it helps

Still not working for me. I'm giving up. Does anyone had solutions for bluetooth escpos beside this library ?

Roz1c commented 1 year ago

I ended up using react-native-thermal-receipt-printer.

FelixGonzalo commented 1 year ago

This is "react-native-bluetooth-escpos-printer: ^0.0.5"'s error.

error: cannot find symbol import android.support.v4.app.ActivityCompat;

open node_modules\react-native-bluetooth-escpos-printer\android\src\main\java\cn\jystudio\bluetooth\RNBluetoothManagerModule.java and replace

android.support.v4.app.ActivityCompat;
android.support.v4.content.ContextCompat;

to

import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;

visit issues 188

Could not resolve all dependencies for configuration ':react-native-bluetooth-escpos-printer:classpath

open node_modules\react-native-bluetooth-escpos-printer\android\build.gradle and replace as Pull request visit issues 198

I followed your answer and now I'm getting this error: image

Can you try above solution by changing all http to https and also commenting out compile fileTree line below in node_modules -> react-native-bluetooth-escpos-printer -> android -> build.gradle

Screenshot 2022-11-06 at 1 55 53 AM

After doing that, clean gradle and re run project. Hope it helps

Still not working for me. I'm giving up. Does anyone had solutions for bluetooth escpos beside this library ?

Change the comment to the following and it works for me implementation fileTree(dir: 'libs', include: ['*.jar'])

amilaupendra commented 1 year ago

when i build the apk. this error comes ...

Execution failed for task ':react-native-bluetooth-escpos-printer:verifyReleaseResources'.

A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action Android resource linking failed ERROR:C:\Users\A-PC\Desktop\RN-PRINT\rn-3\BluetoothPrinter\node_modules\react-native-bluetooth-escpos-printer\android\build\intermediates\merged_res\release\values\values.xml:2732: AAPT: error: resource android:attr/lStar not found.

jcfarias-c commented 11 months ago

Hello community, I have detected that the error when compiling the library is because the repository "jcenter.bintray.com" is no longer working and the other repository "repo.spring.io/plugins-release/" has changed its reference "https://spring.io/blog/2022/12/14/notice-of-permissions-changes-to-repo-spring-io-january-2023"

I have tried to change in this file node_modules\react-native-bluetooth-escpos-printer\android\build.gradle

references to repositories https://jitpack.io/ and https://repo.spring.io/plugins-snapshot/

buildscript {
    repositories {
        google()
         //jcenter { url "http://jcenter.bintray.com/", allowInsecureProtocol = true  }
        // maven {url "http://repo.spring.io/plugins-release/", allowInsecureProtocol = true }
        maven { url "https://jitpack.io/" }
        maven {url "https://repo.spring.io/plugins-snapshot/"}
        mavenCentral()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        maven {
            url 'https://maven.google.com'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'
    }
}

that in both places but when compiling the app it keeps taking the repo "jcenter.bintray.com"

Do you know how they can be changed?

WerllenTrindade commented 11 months ago

After 2 days will be listing the process of how it worked for me.

"react": "18.2.0", "react-native": "^0.71.8", "react-native-bluetooth-escpos-printer": "https://github.com/januslo/react-native-bluetooth-escpos-printer.git",

After installation and standard configuration in native android, go to build.gradlew and paste the following code, '.../node modules/react-native-bluetooth-escpos-printer/android/build.gradlew'.

  1. code listed below `buildscript { repositories { jcenter { url "https://jcenter.bintray.com/" } maven {url "https://repo.spring.io/plugins-release/"} mavenCentral() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url "$rootDir/../node_modules/react-native/android" } maven { url 'https://maven.google.com' } } dependencies { classpath 'com.android.tools.build:gradle:3.1.4' // classpath("com.android.tools.build:gradle:7.0.4") } }

    apply plugin: 'com.android.library'

    android { compileSdkVersion = 33 buildToolsVersion = "33.0.0"

    defaultConfig {
        minSdkVersion = 21
        targetSdkVersion = 31
        versionCode 1
        versionName "1.0"
    }
    lintOptions {
        abortOnError false
    }
    sourceSets {
        main {
            aidl.srcDirs = ['src/main/java']
        }
    }

    }

    repositories { jcenter { url "https://jcenter.bintray.com/" } maven {url "https://repo.spring.io/plugins-release/"} mavenCentral() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url "$rootDir/../node_modules/react-native/android" } maven { url 'https://maven.google.com' } }

    dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.facebook.react:react-native:+' // From node_modules implementation group: 'com.android.support', name: 'support-v4', version: '27.0.0' implementation "com.google.zxing:core:3.3.0" }`

Right after this process you go to, 'node_modules\react-native-bluetooth-escpos-printer\android\src\main\java\cn\jystudio\bluetooth\RNBluetoothManagerModule.java'

de: android.support.v4.app.ActivityCompat; android.support.v4.content.ContextCompat;

you change to: import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat;

ayumixlain commented 2 months ago

After 2 days will be listing the process of how it worked for me.

"react": "18.2.0", "react-native": "^0.71.8", "react-native-bluetooth-escpos-printer": "https://github.com/januslo/react-native-bluetooth-escpos-printer.git",

After installation and standard configuration in native android, go to build.gradlew and paste the following code, '.../node modules/react-native-bluetooth-escpos-printer/android/build.gradlew'.

  1. code listed below `buildscript { repositories { jcenter { url "https://jcenter.bintray.com/" } maven {url "https://repo.spring.io/plugins-release/"} mavenCentral() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url "$rootDir/../node_modules/react-native/android" } maven { url 'https://maven.google.com' } } dependencies { classpath 'com.android.tools.build:gradle:3.1.4' // classpath("com.android.tools.build:gradle:7.0.4") } } apply plugin: 'com.android.library' android { compileSdkVersion = 33 buildToolsVersion = "33.0.0"

    defaultConfig {
        minSdkVersion = 21
        targetSdkVersion = 31
        versionCode 1
        versionName "1.0"
    }
    lintOptions {
        abortOnError false
    }
    sourceSets {
        main {
            aidl.srcDirs = ['src/main/java']
        }
    }

    } repositories { jcenter { url "https://jcenter.bintray.com/" } maven {url "https://repo.spring.io/plugins-release/"} mavenCentral() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url "$rootDir/../node_modules/react-native/android" } maven { url 'https://maven.google.com' } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.facebook.react:react-native:+' // From node_modules implementation group: 'com.android.support', name: 'support-v4', version: '27.0.0' implementation "com.google.zxing:core:3.3.0" }`

Right after this process you go to, 'node_modules\react-native-bluetooth-escpos-printer\android\src\main\java\cn\jystudio\bluetooth\RNBluetoothManagerModule.java'

de: android.support.v4.app.ActivityCompat; android.support.v4.content.ContextCompat;

you change to: import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat;

it work for me!!!

matheusmhq commented 1 month ago

After 2 days will be listing the process of how it worked for me.

"react": "18.2.0", "react-native": "^0.71.8", "react-native-bluetooth-escpos-printer": "https://github.com/januslo/react-native-bluetooth-escpos-printer.git",

After installation and standard configuration in native android, go to build.gradlew and paste the following code, '.../node modules/react-native-bluetooth-escpos-printer/android/build.gradlew'.

  1. code listed below `buildscript { repositories { jcenter { url "https://jcenter.bintray.com/" } maven {url "https://repo.spring.io/plugins-release/"} mavenCentral() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url "$rootDir/../node_modules/react-native/android" } maven { url 'https://maven.google.com' } } dependencies { classpath 'com.android.tools.build:gradle:3.1.4' // classpath("com.android.tools.build:gradle:7.0.4") } } apply plugin: 'com.android.library' android { compileSdkVersion = 33 buildToolsVersion = "33.0.0"

    defaultConfig {
        minSdkVersion = 21
        targetSdkVersion = 31
        versionCode 1
        versionName "1.0"
    }
    lintOptions {
        abortOnError false
    }
    sourceSets {
        main {
            aidl.srcDirs = ['src/main/java']
        }
    }

    } repositories { jcenter { url "https://jcenter.bintray.com/" } maven {url "https://repo.spring.io/plugins-release/"} mavenCentral() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url "$rootDir/../node_modules/react-native/android" } maven { url 'https://maven.google.com' } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.facebook.react:react-native:+' // From node_modules implementation group: 'com.android.support', name: 'support-v4', version: '27.0.0' implementation "com.google.zxing:core:3.3.0" }`

Right after this process you go to, 'node_modules\react-native-bluetooth-escpos-printer\android\src\main\java\cn\jystudio\bluetooth\RNBluetoothManagerModule.java'

de: android.support.v4.app.ActivityCompat; android.support.v4.content.ContextCompat;

you change to: import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat;

it work for me too. Thank you very much!