【问题标题】:Error:Failed to resolve: Android-Iconics:library-core:unspecified错误:无法解决:Android-Iconics:library-core:unspecified
【发布时间】:2016-07-06 23:18:49
【问题描述】:

错误:无法解决:Android-Iconics:library-core:unspecified

所以,我得到了这个错误

错误:无法解决:Android-Iconics:library-core:unspecified

在我尝试编译后在我的 Android Studio 2.1 Preview 3 中

编译'com.mikepenz:fontawesome-typeface:4.5.0.1'

我尝试了许多其他选项,但未能以任何方式编译它。我还添加了标志性库,但它仍然给我同样的错误。 那么,任何人都可以帮我解决这个问题吗?

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "24.0.0 rc2"

    defaultConfig {
        applicationId ""
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    repositories {
        mavenCentral()
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.1'
    compile 'com.android.support:design:23.2.1'
    compile 'com.google.code.gson:gson:2.6.2'
    compile('com.mikepenz:materialdrawer:5.1.5@aar') {
        transitive = true
    }
    compile 'com.mikepenz:iconics-core:2.5.10@aar'
    compile 'com.mikepenz:google-material-typeface:2.2.0.1.original@aar'
    compile 'com.mikepenz:fontawesome-typeface:4.5.0.1'
}

【问题讨论】:

    标签: android android-studio


    【解决方案1】:

    我遇到了一些问题,但解决方案是在库的版本名称后添加“@aar”。如下...

    compile 'com.mikepenz:fontawesome-typeface:4.6.0.1@aar'
    

    完整的依赖代码

    dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')
        testCompile 'junit:junit:4.12'
        compile 'com.android.support:appcompat-v7:23.3.0'
        compile('com.mikepenz:materialdrawer:5.2.0@aar') {
            transitive = true
        }
        compile 'com.squareup.picasso:picasso:2.5.2'
        compile 'com.mikepenz:iconics-core:2.5.11@aar'
        compile 'com.mikepenz:fontawesome-typeface:4.6.0.1@aar'
        compile 'com.mikepenz:google-material-typeface:2.2.0.1.original@aar'
    }
    

    这对我有用,Gradle 同步成功,没有错误。 谢谢。

    【讨论】:

      【解决方案2】:

      虽然我已经解决了这个问题很多天了,但我还是想回答。

      Jaldeep Asodariya 的回答是正确的。

       compile('com.mikepenz:materialdrawer:5.2.0@aar') {
          transitive = true
      }
      

      现在我们有两个选择:

      1. 要么在末尾库添加@aar,不添加transitive = false,就不要添加任何东西,它会工作。如果您不添加任何内容,则 Transitive 默认为 true。
      2. 如果您真的很喜欢传递,那么您应该始终将其提及为true。如果为 false,则会显示此错误。就像每当我们获取库 @aar 时,在大多数情况下,transitive 应该为 true。

      除此之外,您还可以随时查看 github 的错误 wiki 库。

      【讨论】:

        猜你喜欢
        • 2010-10-27
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-12-10
        • 2016-12-15
        • 2013-09-26
        • 2021-10-24
        相关资源
        最近更新 更多