java - Gradle searching Ivy service but no Ivy config / repo defined -


i getting following error gradle

 not resolve dependencies configuration ':unittestcompile'. > not find junit:junit:4.11. 

here build.gradle

 apply plugin: 'android-library'  buildscript {     repositories {         mavencentral()     }      dependencies {         classpath 'com.android.tools.build:gradle:0.8.+'     } }  version = '0.6.2'  configurations {         unittestcompile.extendsfrom runtime         unittestruntime.extendsfrom unittestcompile }  dependencies {     compile files('libs/android-support-v4.jar')     unittestcompile 'junit:junit:4.11' }  android {     buildtoolsversion "19.0.1"     compilesdkversion 17       sourcesets {         main {             manifest.srcfile 'androidmanifest.xml'             java.srcdirs = ['src', 'bundled-src']             resources.srcdirs = ['src']             aidl.srcdirs = ['src']             renderscript.srcdirs = ['src']             res.srcdirs = ['res']             assets.srcdirs = ['assets']         }     }      dependencies {         compile filetree(dir: './libs', include: 'amplitude.jar')     } }  sourcesets {         unittest {                 java.srcdirs = ['tests/src']                 res.srcdirs = ['tests/res']                 assets.srcdirs = ['tests/assets']                 resources.srcdirs = ['tests/res']         } } task dounittest(type:test, dependson: assemble) {         description = "run unit tests"         testclassesdir = project.sourcesets.unittest.output.classesdir         classpath = project.sourcesets.unittest.runtimeclasspath }  check.dependson dounittest 

a debug run indicates trying resolve dependency ivy , not maven?

 16:21:58.633 [debug] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.dependencygraphbuilder] visiting configuration :analytics-android:0.6.2(unittestcompile). 16:21:58.633 [debug] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.dependencygraphbuilder] visiting dependency :analytics-android:0.6.2(unittestcompile) -> junit:junit:4.11(dependency: junit#junit;4.11 {unittestcompile=[default]}) 16:21:58.634 [debug] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.dependencygraphbuilder] selecting new module version junit:junit:4.11 16:21:58.634 [debug] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.userresolverchain] attempting resolve module 'junit:junit:4.11' using repositories [] 16:21:58.636 [debug] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.dependencygraphbuilder] attaching :analytics-android:0.6.2(unittestcompile) parents. 16:21:58.637 [debug] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.oldresult.transientconfigurationresultsbuilder] flushing resolved configuration data in binary store in /private/var/folders/7y/yrtq1vcx3xb901v_xd5v5_100000gn/t/gradle1413382664789288993.bin. wrote root :analytics-android:0.6.2:unittestcompile. 16:21:58.638 [debug] [org.gradle.api.internal.tasks.execution.executeatmostoncetaskexecuter] finished executing task ':compileunittestjava' 16:21:58.638 [info] [org.gradle.execution.taskgraph.abstracttaskplanexecutor] :compileunittestjava (thread[main,5,main]) completed. took 0.017 secs. 16:21:58.639 [debug] [org.gradle.execution.taskgraph.abstracttaskplanexecutor] task worker [thread[main,5,main]] finished, busy: 4.035 secs, idle: 0.047 secs 16:21:58.644 [error] [org.gradle.buildexceptionreporter]  16:21:58.645 [error] [org.gradle.buildexceptionreporter] failure: build failed exception. 16:21:58.645 [error] [org.gradle.buildexceptionreporter]  16:21:58.646 [error] [org.gradle.buildexceptionreporter] * went wrong: 16:21:58.646 [error] [org.gradle.buildexceptionreporter] not resolve dependencies configuration ':unittestcompile'. 16:21:58.646 [error] [org.gradle.buildexceptionreporter] > not find junit:junit:4.11. 16:21:58.646 [error] [org.gradle.buildexceptionreporter]   required by: 16:21:58.647 [error] [org.gradle.buildexceptionreporter]       :analytics-android:0.6.2 

the problem declared repository build script dependencies, none regular dependencies. (in other words, need top-level repositories block.) also, dependencies block should go outside android block, core gradle feature not related android plugin.


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -