在SDK Manager上更新Google Play服务后出错

时间:2014-01-18 13:47:48

标签: android google-maps sdk google-play-services

我使用Google Maps Android Api V2创建了一个小型Android应用程序,到目前为止,一切都运行得很完美。 今天早上我检查了SDK管理器,我发现有一个可用于Google Play服务的更新,我安装了更新,重新启动了Eclipse,在这里,在我点击任何内容之前,我在Eclipse的控制台上发现了这些错误:

[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

使用谷歌地图Android V2的所有项目都在Eclipse的项目浏览器旁边有一个惊叹号。当我尝试运行我的项目时没有任何事情发生,在这个窗口中激动地告诉我,我的项目有错误,我应该修复,我检查了很多次,而不是一个错误。什么是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>

你能告诉我发生了什么以及如何解决这个问题吗?同时我正在检查它。

1 个答案:

答案 0 :(得分:0)

错误日志确切地告诉您问题所在:您的项目引用了两个不同版本的play lib,旧版本和新版本。

您的lib文件夹中似乎有一个播放库的.jar文件,并同时引用了播放库项目。其中一个是旧版本,必须删除。