我使用Vision API扫描条形码。它几乎完成,除了自动对焦。我按照这个链接指南:https://developers.google.com/android/reference/com/google/android/gms/vision/CameraSource.Builder,使用setAutoFocusEnabled方法,并得到一个错误: “无法解析法 'setAutoFocusEnabled(布尔)'”无法解析方法:CameraSource.Builder.setAutoFocusEnabled
我的Android Studio版本:2.1.1
JRE:1.8 0.0
文件的build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "***"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.google.android.gms:play-services:7.8+'
}
'gms:play-services:7.8 +'......你意识到这个库的最新版本现在是'10.0'? https://developers.google.com/android/guides/releases –