采用摇篮(Android的一室公寓)和本地Maven回购时,无法建立应用程序摇篮、一室、应用程序、公寓

2023-09-06 03:06:24 作者:一个醒不来的梦

我想包括图书馆 SLIK 和的卡-UI ,我使用的是Android的工作室和摇篮建设。该应用程序构建良好,没有这一点,但增加的依赖使构建失败。纵观生成的调试日志它似乎并没有在寻找在当地回购的ARR文件。我能看到的文件在那里,我都遵循了安装GitHub的wiki页面上的教程,并工作正常。错误是:

 发生配置项目中的问题:climbtrack。
>未能解决所有依赖关系配置:climbtrack:_debugCompile。
   >找不到com.afollestad.cardsui:图书馆:1.0快照。
     要求:
         ClimbTrack:climbtrack:不详
   >找不到com.afollestad.silk:图书馆:1.0快照。
     要求:
         ClimbTrack:climbtrack:不详
 

下面是我的build.gradle

  buildscript {
    库{
        mavenCentral()
    }
    依赖{
        类路径com.android.tools.build:gradle:0.7.+
    }
}
应用插件:'机器人'

库{
    mavenLocal()
    mavenCentral()
}

安卓{
    compileSdkVersion 18
    buildToolsVersion19.0.0

    defaultConfig {
        的minSdkVersion 15
        targetSdkVersion 19
        版本code 1
        VERSIONNAME1.0
    }
    buildTypes {
        推出 {
            runProguard假
            proguardFiles getDefaultProguardFile('ProGuard的-android.txt'),'ProGuard的-rules.txt
        }
    }
}

依赖{
    编译com.google.android.gms:播放服务:4.0.30
    编译com.afollestad.cardsui:图书馆:1.0快照
    编译com.afollestad.silk:图书馆:1.0快照
}
 

在谷歌播放服务的依赖工作正常,并没有发现从Maven的中央回购预期。 任何想法吗? 谢谢

解决方案 IntelliJ IDEA集成本地maven

这是错误的https://$c$c.google.com/p/android/issues/detail?id=63908

如果你看一下评论#3在这个bug,有一个变通方法。试试吧,看看它是否帮助:

  

这似乎与本地Maven仓库在摇篮1.9的bug。

     

请参阅https://plus.google.com/109385828142935151413/posts/hF7W59uZ7rX

     

现在变通的做法是使用

 行家{URL$ {System.env.HOME} /。平方米/库}
 

  而不是mavenLocal()

I am trying to include the library Slik and Cards-UI in my app, I'm using android studio and gradle to build. The app builds fine without this but adding the dependency make the build fail. Looking at the debug log of the build it doesn't seem to be looking in the local repo for the arr file. I can see the files are there and I have followed the tutorial on the github wiki page for the install and that works fine. The error is:

A problem occurred configuring project ':climbtrack'.
> Could not resolve all dependencies for configuration ':climbtrack:_debugCompile'.
   > Could not find com.afollestad.cardsui:library:1.0-SNAPSHOT.
     Required by:
         ClimbTrack:climbtrack:unspecified
   > Could not find com.afollestad.silk:library:1.0-SNAPSHOT.
     Required by:
         ClimbTrack:climbtrack:unspecified

Here is my build.gradle

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.7.+'
    }
}
apply plugin: 'android'

repositories {
    mavenLocal()
    mavenCentral()
}

android {
    compileSdkVersion 18
    buildToolsVersion "19.0.0"

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile 'com.google.android.gms:play-services:4.0.30'
    compile 'com.afollestad.cardsui:library:1.0-SNAPSHOT'
    compile 'com.afollestad.silk:library:1.0-SNAPSHOT'
}

The google play services dependency works fine and is found from the maven central repo as expected. Any ideas anyone? Thanks

解决方案

This is bug https://code.google.com/p/android/issues/detail?id=63908

If you look at comment #3 in that bug, there's a workaround. Try it and see if it helps:

This appears to be a bug in Gradle 1.9 with local Maven repositories.

See https://plus.google.com/109385828142935151413/posts/hF7W59uZ7rX

The workaround for now is to use

 maven {   url "${System.env.HOME}/.m2/repository" } 

instead of mavenLocal()