2017-04-09 5 views
2

を使用する必要があり、私は私が間違っていた場所を知っているが、これはすべてのAndroidサポートライブラリが同じバージョンの仕様

All com.android.support libraries must use the same exact version specification (mixing versions can lead to runtime crashes.) Found versions 24.0.0,23.2.0 Examples include com.android.support:animated-vector-drawable:24.0.0 and com.android.support:cardview-v7:23.2.0 

私のbuild.gradleが

 apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion '25.0.0' 

    defaultConfig { 
     applicationId "com.example.project" 
     minSdkVersion 14 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
     multiDexEnabled true 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

allprojects { 
    gradle.projectsEvaluated { 
     tasks.withType(JavaCompile) { 
      options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    compile 'com.parse.bolts:bolts-android:1.+' 
    compile 'com.parse:parse-android:1.+' 
    compile 'com.android.support:appcompat-v7:23.2.0' 
    compile 'com.android.support:design:23.2.0' 
    compile 'com.android.support:recyclerview-v7:23.2.0' 
    compile 'com.android.support:cardview-v7:23.2.0' 
    compile 'com.squareup.picasso:picasso:2.5.2' 
    compile 'com.mani:ThinDownloadManager:1.2.2' 
    compile 'net.rdrei.android.dirchooser:library:[email protected]' 
    compile 'com.google.android.gms:play-services:10.2.0' 
    compile 'com.onesignal:OneSignal:[email protected]' 

} 
apply plugin: 'com.google.gms.google-services' 

それは、この中にエラーを示していると言って私を続けていけませんラインあまりに

compile 'com.android.support:appcompat-v7:23.2.0' 

私も24にcompileSdkVersionを変更しようとしたが、何も今のように動作していないようにみえます。私がプレイサービスライブラリを導入する前に、実際はすべてうまくいきました。

+1

へのご支援ライブラリにマイナーな変更を必要としますかフルグラデルを投稿 – rafsanahmad007

+0

こんにちは@ rafsanahmad007、私は投稿を編集しました。ありがとう –

+0

あなたの依存関係の1つ以上がAndroidサポートライブラリの一部を要求しており、そのライブラリの異なるバージョンをリクエストしています。どの依存関係を(例えば、Gradle依存関係レポートを介して)追跡し、問題を解決する必要があります(例えば、新しいバージョンを要求する推移的依存関係のための独自の 'compile'行を追加することによって)。 – CommonsWare

答えて

2

この依存性はcom.android.support:animated-vector-drawableのバージョン24.0.0を使用している:アンドロイドスタジオの原因となります

compile 'com.google.android.gms:play-services:10.2.0' 

は、それが理由のバージョンのバグ/クラッシュにつながる可能性があると文句を言うためにすべてのGoogleライブラリが一致しません。(私は私の頭の上をオフにする知っている)

  1. があなたのcompileSdkVersion 24に変更し、同様にバージョン24に、すべてのサポートライブラリの依存関係を変更します。

    は、だから、2つのオプションを持っていますそれはのバージョン24を使用しないように、9.4または9.2.1へ

    compile 'com.android.support:appcompat-v7:24.0.0' 
    compile 'com.android.support:design:24.0.0' 
    compile 'com.android.support:recyclerview-v7:24.0.0' 
    compile 'com.android.support:cardview-v7:24.0.0' 
    
  2. ダウングレードcom.google.android.gms:play-services:プレイサービスの依存関係を一致させます何でもこれはまだあなたのコンパイルSDKのバージョンは何ですか?23.2.0から23.0.0単に

    compile 'com.android.support:appcompat-v7:23.0.0' 
    compile 'com.android.support:design:23.0.0' 
    compile 'com.android.support:recyclerview-v7:23.0.0' 
    compile 'com.android.support:cardview-v7:23.0.0' 
    compile 'com.google.android.gms:play-services:9.4.0' 
    
関連する問題