2016-11-23 32 views
2

Vision APIを使用してバーコードをスキャンしています。オートフォーカス以外はほぼ完了です。私は、このリンクでのガイドは、次のとおりです。https://developers.google.com/android/reference/com/google/android/gms/vision/CameraSource.Builderを、方法をsetAutoFocusEnabled使用して、エラーを取得: "メソッドを解決できません '(boolean)をsetAutoFocusEnabled'"メソッドを解決できません:CameraSource.Builder.setAutoFocusEnabled

私のAndroidのスタジオバージョン: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+' 
} 
+0

'gms:play-services:7.8 +' ...このライブラリの最新バージョンが「10.0」になったことは分かりますか? https://developers.google.com/android/guides/releases –

答えて

2

あなたが使用しているライブラリーよりも新しいドキュメントを読んでいます。

新しい機能が必要な場合は、アップグレードしてください。

com.google.android.gms:play-services-vision:10.0.0com.google.android.gms:play-services:7.8+

を交換、または7.8よりも他のいくつかの、それ以降のバージョン。

selective compilationを参照してください。それはあなたのアプリケーションを小さくし、より速く構築します。

+0

okありがとうございました。私は私のアプリを実行し、それは自動フォーカスがありません。私は自分の携帯電話(HTC M8)がオートフォーカスをサポートしていると確信しています(カメラアプリを使用する場合)。私は何か見落としてますか? – suco2007

関連する問題