1

私のアプリケーションの計測単位テストを設定しようとしています。私は以下の開発者サイトのリンクに基づいて依存関係を追加しました。依存関係との競合 'com.android.support:support-annotations'

Error:Conflict with dependency 'com.android.support:support-annotations' in project ':MyApp'. Resolved versions for the app (21.0.3) and test app (24.0.0) differ. See http://g.co/androidstudio/app-test-app-conflict for details. 

誰もがこの問題を解決するために私を助けてくださいでした:

https://developer.android.com/training/testing/unit-testing/instrumented-unit-tests.html#build

は、これは私が、私は以下のコンパイルエラーを取得していたプロジェクトをビルドするとき

dependencies { 
    compile 'com.android.support:multidex:1.0.1' 
    compile 'com.android.support:support-v4:21.0.3' 
    testCompile 'junit:junit:4.12' 
    testCompile 'org.mockito:mockito-core:1.10.19' 
    androidTestCompile 'com.android.support:support-annotations:24.0.0' 
    androidTestCompile 'com.android.support.test:runner:0.5' 
    androidTestCompile 'com.android.support.test:rules:0.5' 
} 

私の依存関係のリストです。

答えて

3

注釈はサポートライブラリの一部です。だから、あなたの注釈とライブラリのバージョンをサポートするには、同じである必要があり、あなたは私は今、 See here

configurations.all { 
    resolutionStrategy { 
    force 'com.android.support:support-annotations:21.0.3' 
    } 
} 
+0

iは21.0.3に変更されているコードはdependencies.For詳細の上に配置する必要があります.Thisコードの下に使用して強制的に呼び出す必要がありますこのエラーが発生します。エラー:プロジェクト ':MyApp'の依存関係 'com.android.support:support-annotations'と競合しています。 app(21.0.3)とtest app(23.1.1)の解決されたバージョンは異なります。詳細はhttp://g.co/androidstudio/app-test-app-conflictをご覧ください。 – Vji

+0

プリヤに感謝... – Vji

+0

あなたの歓迎:) –

関連する問題