2017-04-19 3 views
2

I Android Studio 2.3.1,Android AppCompat-v7 Fehler

Kompilierung 'com.android.support:appcompat-v7:23.4.0'

In android build.gradle bin mit hat Fehler

Alle com.android.support-Bibliotheken müssen die exakt gleiche Versionsspezifikation verwenden (das Mischen von Versionen kann zu Laufzeitabstürzen führen). Gefunden Versionen 24.0.0, 23.4.0. Beispiele hierfür sind com.android.support:support-v4:24.0.0 und com.android.support:animated-vector-drawable:23.4.0

Das ist mein build.gradle

apply plugin: 'com.android.application' 

android { 
compileSdkVersion 23 
buildToolsVersion '25.0.0' 
useLibrary 'org.apache.http.legacy' 
defaultConfig { 
    applicationId "com.wsolus.chathuranga.simplifya" 
    minSdkVersion 16 
    targetSdkVersion 23 
    versionCode 22 
    versionName "2.0.1" 
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
} 
buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
    } 
} 
packagingOptions { 
    exclude 'META-INF/DEPENDENCIES.txt' 
    exclude 'META-INF/LICENSE.txt' 
    exclude 'META-INF/NOTICE.txt' 
    exclude 'META-INF/NOTICE' 
    exclude 'META-INF/LICENSE' 
    exclude 'META-INF/DEPENDENCIES' 
    exclude 'META-INF/notice.txt' 
    exclude 'META-INF/license.txt' 
    exclude 'META-INF/dependencies.txt' 
    exclude 'META-INF/LGPL2.1' 
} } dependencies { 
compile fileTree(include: ['*.jar'], dir: 'libs') 
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
    exclude group: 'com.android.support', module: 'support-annotations' 
}) 
    compile('org.apache.httpcomponents:httpmime:4.3') { 
    exclude module: "httpclient" 
} 
    compile 'com.android.support:appcompat-v7:23.4.0' 
    compile 'com.android.support:design:23.4.0' 
    compile 'com.android.support:support-v4:23.4.0' 

} 

bitte helfen Sie mir Dank

Dies ist ein Screenshot des gradle:

This is a screen shot of the gradle

Antwort

2

Ändern Sie Ihre Gra dle-Datei wie folgt und dann gehen Sie zu Datei-> Cache ungültig und starten Sie neu.

apply plugin: 'com.android.application' 

android { 
compileSdkVersion 24 
buildToolsVersion "24.0.0" 
useLibrary 'org.apache.http.legacy' 
defaultConfig { 
    applicationId "com.wsolus.chathuranga.simplifya" 
    minSdkVersion 16 
    targetSdkVersion 23 
    versionCode 22 
    versionName "2.0.1" 
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
} 
buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
    } 
} 
packagingOptions { 
    exclude 'META-INF/DEPENDENCIES.txt' 
    exclude 'META-INF/LICENSE.txt' 
    exclude 'META-INF/NOTICE.txt' 
    exclude 'META-INF/NOTICE' 
    exclude 'META-INF/LICENSE' 
    exclude 'META-INF/DEPENDENCIES' 
    exclude 'META-INF/notice.txt' 
    exclude 'META-INF/license.txt' 
    exclude 'META-INF/dependencies.txt' 
    exclude 'META-INF/LGPL2.1' 
} } dependencies { 
compile fileTree(include: ['*.jar'], dir: 'libs') 
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
    exclude group: 'com.android.support', module: 'support-annotations' 
}) 
    compile('org.apache.httpcomponents:httpmime:4.3') { 
    exclude module: "httpclient" 
} 
    compile 'com.android.support:appcompat-v7:24.2.0' 
    compile 'com.android.support:design:24.2.0' 
    compile 'com.android.support:support-v4:24.2.0' 
    compile 'com.android.support:palette-v7:24.2.0' 

} 
+0

ich so tun, dann sagte er buildToolsVersion „24.0.0“ zu alt ist und aktualisiert werden soll „25.0.0“ Ich mache es aber Problem seiner Arbeits gleichen –

+0

Jetzt ist für mich, Fehler gegangen, danke Sathya Baman –

+0

Sie sind willkommen –

1

Sie sind zur Zeit

compileSdkVersion 23 
buildToolsVersion '25.0.0' 

Zuerst ändern CompileSDK und Build-Tool Version zu

compileSdkVersion 25 
buildToolsVersion '25.0.2' 

und ändern Sie Ihre dependancy Kommentar Ihre appcompat dependancy und Version verwenden bis zu deiner anderen Abhängigkeit. Ich habe auch diesen Fehler bekommen. Das wird für mich funktionieren.

//compile 'com.android.support:appcompat-v7:25.3.1' 
    compile 'com.android.support:design:25.3.1' 
    compile 'com.android.support:support-v4:25.3.1' 

danke :)