简体   繁体   中英

Include dependency from Maven local repository on Android Studio Gradle

I think I'm stupid or I'm missing something -hope the latter- but I can't properly import a dependency.

I have the repository in ~/.m2/repository and inside the directory I can see the deploy.

The maven setting.xml has the

<localRepository>${user.home}/.m2/repository</localRepository>

Here is the gradle file:

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':lib_facebook')
compile project(':lib_dslrdashboard')
apt "org.androidannotations:androidannotations:3.2"
compile 'org.androidannotations:androidannotations-api:3.2'
compile 'de.livereach:rpc-objects-android:1.0.0'//THIS IS THE LOCAL DEPENDENCY
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'org.slf4j:slf4j-android:1.6.1-RC1'
compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE'
compile 'com.fasterxml.jackson.core:jackson-databind:2.3.2'
compile 'de.keyboardsurfer.android.widget:crouton:1.8.5@aar'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
compile 'com.github.castorflex.smoothprogressbar:library:1.1.0'
compile('com.crashlytics.sdk.android:crashlytics:2.2.3@aar') {
    transitive = true;
}
compile('com.twitter.sdk.android:twitter:1.4.0@aar') {
    transitive = true;
}

}

I'm on Mac OSx 10.10

Thanks in advance!

Gradle doesn't look at your Maven local repository by default. You need to explicitly ask it to:

allprojects {
    repositories {
        jcenter()
        mavenLocal()    // add this line
    }
}

Gradle DSL Docs for mavenLocal() : docs.gradle.org/…

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