Materialdrawer: Error:Failed to resolve: Android-Iconics:iconics-core:unspecified

Created on 22 Aug 2015  Â·  45Comments  Â·  Source: mikepenz/MaterialDrawer

Since I reconfigured my code to use v4.0.0, Android Studio does not compile! Anything I try fails with that message:

Error:Failed to resolve: Android-Iconics:iconics-core:unspecified

Even when I try to clean the project I get:

Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
   > Could not find Android-Iconics:iconics-core:unspecified.
     Searched in the following locations:
         https://jcenter.bintray.com/Android-Iconics/iconics-core/unspecified/iconics-core-unspecified.pom
         https://jcenter.bintray.com/Android-Iconics/iconics-core/unspecified/iconics-core-unspecified.jar
         file:/home/dan/DevAndroid/sdk/extras/android/m2repository/Android-Iconics/iconics-core/unspecified/iconics-core-unspecified.pom
         file:/home/dan/DevAndroid/sdk/extras/android/m2repository/Android-Iconics/iconics-core/unspecified/iconics-core-unspecified.jar
         file:/home/dan/DevAndroid/sdk/extras/google/m2repository/Android-Iconics/iconics-core/unspecified/iconics-core-unspecified.pom
         file:/home/dan/DevAndroid/sdk/extras/google/m2repository/Android-Iconics/iconics-core/unspecified/iconics-core-unspecified.jar
     Required by:
         CollecteRecouris:app:unspecified > com.mikepenz:fontawesome-typeface:4.4.0.1

This never happened before when using v3. But, I already updated all my code to use v4, today!
This is what's included in app's build.gradle:

  compile 'com.mikepenz:materialdrawer:4.0.0'
  compile 'com.mikepenz:iconics-core:1.7.3'
  compile 'com.mikepenz:fontawesome-typeface:4.4.0.1'
question

All 45 comments

Can you try to add mavenCentral() as dependency repository?

Added mavenCentral() to app's build.gradle (_not the project's build.gradle_) with these lines:

repositories {
  mavenCentral()
}

But, error remains the same!

Added mavenCentral() to project's build.gradle (_not the app's build.gradle_) with these lines:

repositories {
  jcenter()
  mavenCentral()
}

Still the same error is showing and blocking!!

Is there another way to add mavenCentral() as dependency?

And you updated to the latest v23 build tools and target sdk version and 1.3 gradle build tools?

Yes!

apply plugin: 'com.android.application'

android {
  compileSdkVersion 23
  buildToolsVersion "23.0.0"

  defaultConfig {
    applicationId "com.veryexample.appmaterial"
    minSdkVersion 14
    targetSdkVersion 23
    versionCode 3
    versionName "3.0"
  }
  buildTypes {
    release {
      minifyEnabled false
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
  }
}

repositories {
  mavenCentral()
}

dependencies {
  compile fileTree(include: ['*.jar'], dir: 'libs')
  compile 'com.android.support:appcompat-v7:23.0.0'
  compile 'com.mikepenz:materialdrawer:4.0.0'
  compile 'com.mikepenz:iconics-core:1.7.3'
  compile 'com.mikepenz:fontawesome-typeface:4.4.0.1'
}

Using Android Studio 1.3.2.
This is project's build.gradle:

buildscript {
  repositories {
    jcenter()
  }
  dependencies {
    classpath 'com.android.tools.build:gradle:1.3.0'

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

allprojects {
  repositories {
    jcenter()
  }
}

_Was using MaterialDrawer with the same configuration without problem before moving to 4.0.0._

Just tried a Run>Rebuild from Android Studio menu and got again:

Error:Failed to resolve: Android-Iconics:iconics-core:unspecified

Hmmm really strange. A similar configuration is working for me on multiple projects. Also for some friends.

I'm currently on vacation until tomorrow. Will take a closer look then

Meanwhile, here is a screenshot.
selection_126

Found that this only happens when I add

compile 'com.mikepenz:fontawesome-typeface:4.4.0.1'

to app's build.gradle.

When this line is removed from build.gradle:

  compile fileTree(include: ['*.jar'], dir: 'libs')
  compile 'com.android.support:appcompat-v7:23.0.0'
  compile 'com.mikepenz:materialdrawer:4.0.0'
  compile 'com.mikepenz:iconics-core:1.7.3'

then compilation succeeds and whole build is successful!
But FontAwesome seems missing.

If you only have mavenCentral or mavenCentral. before jCenter?

Changed my project's build.gradle to this:

// 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:1.3.0'

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

allprojects {
  repositories {
    mavenCentral()
  }
}

and did a clean/build, but still got:

Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
   > Could not find Android-Iconics:iconics-core:unspecified.
     Searched in the following locations:
         https://repo1.maven.org/maven2/Android-Iconics/iconics-core/unspecified/iconics-core-unspecified.pom
         https://repo1.maven.org/maven2/Android-Iconics/iconics-core/unspecified/iconics-core-unspecified.jar
         file:/home/dan/DevAndroid/sdk/extras/android/m2repository/Android-Iconics/iconics-core/unspecified/iconics-core-unspecified.pom
         file:/home/dan/DevAndroid/sdk/extras/android/m2repository/Android-Iconics/iconics-core/unspecified/iconics-core-unspecified.jar
         file:/home/dan/DevAndroid/sdk/extras/google/m2repository/Android-Iconics/iconics-core/unspecified/iconics-core-unspecified.pom
         file:/home/dan/DevAndroid/sdk/extras/google/m2repository/Android-Iconics/iconics-core/unspecified/iconics-core-unspecified.jar
     Required by:
         CR (version with mikepenz-MaterialDrawer):app:unspecified > com.mikepenz:fontawesome-typeface:4.4.0.1

selection_127

@bzkdjc can you try to add the materialdrawer dependenc with the transitive part?

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

and remove the iconics-core dependency (this is already part of the materialdrawer)
and then also add the font dependency?

This is my build.gradle now:

dependencies {
  compile fileTree(include: ['*.jar'], dir: 'libs')
  compile 'com.android.support:appcompat-v7:23.0.0'
  compile('com.mikepenz:materialdrawer:4.0.0@aar') {
    transitive = true
  }
  compile 'com.mikepenz:fontawesome-typeface:4.4.0.1'
...

I get that exact same error:

Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
   > Could not find Android-Iconics:iconics-core:unspecified.
     Searched in the following locations:
         https://repo1.maven.org/maven2/Android-Iconics/iconics-core/unspecified/iconics-core-unspecified.pom
         https://repo1.maven.org/maven2/Android-Iconics/iconics-core/unspecified/iconics-core-unspecified.jar
         file:/home/dan/DevAndroid/sdk/extras/android/m2repository/Android-Iconics/iconics-core/unspecified/iconics-core-unspecified.pom
         file:/home/dan/DevAndroid/sdk/extras/android/m2repository/Android-Iconics/iconics-core/unspecified/iconics-core-unspecified.jar
         file:/home/dan/DevAndroid/sdk/extras/google/m2repository/Android-Iconics/iconics-core/unspecified/iconics-core-unspecified.pom
         file:/home/dan/DevAndroid/sdk/extras/google/m2repository/Android-Iconics/iconics-core/unspecified/iconics-core-unspecified.jar
     Required by:
         CR (version with mikepenz-MaterialDrawer):app:unspecified > com.mikepenz:fontawesome-typeface:4.4.0.1

Did you say to also remove the fontawesome dependency? I read "also add the font dependency." The problem may come from that fontawesome dependency.

selection_128

The whole build.gradle:

apply plugin: 'com.android.application'

android {
  compileSdkVersion 23
  buildToolsVersion "23.0.0"

  defaultConfig {
    applicationId "com.veryexample.cr"
    minSdkVersion 14
    targetSdkVersion 23
    versionCode 3
    versionName "3.0"
  }
  buildTypes {
    release {
      minifyEnabled false
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
  }
}

dependencies {
  compile fileTree(include: ['*.jar'], dir: 'libs')
  compile 'com.android.support:appcompat-v7:23.0.0'
  compile('com.mikepenz:materialdrawer:4.0.0@aar') {
    transitive = true
  }
  compile 'com.mikepenz:fontawesome-typeface:4.4.0.1'
  compile project(':imageResizer')
  compile 'com.github.gabrielemariotti.cards:cardslib-core:2.1.0'
  compile 'com.github.gabrielemariotti.cards:cardslib-cards:2.1.0'
  compile 'com.squareup.picasso:picasso:2.5.2'
  compile 'com.snappydb:snappydb-lib:0.5.2'
  compile 'com.esotericsoftware.kryo:kryo:2.24.0'
  compile 'com.github.lawloretienne:trestle:0.0.2'
}

@bzkdjc i am still not sure why your gradle can't resolve it, as it is working for everyone else. If you run the sample application (of the MaterialDrawer, just download the repo and start the sample) will it also show the same exception?

@bzkdjc can you please zip and send me the small sample app you've created. i hope it will also fail with the same exception on my system.

Removing extra code and zipping...
Done!

Just zipped and 'email'ed.

@bzkdjc do you want to know something. it showed the same issue for me.

after that i added

    compile 'com.mikepenz:google-material-typeface:1.2.0.1@aar'

in addition to

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

and it worked.

So i removed

    compile 'com.mikepenz:google-material-typeface:1.2.0.1@aar'

again. but it still works. do not ask my what gradle does here, or why it has troubles first and then it doesn't but yeah.

So... I'm going to try to add google-material-typeface and then removed it.
Trying...

Added google-material-typeface like this:

dependencies {
  compile fileTree(include: ['*.jar'], dir: 'libs')
  compile 'com.android.support:appcompat-v7:23.0.0'
  compile('com.mikepenz:materialdrawer:4.0.0@aar') {
    transitive = true
  }
  compile 'com.mikepenz:google-material-typeface:1.2.0.1'
  compile 'com.mikepenz:fontawesome-typeface:4.4.0.1'
}

But here, still shows that exact same issue!
Maybe should I change to v4.0.1??...

@bzkdjc here is the one which is working on my machine now: https://docs.google.com/uc?id=0B4Y8HN2BnSjpc182bk1uQjBxMFk&export=download

Going to try that...

Hoping that this will not be cause of trouble here:
sync android sdks_129

@bzkdjc no. just a different path of my sdk. it's ok

Yes!
That version does compile successfully :)

@bzkdjc you can check. no differences in the gradle. right?

Yes! Then, what's up with previous version??

And can I move to your latest 4.0.1??

@bzkdjc yes you can update to the latest.

i still do not know why it is / was not compiling for you

FontAwesome now appears OK.
Just move to v4.0.1 OK.
Now all's good!

Thank you very much for your time :)

@bzkdjc thank you so much that you did not go crazy :D and sorry for the issues. and sorry that i still do not really know what'S the problem :O

@bzkdjc found the issues. and now i know why it only happens for some people.

The difference between my gradle and dependencies and yours is that i always add @aar for Android libs. This (i believe) tells gradle to handle the dependency a bit different. (if i'm correct it sets transitive: false in the background) (so it is working for most people as it is also written with @aar in the readme)

So you now have to options. either you add @aar add the end of the typeface dependencies like this:

compile('com.mikepenz:google-material-typeface:1.2.0.1@aar')
compile('com.mikepenz:fontawesome-typeface:4.4.0.1@aar')

or you add transitive: false like in this sample:

compile('com.mikepenz:google-material-typeface:1.2.0.1') {
        transitive = false
}
compile('com.mikepenz:fontawesome-typeface:4.4.0.1') {
        transitive = false
}

Sorry to say exact issue for me, just tried every combination on this topic with no luck

@alejandroluengo you also haven mavenCentral()?

Hi @mikepenz. Sorry, I have exactly the same problem here. Have you found the source of the problem? I shared a screenshot. Regards!
captura de pantalla 2016-09-19 a las 12 45 02 pm

@hectorggp is your gradle in offline mode? as of the log it does not search on mavenCentral nor in jCenter

no, not in offline mode according to preferences> build, execution,
deployment> Build tools> Gradle

2016-09-19 11:45 GMT-07:00 Mike Penz [email protected]:

@hectorggp https://github.com/hectorggp is your gradle in offline mode?
as of the log it does not search on mavenCentral nor in jCenter

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/mikepenz/MaterialDrawer/issues/574#issuecomment-248084524,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADQ-kw5icesSc2xJZYdl4beV8_86yp3mks5qrthlgaJpZM4FwWvc
.

Héctor G. Gatica Paz -- Cel. (502) 5558 9832

@hectorggp but your gradle output shows that it is not searching online

Yes, but I have not selected this option. Surely it is Gradle problem. I'll
check this. Thank you

2016-09-19 11:51 GMT-07:00 Mike Penz [email protected]:

@hectorggp https://github.com/hectorggp but your gradle output shows
that it is not searching online

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/mikepenz/MaterialDrawer/issues/574#issuecomment-248086320,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADQ-k9FTIlzxGpGk7tmp7_gvv5bUkpWjks5qrtm9gaJpZM4FwWvc
.

Héctor G. Gatica Paz -- Cel. (502) 5558 9832

@hectorggp ok great

I've found one more simple issue for resolving problem with FontAwesome importing. Yes, not compiling but importing. I was using old version (com.mikepenz.materialdrawer:library:0.9.5@aar), and when i was update it to 5.9.2, i've got problem with FontAwesome class. Nothing helped me, but.
When i have delete import of FontAwesome in my class it automatically imports new one. There is another path to this class.
Hope this will help somebody :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sonh picture sonh  Â·  3Comments

singhalavi picture singhalavi  Â·  4Comments

Erwinstein picture Erwinstein  Â·  3Comments

Meeks91 picture Meeks91  Â·  3Comments

fuentepa picture fuentepa  Â·  3Comments