0

在我的應用程序使用的LocationManager,現在我想用融合位置服務 我使用過Android Studio 1.1.0,並添加谷歌在玩的gradle服務庫不能解析符號GoogleApiClient

dependencies { 
compile fileTree(include: ['*.jar'], dir: 'libs') 
compile project(':pull_to_refresh') 
compile project(':uil_library') 
compile project(':viewPagerIndicatorLib') 
compile files('libs/date4j.jar') 
compile 'com.android.support:appcompat-v7:21.0.3' 
compile 'com.android.support:cardview-v7:21.0.3' 
compile 'com.android.support:recyclerview-v7:21.0.3' 
compile 'com.google.maps.android:android-maps-utils:0.3.+' 
compile 'joda-time:joda-time:2.7' 
compile 'com.github.shell-software:fab:1.0.5' 
compile 'com.google.android.gms:play-services:6.5.87' 
} 

但是當我定義GoogleApiClient變量,它說

Cannot resolve symbol 'GoogleApiClient'

所以我點擊Alt + Enter鍵導入,但它顯示「添加庫‘的Google Play服務-6.5.8.7’類路徑」,所以我點擊它,當我運行我的應用程序顯示錯誤

Error:(9, 41) error: package com.google.android.gms.common.api does not exist Error:(23, 13) error: cannot find symbol class GoogleApiClient

我該如何解決這個問題以及造成它的原因。

回答

0

我覺得很愚蠢的:) 的gradle這是我的主要應用程序,但我是用GoogleApiClient圖書館的項目,所以我必須補充compile 'com.google.android.gms:play-services:6.5.87'到我的圖書館太