1
我想爲我的應用程序設置一個Instrumented Unit Tests。並且我已經添加了基於以下開發者網站鏈接的依賴關係。與依賴衝突'com.android.support:support-annotations'
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'
}
當我建立我得到下面的編譯錯誤的項目:
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.
任何人都可以請幫我解決這個問題。
我已經更改爲21.0.3,現在我獲取此錯誤錯誤:與項目':MyApp'中的依賴項'com.android.support:support-annotations'衝突。應用程序(21.0.3)和測試應用程序(23.1.1)的已解決版本不同。有關詳細信息,請參閱http://g.co/androidstudio/app-test-app-conflict。 – Vji
謝謝Priya ... – Vji
歡迎光臨:) –