Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Support Issue, Gradle Build Failed. #188

Open
AbdulBari5 opened this issue May 12, 2022 · 4 comments
Open

Android Support Issue, Gradle Build Failed. #188

AbdulBari5 opened this issue May 12, 2022 · 4 comments

Comments

@AbdulBari5
Copy link

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.

  • What went wrong:
    Execution failed for task ':react-native-bluetooth-escpos-printer:compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

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
Copy link

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

@hernancasillas
Copy link

Is this solved? Same here.

@amerytcl97
Copy link

amerytcl97 commented Sep 8, 2022

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants