我有两个Android手机三星S5 API 19和另一个设备API 25.在我的情况下,我使用ZXING开发扫描仪,它成功显示相机和工作在设备API 19,但当我在更高版本的设备Android测试Nougat API 25。该应用程序不显示相机。我将目标sdk更改为API 26但仍然无法正常工作,我检查了Manifest并且我还声明了相机权限。请帮帮我。
的build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.example.administrator.copy"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
useLibrary 'org.apache.http.legacy'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
allprojects {
repositories {
// ...
maven { url "https://jitpack.io" }
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
//scanner camera library
compile 'me.dm7.barcodescanner:zxing:1.9'
//sweetalert dialog library
compile 'cn.pedant.sweetalert:library:1.3'
//login and retrieving data library
compile 'com.android.volley:volley:1.0.0'
testCompile 'junit:junit:4.12'
}
}