Run JUnit tests in Android studio -


i created new android project , tried run tests (junit) , had follow result:

15:28:53: executing external tasks 'cleantest test --tests com.binomv.rimidalv.tt.*'...

failure: build failed exception.

  • what went wrong: problem occurred configuring root project 'tt'.

could not resolve dependencies configuration ':classpath'. artifact 'kxml2.jar (net.sf.kxml:kxml2:2.3.0)' not found. searched in following locations: https://jcenter.bintray.com/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.jar

  • try: run --stacktrace option stack trace. run --info or --debug option more log output.

build failed total time: 0.512 secs artifact 'kxml2.jar (net.sf.kxml:kxml2:2.3.0)' not found. searched in following locations: https://jcenter.bintray.com/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.jar

but if use test through device - ok.

thank you.

-----update-----

build.gradle file:

apply plugin: 'com.android.application'  android { compilesdkversion 22 buildtoolsversion "22.0.1"  defaultconfig {     applicationid "com.binomv.rimidalv.tt"     minsdkversion 14     targetsdkversion 22     versioncode 1     versionname "1.0" } buildtypes {     release {         minifyenabled false         proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro'     } } }  dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.0.0' compile 'com.android.support:support-v4:22.0.0' } 

----- solution -----

you should remove "~/.gradle" folder. android studio recreate it.


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -