Question

I'm new to programming and newer to programming with Android Studio 0.8.2, and most of the answers I've read do not make sense to me. Every time I've searched for this answer, I get confused. Trying to use a NEXUS 7 table, I get all the way to running my app with no coding errors indicated, but still the program tells me:

pkg: /data/local/tmp/com.WorldWonders.ringold.worldwonders Failure [INSTALL_FAILED_OLDER_SDK]

My app/build.gradle is:

apply plugin: 'com.android.application'

android {
compileSdkVersion 20
buildToolsVersion "20.0.0"

defaultConfig {
    applicationId "com.WorldWonders.ringold.worldwonders"
    minSdkVersion 20
    targetSdkVersion 20
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        runProguard false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services:5.0.77'
compile 'com.android.support:support-v4:21.0.+'

My main activity is:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
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=".main">


<Button
    style="?android:attr/buttonStyleSmall"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Naples"
    android:id="@+id/btnNap"
    android:onClick="onClick_btnNap"
    android:layout_alignParentTop="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true" />

<Button
    style="?android:attr/buttonStyleSmall"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Gas Lamp SD"
    android:id="@+id/btnGas"
    android:onClick="onClick_btnGas"
    android:layout_above="@+id/map"
    android:layout_centerHorizontal="true" />

<Button
    style="?android:attr/buttonStyleSmall"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Coloseum"
    android:id="@+id/btnCol"
    android:onClick="onClick_btnCol"
    android:layout_alignParentTop="true"
    android:layout_alignParentRight="true"
    android:layout_alignParentEnd="true" />

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

</RelativeLayout>

My Manifest is:

<users-sdk
    android:minSdkVersion="20"
    android:targetSdkVersion="20" />

<permission
    android:name="com.WorldWonders.ringold.worldwonders.permission.MAPS_RECEIVE"
    android:protectionLevel="signature"/>
<uses-permission android:name="com.WorldWonders.ringold.worldwonders.MAPS_RECEIVE"/>

<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" />
<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.maps.v2.API_KEY"
        android:value="AIzaSyBtDVKgy7bBv5Q-x3DDtCVv5CTiEsQFF3o"/>

    <activity
        android:name=".main"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

</manifest>

Every fix I've found on StackOverflow has done me no good, so I'm trying with my own app and perhaps the advice I get will click. Thanks in advance.

Was it helpful?

Solution

com.android.support:support-v4:21.0.+ has a minimum SDK version of Android L (as version 21 is in preview only)

Switch it to compile 'com.android.support:support-v4:20.+' if you want to support devices not running Android L.

Also note that no phones/tablets run SDK version 20 (that is for Android Wear devices only) so your minSdkVersion should also be some lower version (i.e, 14 for ICS+ devices, 16 for Jelly Bean+ devices, etc).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top