【发布时间】:2018-04-15 04:14:21
【问题描述】:
我有两部 Android 手机 Samsung S5 API 19 和另一部设备 API 25。在我的情况下,我使用 ZXING 开发扫描仪,它成功显示相机并在设备 API 19 中工作,但是当我在更高版本的设备 Android 中进行测试时牛轧糖 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'
}
}
【问题讨论】:
标签: android android-gradle-plugin device zxing