简体   繁体   English

Android中发生故障[INSTALL_FAILED_OLDER_SDK]

[英]Failure [INSTALL_FAILED_OLDER_SDK] in Android

I am trying to implement MobAd functionality but i am facing error 我正在尝试实现MobAd功能,但MobAd错误

Failure [INSTALL_FAILED_OLDER_SDK]

I am not a android developer.. just want to implement the functionality can anybody help me out 我不是Android开发人员。.只是想实现功能,有人可以帮我吗

Here is my Manifest : 这是我的Manifest

   <?xml version="1.0" encoding="utf-8"?>
   <manifest xmlns:android="http://schemas.android.com/apk/res/android"
   package="com.dinesh.mobdemo" >
   <uses-permission android:name="android.permission.INTERNET" />
   <uses-permission    
   android:name="android.permission.ACCESS_NETWORK_STATE" />
    <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=".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>
    <activity
        android:name="com.google.android.gms.ads.AdActivity"
        android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
</application>

dependencies : 依赖项

    dependencies {
      compile 'com.android.support:support-v4:21.0.0'
      compile 'com.android.support:appcompat-v7:21.0.0'
      compile 'com.google.android.gms:play-services:6.1.11'
      compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services:4.4.52'

} }

Layout : 版面

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res
/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivity">


<TextView android:text="@string/hello_world"   
  android:layout_width="wrap_content"
    android:layout_height="wrap_content" />


<com.google.android.gms.ads.AdView
    android:id="@+id/adMob"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    ads:adSize="BANNER"
    ads:adUnitId="ca-app-pub-1301186605291775/1237290645" />
  </RelativeLayout>

and my Strings Values : 和我的Strings值:

  <?xml version="1.0" encoding="utf-8"?>
  <resources>

    <string name="app_name">MobDemo</string>
    <string name="hello_world">Hello world!</string>
   <string name="action_settings">Settings</string>
   <string name="adMob">adMob</string>
  </resources>

please help what i am missing 请帮助我所缺少的

You're missing uses-sdk element and especially its minSdkVersion attribute in the manifest. 您在清单中缺少uses-sdk元素,尤其是其minSdkVersion属性。

When they're missing, the min SDK level defaults to 1 which is considered "too old". 缺少它们时,最小SDK级别默认为1,这被认为“太旧”。

http://developer.android.com/guide/topics/manifest/uses-sdk-element.html http://developer.android.com/guide/topics/manifest/uses-sdk-element.html

The "dependencies" part suggests you're using Gradle, so the minSdkVersion can also be specified in your app's build.gradle file. “依赖项”部分建议您使用Gradle,因此也可以在应用程序的build.gradle文件中指定minSdkVersion

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM