question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Most dependencies cannot be resolved

See original GitHub issue

This is a multi-module Android project (Pinterest) and I’m sure it’s something we’re doing wrong, but the --info flag is not providing a lot of additional information:

 - android.arch.work:work-runtime
The exception that is the cause of unresolved state: Could not resolve android.arch.work:work-runtime:+.
 - com.adjust.sdk:adjust-android
The exception that is the cause of unresolved state: Could not resolve com.adjust.sdk:adjust-android:+.
 - com.adyen.checkout:core-card
The exception that is the cause of unresolved state: Could not resolve com.adyen.checkout:core-card:+.
 - com.android.installreferrer:installreferrer
The exception that is the cause of unresolved state: Could not resolve com.android.installreferrer:installreferrer:+.
 - com.android.support:appcompat-v7
The exception that is the cause of unresolved state: Could not resolve com.android.support:appcompat-v7:+.
 - com.android.support:cardview-v7
The exception that is the cause of unresolved state: Could not resolve com.android.support:cardview-v7:+.
 - com.android.support:customtabs
The exception that is the cause of unresolved state: Could not resolve com.android.support:customtabs:+.
 - com.android.support:design
The exception that is the cause of unresolved state: Could not resolve com.android.support:design:+.

It’s not just android dependencies, just including that snippet.

I thought it might be because we’re specifying our versions via variables:

implementation "com.squareup.okhttp3:logging-interceptor:${rootProject.ext.okHttpVersion}"
    implementation "com.squareup.okhttp3:okhttp-urlconnection:${rootProject.ext.okHttpVersion}"
    implementation "com.squareup.retrofit2:adapter-rxjava2:${rootProject.ext.retrofitVersion}"
    implementation "com.squareup.retrofit2:converter-gson:${rootProject.ext.retrofitVersion}"

but even when I changed them to hardcoded strings, we get the same issue.

Is there anything I can do to get more information? Unfortunately I cannot easily provide our gradle files.

We’re using Gradle 5.1.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ben-manescommented, May 16, 2019

haha, okay. You can condition that to run if dependencyUpdates is not in the task graph. It’s a bit of a hack, but seems to work for most.

gradle.taskGraph.whenReady { taskGraph ->
  def requested = details.requested
  if (requested.version.contains('+') && !taskGraph.hasTask(dependencyUpdates)) {
    // throw
  }
}
0reactions
shashachucommented, May 16, 2019

User error! We have this snippet in our gradle file:

afterEvaluate { project ->
        project.configurations.all {
            resolutionStrategy.eachDependency { DependencyResolveDetails details ->
                def requested = details.requested
                if (requested.version.contains('+')) {
                    throw new GradleException(
                            "Wildcard dependency forbidden: ${requested.group}:${requested.name}:${requested.version}")
                }
            }
        }
    }

🤦‍♀

I’m not sure why I didn’t see that exception in the logs, but you mentioning the resolutionStrategy pointed me in the right direction.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to resolve dependency tree error when installing npm ...
You have dependency conflict (incorrect and potentially broken dependency) as it says, so try to run the command with --force , or --legacy-peer ......
Read more >
Package dependencies cannot be resolved - Ask Ubuntu
Package dependencies cannot be resolved ... I am using Ubuntu 12.04. When I try to open a video file like a file with...
Read more >
Failed to retrieve a list of dependencies: Cannot resolve ...
I'm a Godep user, but wanted to see if I had out of date dependencies. I was only able to get a bunch...
Read more >
Learning the Basics - Gradle User Manual
Gradle can resolve dependencies from one or many repositories based on Maven, ... Origin of artifacts cannot be tracked, which is a correctness...
Read more >
Dependency hell - Wikipedia
The dependency issue arises when several packages have dependencies on the same shared packages or libraries, but they depend on different and incompatible ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found