2016-11-15 12 views
2

同様の質問が何度か尋ねられましたが、私の問題の解決策を見つけることができません。 私のアプリケーションをテストする必要があります。だから、私はAndroid runnterのサポートを追加するチュートリアルに従った。警告:依存関係との競合 'com.android.support:support-annotations'(25.0.1)

androidTestCompile 'com.android.support.test:runner:0.5' 
androidTestCompile 'com.android.support.test:rules:0.5' 

問題は、これは私のcompatライブラリと互換性がないようです。我々はAPIレベル25に対して開発以来

compile 'com.android.support:appcompat-v7:25.0.1' 
compile 'com.android.support:design:25.0.1' 

しかし、これらのライブラリが必要とされています。だから、バージョン23に戻ることは私が推測するオプションではありません。

これを実行するにはどうすればよいですか?何か不足していますか?

+2

はこれをチェックアウト:http://stackoverflow.com/questions/28999124/resolved-versions-for-app-22-0-0-and-をtest-app-21-0-3-differ –

+0

リンクありがとうございますが、これは古いバージョンのものです。テストランナーはv.23までは互換性がありますが、私はAPIレベル25のプロジェクトで何をすべきか分かりません。 –

答えて

3
androidTestCompile 'com.android.support.test:runner:0.5' 
androidTestCompile 'com.android.support.test:rules:0.5' 

supportAnnotationsの古いバージョンを参照してください。

:具体的にテストコンパイルの suportAnnotationsバージョンを(任意の推移的依存関係を上書きすることができます)を宣言

  1. com.android.support:support-annotations:23.1.1 
    

    あなたはいくつかの選択肢を持っています

    androidTestCompile 'com.android.support:support-annotations:25.0.1' 
    
  2. それらの依存関係から、それをエクスクルード:

    androidTestCompile ('com.android.support.test:runner:0.5') { 
        exclude module: 'support-annotations' 
    } 
    androidTestCompile ('com.android.support.test:rules:0.5') { 
        exclude module: 'support-annotations' 
    } 
    
+0

ありがとうございます、私の問題を解決するようです! –

関連する問題