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

openCameraWithPermission function not work #710

Closed
kubraozer opened this issue Nov 16, 2016 · 2 comments
Closed

openCameraWithPermission function not work #710

kubraozer opened this issue Nov 16, 2016 · 2 comments

Comments

@kubraozer
Copy link

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

@TargetApi(23)
private void openCameraWithPermission() {
if (ContextCompat.checkSelfPermission(this.activity, Manifest.permission.CAMERA)
== PackageManager.PERMISSION_GRANTED) {
barcodeView.resume();
} else if(!askedPermission) {
ActivityCompat.requestPermissions(this.activity,
new String[]{Manifest.permission.CAMERA},
cameraPermissionReqCode);
askedPermission = true;
} else {
// Wait for permission result
}
}
`

In my gradle;
minSdkVersion 19
targetSdkVersion 23
versionCode 22

compile 'com.android.support:support-v4:24.0.0'

I use;
zxing-android-embeded-3.2.0

Stack Trace
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/content/ContextCompat;
at com.journeyapps.barcodescanner.CaptureManager.openCameraWithPermission(CaptureManager.java:233)

Cannot resolved ContextCompat and ActivityCompat. My device is android 6.0.0. What should ı do for this error?

@srowen
Copy link
Contributor

srowen commented Nov 16, 2016

This doesn't relate to this project.

@srowen srowen closed this as completed Nov 16, 2016
@uuu7
Copy link

uuu7 commented Nov 22, 2016

Finger sit .Finger Roll good doggy

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

No branches or pull requests

3 participants