2016-07-22 92 views
1

也許答案很簡單,但我找不到任何可以幫助我的東西。基本上,我想將Google Vision API添加到我的項目中。我通過把LibGDX:如何將Google Mobile Vision API添加到LibGDX項目?

compile 'com.google.android.gms:play-services-vision:9.0.0+' 

build.gradledependencies Android的模塊中,想在這個tutorial嘗試這個。這不起作用(也許我應該把它寫在別的地方?我無法弄清楚)。現在這個build.gradle顯示了很多檢查。據說那裏的組件不能應用於groovy.lang.Closure

我已經安裝了Google Repository。我已經完成了那個不是LibGDX的教程,並且在那裏一切正常。

那麼如何使它與LibGDX一起工作?

+0

你有沒有試過我的建議?) – Enigo

回答

0

的解決方案是增加:

compile 'com.google.apis:google-api-services-vision:v1-rev20-1.22.0' 

成根build.gradle(位於項目的根目錄)下的Android的依賴,而不是特定模塊之一。

project(":android") { 
    apply plugin: "android" 

    configurations { natives } 

    dependencies { 
     compile project(":core") 
     ........ 
     compile 'com.google.apis:google-api-services-vision:v1-rev20-1.22.0' 
    } 
} 
相關問題