2014-01-18 53 views
0

我已經創建了一個帶有Google Maps Android Api V2的小型Android應用程序,到目前爲止,所有的工作都非常完美。 今天早上我檢查了SDK管理器,我發現有一個可用於Google Play服務的更新,我安裝了更新,重新啓動了Eclipse,在這裏,在點擊任何我有Eclipse錯誤控制檯:更新SDK上的Google Play服務後出錯Mnager

[2014-01-18 14:42:23 - GoogleAdsSampleActivity] Unable to resolve target 'android-18' 
[2014-01-18 14:42:23 - PlusSampleActivity] Unable to resolve target 'android-8' 
[2014-01-18 14:42:23 - google-play-services_lib] Unable to resolve target 'android-8' 
[2014-01-18 14:42:23 - PanoramaSampleActivity] Unable to resolve target 'android-8' 
[2014-01-18 14:42:24 - AndTestMap1] Found 2 versions of google-play-services.jar in the dependency list, 
[2014-01-18 14:42:24 - AndTestMap1] but not all the versions are identical (check is based on SHA-1 only at this time). 
[2014-01-18 14:42:24 - AndTestMap1] All versions of the libraries must be the same at this time. 
[2014-01-18 14:42:24 - AndTestMap1] Versions found are: 
[2014-01-18 14:42:24 - AndTestMap1] Path: C:\Users\Poox\AppData\Local\Android\android-sdk\extras\google\google_play_services\libproject\google-play-services_lib\libs\google-play-services.jar 
[2014-01-18 14:42:24 - AndTestMap1]  Length: 1283446 
[2014-01-18 14:42:24 - AndTestMap1]  SHA-1: 826507592fec9d8e26db18364e709df133c749ce 
[2014-01-18 14:42:24 - AndTestMap1] Path: C:\Users\Poox\Desktop\JAVA\AndTestMap1\libs\google-play-services.jar 
[2014-01-18 14:42:24 - AndTestMap1]  Length: 959413 
[2014-01-18 14:42:24 - AndTestMap1]  SHA-1: cebe8e4a3a469c4623addcca1dc571407ff3a08e 
[2014-01-18 14:42:24 - AndTestMap1] Jar mismatch! Fix your dependencies 
[2014-01-18 14:42:24 - AndTestMap1] Found 2 versions of google-play-services.jar in the dependency list, 
[2014-01-18 14:42:24 - AndTestMap1] but not all the versions are identical (check is based on SHA-1 only at this time). 
[2014-01-18 14:42:24 - AndTestMap1] All versions of the libraries must be the same at this time. 
[2014-01-18 14:42:24 - AndTestMap1] Versions found are: 
[2014-01-18 14:42:24 - AndTestMap1] Path: C:\Users\Poox\AppData\Local\Android\android-sdk\extras\google\google_play_services\libproject\google-play-services_lib\libs\google-play-services.jar 
[2014-01-18 14:42:24 - AndTestMap1]  Length: 1283446 
[2014-01-18 14:42:24 - AndTestMap1]  SHA-1: 826507592fec9d8e26db18364e709df133c749ce 
[2014-01-18 14:42:24 - AndTestMap1] Path: C:\Users\Poox\Desktop\JAVA\AndTestMap1\libs\google-play-services.jar 
[2014-01-18 14:42:24 - AndTestMap1]  Length: 959413 
[2014-01-18 14:42:24 - AndTestMap1]  SHA-1: cebe8e4a3a469c4623addcca1dc571407ff3a08e 
[2014-01-18 14:42:24 - AndTestMap1] Jar mismatch! Fix your dependencies 

而且我所有使用Google Maps Android V2的項目在Eclipse的項目瀏覽器中都有一個驚歎號。當我嘗試運行我的項目時什麼也沒有發生,這個窗口的excpet告訴我,我的項目有錯誤,我應該修復,我多次檢查它,而不是一個錯誤。什麼是exaclty? 我的代碼: 清單文件:

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.Poox2.andtestmap4" 
    android:versionCode="1" 
    android:versionName="1.0" > 

    <uses-sdk 
     android:minSdkVersion="12" 
     android:targetSdkVersion="19" /> 

    <uses-permission android:name="android.permission.INTERNET"/> 
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> 
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> 
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/> 
    <!-- The following two permissions are not required to use 
     Google Maps Android API v2, but are recommended. --> 
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> 
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> 

    <uses-feature 
     android:glEsVersion="0x00020000" 
     android:required="true"/> 

    <application 
     android:allowBackup="true" 
     android:icon="@drawable/ic_launcher" 
     android:label="@string/app_name" 
     android:theme="@style/AppTheme" > 

     <meta-data android:name="com.google.android.gms.version" 
      android:value="@integer/google_play_services_version" /> 
     <activity 
      android:name="com.Poox2.andtestmap4.MainActivity" 
      android:label="@string/app_name" > 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 
       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 
     <meta-data 
      android:name="com.google.android.maps.v2.API_KEY" 
      android:value="AIzaSyDmVLuYyZcerTxTlyGbHpxedvGenUxukhA"/> 
    </application> 

</manifest> 

XML文件:

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:orientation="vertical" 
    tools:context=".MainActivity" > 

    <fragment 
      android:id="@+id/map" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:name="com.google.android.gms.maps.MapFragment"/> 
</LinearLayout> 

能否請你告訴我這是怎麼回事,如何解決這一問題?同時我正在檢查它。

+0

首先將您的android-support-libs表格替換成google-play-services_lib項目 –

回答

0

錯誤日誌告訴你到底是什麼問題:你的項目引用了兩個不同版本的play lib,舊的和新的。

好像你在你的lib文件夾中有一個播放庫的.jar文件,並且同時引用了播放庫項目。其中之一是舊版本,必須刪除。