Could not find a version compatible with com.android.support:support-v7:20.0.+

I am new to android development I wrote

classpath 'com.android.tools.build: gradle: 1.0.0 +'

runproduard () is replaced with minifyenabled. Result: Create a successful

but at runtime this error occurs:

My code:

compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:21.0.+' compile 'com.android.support:support-v4:21.0.+'

but 698 warnings as cannot find the referenced class xom which is added to libs folder

Error: Execution failed for task ': app: proguardMobifoodDemoDebug'. java.io.IOException: Execute the above warnings first.

My android version 1.0.2 and gradle is 2.2.1

+3


source to share


2 answers


build.gradle in the module directory

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.+'
    compile 'com.android.support:support-v4:21.0.+'
}

      

The "+" allows gradle to automatically update the latest jar bug fixes.

build.gradle in the most remote project directory



buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.0.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

      

local.properties

sdk.dir=/Tools/adt-bundle-mac-x86_64-20140624/sdk

      

+2


source


Change com.android.support:support-v7:20.0.+

in your apps build.gradle to



'com.android.support:appcompat-v7:21.0.2'

      

+2


source







All Articles