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

cannot find symbol / ActivityCompat #335

Open
donmb1 opened this issue Dec 7, 2020 · 4 comments
Open

cannot find symbol / ActivityCompat #335

donmb1 opened this issue Dec 7, 2020 · 4 comments

Comments

@donmb1
Copy link

donmb1 commented Dec 7, 2020

On cordova build for Android

> Task :app:compileDebugJavaWithJavac FAILED
/Users/martinbraun/Documents/Projekte/riders-elite-frontend/cordova/platforms/android/app/src/main/java/com/bitpay/cordova/qrscanner/QRScanner.java:27: error: cannot find symbol
import android.support.v4.app.ActivityCompat;
                             ^
  symbol:   class ActivityCompat
  location: package android.support.v4.app
/Users/martinbraun/Documents/Projekte/riders-elite-frontend/cordova/platforms/android/app/src/main/java/com/bitpay/cordova/qrscanner/QRScanner.java:356: error: cannot find symbol
                    boolean showRationale = ActivityCompat.shouldShowRequestPermissionRationale(cordova.getActivity(), permission);
                                            ^
  symbol:   variable ActivityCompat
  location: class QRScanner
Note: /Users/martinbraun/Documents/Projekte/riders-elite-frontend/cordova/platforms/android/app/src/main/java/com/bitpay/cordova/qrscanner/QRScanner.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/martinbraun/Documents/Projekte/riders-elite-frontend/cordova/platforms/android/app/src/main/java/com/bitpay/cordova/qrscanner/QRScanner.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors

FAILURE: Build failed with an exception.

"cordova-plugin-qrscanner": "^3.0.1"
"cordova-android": "^9.0.0"

@rushiraj111
Copy link

Getting same Issue. Does anyone have any workaround?

"cordova-plugin-qrscanner": "^3.0.1"
"cordova-android": "^9.0.0"

@PeterHdd
Copy link

To solve it, first open the QRScanner.java file and remove import android.support.v4.app.ActivityCompat, and add the following:

import androidx.core.app.ActivityCompat;

@ufocruz
Copy link

ufocruz commented May 11, 2021

This issue is duplicated.
#319

dima11051994 added a commit to prodatakey/cordova-plugin-qrscanner that referenced this issue Jun 8, 2021
@fnicollet
Copy link

Ran into the same issue. It would be better if these changes could be merged into the source code so that it is possible to use the "bitpay" dependency and not the prodatakey/cordova-plugin-qrscanner fork, see referenced commit

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