Gradle只从Maven Central下载.aar.asc [英] Gradle only downloads .aar.asc from Maven Central

查看:469
本文介绍了Gradle只从Maven Central下载.aar.asc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我新部署了一个名为 TypedPreferences 的Android库。我在另一个Android项目中使用了它几天。突然间,它停止工作 - 无法再发现依赖项。我注意到当我清理项目时,Gradle只下载一个文件:

 下载http://repo1.maven.org/maven2 / info / metadude / android / typed-preferences / \ 
1.0.0 / typed-preferences-1.0.0.aar.asc

这些是我的宠物项目的构建文件:

build.gradle

  //顶级构建文件,您可以在其中添加配置
//所有子选项项目/模块。

buildscript {
repositories {
mavenCentral()
}
依赖关系{
classpath'com.android.tools.build:gradle: 0.8。+'
}
}

allprojects {
存储库{
mavenCentral()
maven {
url$ {System.env.HOME} /。m2 / repository
}
maven {
urlhttps://github.com/novoda/public-mvn-repo/raw/master/发布
}
}
}

app / build.gradle

  apply plugin:'android'
apply插件:'idea'

idea {
module {
downloadJavadoc = true
downloadSources = true
}
}

android {
compileSdkVersion 19
buildToolsVersion19.0.1

defaultConfig {
minSdkVersion 8
targetSdkVersion 19
versionCode 1
versionName1.0
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.txt'
}
}
packagingOptions {
不包括'META-INF / LICENSE'
不包括'META-INF / NOTICE'
}
}

依赖关系{
编译'com.android.support:support-v4:19.0.+'
编译'com.android.support:appcompat-v7:19.0.+'
compile'c​​om.squareup.okhttp:okhttp:1.3。+'
compile'c​​om.fasterxml.jackson.core:jackson-databind:2.2。+'
compile'c​​om.fasterxml。 jackson-core:2.2。+'
compile'c​​om.fasterxml.jackson.core:jackson-annotations:2.2。+'
compile'c​​om.novoda:sqliteprovider-core:1.0。 +'
compile'c​​om.androidmapsextensions:android-maps-extensions:2.1。+'
compile'c​​om.google.android.gms:play-services:3.2 。+'
compile'info.metadude.android:typed-preferences:1.0.0'
}

正如您所看到的,我也启用了Gradle来查看我的本地Maven缓存:

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

我删除了相关的文件夹,以避免从那里加载Gradle。


$ b

build.gradle 库的文件 - 请在这里找到它们:





请告诉我我是否可以测试您的修补程序而不是部署到Maven Central。

解决方案

看起来像包装元素已公布的POM具有错误的价值。它应该是 aar ,而不是 aar.asc


I freshly deployed an Android library named TypedPreferences. I used it in another Android project for some days. Suddenly, it stopped working - dependencies cannot be found any longer. I noticed that Gradle only downloads one file when I clean the project:

Download http://repo1.maven.org/maven2/info/metadude/android/typed-preferences/ \
  1.0.0/typed-preferences-1.0.0.aar.asc

These are build files of my pet project:

build.gradle:

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

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

allprojects {
    repositories {
        mavenCentral()
        maven {
            url "${System.env.HOME}/.m2/repository"
        }
        maven {
            url "https://github.com/novoda/public-mvn-repo/raw/master/releases"
        }
    }
}

app/build.gradle:

apply plugin: 'android'
apply plugin: 'idea'

idea {
    module {
        downloadJavadoc = true
        downloadSources = true
    }
}

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.1"

    defaultConfig {
        minSdkVersion 8
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
    }
}

dependencies {
    compile 'com.android.support:support-v4:19.0.+'
    compile 'com.android.support:appcompat-v7:19.0.+'
    compile 'com.squareup.okhttp:okhttp:1.3.+'
    compile 'com.fasterxml.jackson.core:jackson-databind:2.2.+'
    compile 'com.fasterxml.jackson.core:jackson-core:2.2.+'
    compile 'com.fasterxml.jackson.core:jackson-annotations:2.2.+'
    compile 'com.novoda:sqliteprovider-core:1.0.+'
    compile 'com.androidmapsextensions:android-maps-extensions:2.1.+'
    compile 'com.google.android.gms:play-services:3.2.+'
    compile 'info.metadude.android:typed-preferences:1.0.0'
}

As you can see, I also enable Gradle to look into my local Maven cache here:

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

I deleted the relevant folders to avoid Gradle loading stuff from there.

There might be a misconfiguration in the build.gradle files of the library - please find them here:

Please tell me also whether I can test your fix locally without deploying to Maven Central.

解决方案

Looks like the packaging element of the published POM has the wrong value. It should be aar, not aar.asc.

这篇关于Gradle只从Maven Central下载.aar.asc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆