The meta data tag in AndroidManifest.xml does not have the right value

时间秒杀一切 提交于 2019-12-13 04:55:52

问题


I get this error when trying to run the app:

Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 7095000 but found 6587000. You must have the following declaration within the application element:

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

But that line of code is in my manifest sorry still noob at 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> 

回答1:


you don't have the updated version. you need to update from SDK manager. if you work with android studio you can do it do it automatic by define in gradle file like this:

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

if you work with eclipse, you need to remove the oldest google play services and bring the new from android sdk/extras




回答2:


You need to Update the Google Play Service in Your Device or in Your Emulator

Because the thing is that, you use the latest version of play service in development but you device have oldest one. So the problem is come in picture.



来源:https://stackoverflow.com/questions/29363337/the-meta-data-tag-in-androidmanifest-xml-does-not-have-the-right-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!