januslo / react-native-bluetooth-escpos-printer

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

Android Support Issue, Gradle Build Failed. #188

Open AbdulBari5 opened 2 years ago

AbdulBari5 commented 2 years ago

Hello, I am using gradle version 6.5.1 and react-native 0.64.3, The project is an expo bare flow project. Every time I try to build the app. This error comes: Please help me to resolve it.

Task :react-native-bluetooth-escpos-printer:compileDebugJavaWithJavac FAILED C:\Users\HP\Desktop\anitadelivery\anita-terminal\node_modules\react-native-bluetooth-escpos-printer\android\src\main\java\cn\jystudio\bluetooth\RNBluetoothManagerModule.java:13: error: cannot find symbol import android.support.v4.app.ActivityCompat; ^ symbol: class ActivityCompat location: package android.support.v4.app C:\Users\HP\Desktop\anitadelivery\anita-terminal\node_modules\react-native-bluetooth-escpos-printer\android\src\main\java\cn\jystudio\bluetooth\RNBluetoothManagerModule.java:14: error: package android.support.v4.content does not exist import android.support.v4.content.ContextCompat; ^ C:\Users\HP\Desktop\anitadelivery\anita-terminal\node_modules\react-native-bluetooth-escpos-printer\android\src\main\java\cn\jystudio\bluetooth\RNBluetoothManagerModule.java:175: error: cannot find symbol int permissionChecked = ContextCompat.checkSelfPermission(reactContext, android.Manifest.permission.ACCESS_COARSE_LOCATION); ^ symbol: variable ContextCompat location: class RNBluetoothManagerModule C:\Users\HP\Desktop\anitadelivery\anita-terminal\node_modules\react-native-bluetooth-escpos-printer\android\src\main\java\cn\jystudio\bluetooth\RNBluetoothManagerModule.java:178: error: cannot find symbol ActivityCompat.requestPermissions(reactContext.getCurrentActivity(), ^ symbol: variable ActivityCompat location: class RNBluetoothManagerModule Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: C:\Users\HP\Desktop\anitadelivery\anita-terminal\node_modules\react-native-bluetooth-escpos-printer\android\src\main\java\cn\jystudio\bluetooth\tsc\TscCommand.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 4 errors

FAILURE: Build failed with an exception.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.5.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 56s 374 actionable tasks: 3 executed, 371 up-to-date

hm1061998 commented 2 years ago

I had a similar problem. have you solved it yet?

hernancasillas commented 1 year ago

Is this solved? Same here.

amerytcl97 commented 1 year ago

Hello, I am using gradle version 6.5.1 and react-native 0.64.3, The project is an expo bare flow project. Every time I try to build the app. This error comes: Please help me to resolve it.

Task :react-native-bluetooth-escpos-printer:compileDebugJavaWithJavac FAILED C:\Users\HP\Desktop\anitadelivery\anita-terminal\node_modules\react-native-bluetooth-escpos-printer\android\src\main\java\cn\jystudio\bluetooth\RNBluetoothManagerModule.java:13: error: cannot find symbol import android.support.v4.app.ActivityCompat; ^ symbol: class ActivityCompat location: package android.support.v4.app C:\Users\HP\Desktop\anitadelivery\anita-terminal\node_modules\react-native-bluetooth-escpos-printer\android\src\main\java\cn\jystudio\bluetooth\RNBluetoothManagerModule.java:14: error: package android.support.v4.content does not exist import android.support.v4.content.ContextCompat; ^

Go to

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

and Try replacing android.support.v4.app.ActivityCompat -> import androidx.core.app.ActivityCompat android.support.v4.content.ContextCompat -> import androidx.core.content.ContextCompat;

adilelkhalloufi commented 1 year ago

Hello, I am using gradle version 6.5.1 and react-native 0.64.3, The project is an expo bare flow project. Every time I try to build the app. This error comes: Please help me to resolve it.

Task :react-native-bluetooth-escpos-printer:compileDebugJavaWithJavac FAILED C:\Users\HP\Desktop\anitadelivery\anita-terminal\node_modules\react-native-bluetooth-escpos-printer\android\src\main\java\cn\jystudio\bluetooth\RNBluetoothManagerModule.java:13: error: cannot find symbol import android.support.v4.app.ActivityCompat; ^ symbol: class ActivityCompat location: package android.support.v4.app C:\Users\HP\Desktop\anitadelivery\anita-terminal\node_modules\react-native-bluetooth-escpos-printer\android\src\main\java\cn\jystudio\bluetooth\RNBluetoothManagerModule.java:14: error: package android.support.v4.content does not exist import android.support.v4.content.ContextCompat; ^

Go to

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

and Try replacing android.support.v4.app.ActivityCompat -> import androidx.core.app.ActivityCompat android.support.v4.content.ContextCompat -> import androidx.core.content.ContextCompat;

Greate job it work for me Thank you