tryng to integrate zxing in my app.
This is the gradle file:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.android.support:design:22.2.0'
compile 'net.danlew:android.joda:2.8.1'
compile 'com.android.support:support-v4:22.2.0'
compile 'com.github.machinarius:preferencefragment:0.1.1'
compile 'com.mcxiaoke.volley:library:1.0.16'
compile 'com.jakewharton:butterknife:6.1.0'
compile 'com.journeyapps:zxing-android-embedded:3.1.0@aar'
compile 'com.google.zxing:core:3.2.0'
}
And this is the ScanActivity.class
package it.xxx.views;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v4.content.ContextCompat;
import com.google.zxing.integration.android.IntentIntegrator;
/**
* Created by Alessandro on 11/01/2016.
*/
public class ScanActivity extends AppCompatActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
new IntentIntegrator(this).initiateScan(); // `this` is the current Activity
}
}
But I get APP crash and in log:
java.lang.NoSuchMethodError: android.support.v4.content.ContextCompat.checkSelfPermission
Thank you for your support!