简体   繁体   中英

Warning:Conflict with dependency 'com.android.support:support-annotations' (25.0.1)

Okay, I know, a similar question has been asked several times but I can't find a solution for my problem. I need to test my application. So I followed a tutorial telling me to add Android runnter support.

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

Problem is, this doesn't seem to be compatible with my compat libraries.

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

But these libraries are needed since we develop against API level 25 . So going back to version 23 is not an option I guess.

So how can I get this running? Am I missing something?

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

refer to older version of supportAnnotations :

com.android.support:support-annotations:23.1.1

You have a few choices:

  1. Specifically declare suportAnnotations version for test compilation (to override any transitive dependencies):

     androidTestCompile 'com.android.support:support-annotations:25.0.1' 
  2. Exlude it from those dependencies:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM