java - Gradle compile dependency is not added to classpath -


i've added reflections framework android project. wasn't added classpath. android studio suggests need add manually, cannot start app since gradle cannot build it.

here build.gradle of app module:

apply plugin: 'com.android.application'  android {     compilesdkversion 22     buildtoolsversion "21.1.2"      defaultconfig {         applicationid "my.package"         minsdkversion 21         targetsdkversion 22         versioncode 1         versionname "1.0"     }     buildtypes {         release {             minifyenabled false             proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro'         }     }     lintoptions {         abortonerror false     }    }  dependencies {     compile filetree(dir: 'libs', include: ['*.jar'])     compile project(':offlinetasks')     compile project(':tasks')     compile project(':models')     compile 'com.android.support:cardview-v7:21.0.3'     compile 'com.android.support:recyclerview-v7:21.0.3'      compile 'org.roboguice:roboguice:3.0.1'     provided 'org.roboguice:roboblender:3.0.1'      compile 'com.android.support:support-annotations:22.1.1'     compile('org.reflections:reflections:0.9.10') {         exclude module: 'xml-apis'         exclude module: 'annotations'     }      testcompile 'junit:junit:4.12'     testcompile('com.squareup.assertj:assertj-android:1.0.0') {         exclude module: 'support-annotations'     } } 

when build app , try use cannot import reflections class automatically. thing android studio suggests add reflections framework manually.

android studio suggestion

after i've added classpath manually can import class. when i'm trying start following error:

tasks:compilereleasejava /.../taskfactory.java:8: error: package org.reflections not exist import org.reflections.reflections; 

does know why happens?

edit: project build.gradle looks this:

// top-level build file can add configuration options common sub-projects/modules.  buildscript {     repositories {         jcenter()         mavencentral()     }     dependencies {         classpath 'com.android.tools.build:gradle:1.2.3'          // note: not place application dependencies here; belong         // in individual module build.gradle files     } }  allprojects {     repositories {         jcenter()         mavencentral()     } } 

in repository artifact located? root project or module project? have buildscript section(s) in root/module project?

buildscript {     repositories {         jcenter()         mavencentral()         mavenlocal()     }     dependencies {        // external dependencies loaded (with needed one)        classpath 'org.reflections:reflections:0.9.10'     } } 

Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -