我使用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 –