尝试运行应用程序时出现此错误:

由以下原因引起:java.lang.IllegalStateException:应用程序的AndroidManifest.xml中的元数据标记没有正确的值。预期为7095000,但发现为6587000。您必须在application元素内具有以下声明:

<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />


但是那行代码在我的清单中很抱歉,Android仍然很菜鸟

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

  <uses-sdk android:minSdkVersion="10"/>
  <uses-feature android:glEsVersion="0x00020000" />

  <uses-permission android:name="com.android.vending.BILLING" />
  <uses-permission android:name="android.permission.INTERNET"/>
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.READ_PHONE_STATE" />
  <uses-permission android:name="android.permission.GET_ACCOUNTS" />
  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

  <supports-screens android:xlargeScreens="true"
  android:largeScreens="true"
  android:smallScreens="true"
  android:anyDensity="true"
  android:normalScreens="true"/>

  <application android:label="@string/app_name"
      android:icon="@drawable/icon"
      android:hardwareAccelerated="true"
    android:allowBackup="true"
    >

      <meta-data android:name="com.google.android.gms.games.APP_ID"
                 android:value="@string/app_id" />
      <meta-data android:name="com.google.android.gms.version"
                 android:value="@integer/google_play_services_version"/>

      <activity android:name="com.topgame.test.MainActivity"
          android:label="@string/app_name"
          android:screenOrientation="landscape"
          android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
          android:configChanges="orientation|keyboardHidden"
          android:windowSoftInputMode="stateHidden">
          <intent-filter>
              <action android:name="android.intent.action.MAIN" />
              <category android:name="android.intent.category.LAUNCHER" />
              <category android:name="android.intent.category.DEFAULT" />
          </intent-filter>
      </activity>

      <activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
      <activity android:name="com.greystripe.sdk.GSFullscreenActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenSize" />
      <activity android:name="com.mdotm.android.view.MdotMActivity" android:launchMode="singleTop"/>
      <activity android:name="com.chartboost.sdk.CBImpressionActivity" android:excludeFromRecents="true" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:configChanges="keyboard|keyboardHidden|orientation|screenSize"  />
      <activity android:name="com.mopub.mobileads.MoPubActivity" android:configChanges="keyboardHidden|orientation"/>
      <activity android:name="com.mopub.mobileads.MraidActivity" android:configChanges="keyboardHidden|orientation"/>
      <activity android:name="com.mopub.mobileads.MraidBrowser" android:configChanges="keyboardHidden|orientation"/>
      <activity android:name="com.mopub.mobileads.MraidVideoPlayerActivity" android:configChanges="keyboardHidden|orientation"/>

  </application>

</manifest>

最佳答案

您没有更新的版本。您需要从SDK管理器进行更新。如果您使用android studio,则可以通过在gradle文件中进行定义来自动执行此操作,如下所示:

dependencies {
    compile 'com.android.support:support-v13:21.0.3'
    compile 'com.google.android.gms:play-services:6.5.87'
}


如果您使用eclipse,则需要删除最旧的Google Play服务,并从android sdk / extras中引入新功能

关于java - AndroidManifest.xml中的元数据标签的值不正确,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/29363337/

10-11 04:14