简体   繁体   English

Gradle在Android Studio中找不到本地Maven依赖项

[英]Local maven dependency not found by gradle in android studio

Android studio cannot find a dependency which is obviously in my local repository. Android studio找不到明显存在于本地存储库中的依赖项。 Error: 错误:

Error:Failed to find: com.poppy:tutti-frutti-dtos:1.0.0-SNAPSHOT Open File 错误:找不到:com.poppy:tutti-frutti-dtos:1.0.0-SNAPSHOT打开文件
Open in Project Structure dialog 在项目结构对话框中打开

I am using the gradle wrapper and Android studio 1.0.2. 我正在使用gradle包装器和Android Studio 1.0.2。 I have double checked the name of my dependency and I have the following build.gradle file for the project. 我已经仔细检查了依赖项的名称,并且该项目具有以下build.gradle文件。 I have also tried with mavenLocale() which doesn't not seem to work either. 我也尝试过mavenLocale()似乎也不起作用。 Any advice to debug this? 有什么建议可以调试吗?

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        maven { url 'D:/Users/Math/.m2/repository' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.0.0'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects{
    repositories {
        jcenter()
        maven { url 'D:/Users/Math/.m2/repository' }
    }
}

Here is the dependency section of the module build.gradle file of my project: 这是我的项目的模块build.gradle文件的依赖项部分:

apply plugin: 'com.android.application'
dependencies {
    compile 'com.google.android.gms:play-services:6.1.11'
    compile 'org.springframework.android:spring-android-rest-template:2.0.0.M1'
    compile 'com.google.code.gson:gson:2.3'
    compile 'com.android.support:appcompat-v7:21.0.+'
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.pnikosis:materialish-progress:1.2'
compile 'com.poppy:tutti-frutti-dtos:1.0.0-SNAPSHOT'
    androidTestCompile 'junit:junit:4.+'
}

My library is located here: D:\\Users\\Math.m2\\repository\\com\\poppy\\tutti-frutti-dtos\\1.0.0-SNAPSHOT And there are four files under that folder: 我的库位于此处:D:\\ Users \\ Math.m2 \\ repository \\ com \\ poppy \\ tutti-frutti-dtos \\ 1.0.0-SNAPSHOT该文件夹下有四个文件:

  • _remote.repositories _remote.repositories
  • maven-metadata-local.xml 行家-元数据那个local.xml
  • tutti-frutti-dtos-1.0.0-SNAPSHOT.jar 什锦FRUTTI-DTOS-1.0.0-SNAPSHOT.jar
  • tutti-frutti-dtos-1.0.0-SNAPSHOT.pom 什锦FRUTTI-DTOS-1.0.0-SNAPSHOT.pom

path is not match Math/.m2 -> Math.m2 路径不匹配Math / .m2-> Math.m2

maven { url 'D:/Users/Math/.m2/repository' }

D:\Users\Math.m2\repository\com\poppy\tutti-frutti-dtos\1.0.0-SNAPSHOT

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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