Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android.compileSdkVersion is missing

Im using AndroidStudio and Im trying to put some ads on my app, according to the setting up google play API - https://developer.android.com/google/play-services/setup.html

Adter i sync the project with the grandle files i get this error:

Error:Failed to find: com.google.android.gms:play-services:5.0.77
<a href="install.m2.repo">Install Repository and sync project</a><br><a href="openFile">Open File</a><br><a href="open.dependency.in.project.structure">Open in Project Structure dialog</a>

This is my gradle.build:

apply plugin: 'com.android.application'
apply plugin: 'android'
android {
    compileSdkVersion 19
    buildToolsVersion "20.0.0"

defaultConfig {
    applicationId "com.pachu.fartsounds"
    minSdkVersion 8
    targetSdkVersion 19
    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.android.support:appcompat-v7:19.+'
    compile 'com.google.android.gms:play-services:5.0.77'
}

My Manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.pachu.fartsounds">

<application
    android:allowBackup="true"
    android:icon="@drawable/fart_icon"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".FartActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

Any ideas? Thanks !

like image 808
Golan Kiviti Avatar asked May 26 '26 17:05

Golan Kiviti


1 Answers

You are missing critical components of your manifest. The SDK error you are receiving is because the compiler doesn't know at what SDK level to compile your app - you're missing <uses-sdk.

And while we're at it, you're also missing your package name, version name, and version code. These are all critical components to your app. Here's an example of a well-formed manifest:

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

<uses-sdk
    android:minSdkVersion="9"
    android:targetSdkVersion="19" />

<uses-permission android:name="android.permission.GET_TASKS" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.example.exampleapp.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>

    <service android:enabled="true" android:name="com.example.exampleapp.MyService" />

</application>

</manifest>

Notice at the very top: the sections that read package, android:versionCode, and android:versionName. And also, below those, the entire section that starts with <uses-sdk... These are all required.

like image 111
IAmTheSquidward Avatar answered May 28 '26 06:05

IAmTheSquidward



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!