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.

Task :migrateToRefreshVersionsDependenciesConstants/refreshVersions FAILED

See original GitHub issue

Hi @LouisCAD ,I have been trying to use refreshVersions recently to optimize the dependencies used in the gradle files of my project.

I am sure that after checking the documentation many times, the current method is correct, but I don’t know why it still makes an error. I hope to get your advice.

My expected result:

Still based on the buildSrc method, split all the dependencies used in my project, such as all the dependencies in app/weight/helper, into buildSrc, such as Libs or Versions, and the build.gradle in the actual module can be directly Point attributes using the type name. And it also supports detecting whether the current dependency has the latest version.

In the first step, I upgraded my gradle to 6.4.1

./gradlew wrapper --gradle-version 6.4.1

The second step is to modify the contents of settings.gradle in the root directory

// settings.gradle.kts
import de.fayard.refreshVersions.RefreshVersionsSetup

// Here you might have some pluginManagement block:
pluginManagement {
     //...
}

buildscript {
     repositories {gradlePluginPortal()}
     dependencies.classpath("de.fayard.refreshVersions:refreshVersions:0.9.5")
}

rootProject.name ='FingerAdvisor_Android'
include':app'
include':helper'
include':weight'

RefreshVersionsSetup.bootstrap(settings)

Then began to execute the command:

./gradlew migrateToRefreshVersionsDependenciesConstants --console=plain

I have been studying for a long time, and I don’t know where the problem occurred.

➜  xxx_Android git:(master) ✗ ./gradlew migrateToRefreshVersionsDependenciesConstants --console=plain

> Task :migrateToRefreshVersionsDependenciesConstants
All the following modules have hardcoded dependencies versions

1. :app (7)
2. :helper (1)
3. :weight (1)
4. Exit

Type the number of the Gradle module you want to migrate first:
weight

> Task :migrateToRefreshVersionsDependenciesConstants FAILED
> Task :refreshVersions FAILED

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':migrateToRefreshVersionsDependenciesConstants'.
> java.util.InputMismatchException (no error message)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':refreshVersions'.
> Couldn't resolve version for ModuleId(group=androidx.test.ext, name=junit)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

* Get more help at https://help.gradle.org

BUILD FAILED in 10s
2 actionable tasks: 2 executed
➜  FingerAdvisor_Android git:(master) ✗ 

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10

github_iconTop GitHub Comments

4reactions
LouisCADcommented, Sep 15, 2020

Yes you are using the version placeholder correctly. BTW, instead of screenshotting issue comments, please give the link instead (get the permalink by clicking on the comment time/date next to the name of the commenter).

Great that you succeeded in using it correctly!

Regarding buildSrc we are providing an alternative to avoid you making frequent edits to buildSrc that would slow your builds down because of cache invalidations.

0reactions
HLQ-Strugglecommented, Sep 15, 2020

Sorry for what I did just now.

The following example:

  • Click to jump is not supported:

image

  • Although the replacement character is used, there is still a prompt that needs to be updated:

image

It seems to go against my original intention:

  • One-time citation, full-text (project) use, avoiding repeated dependencies introduced by teamwork;
  • Comes with dependency update prompt;
  • Support normal operations such as jumps (still not supported).

Is there any good solution?

Read more comments on GitHub >

github_iconTop Results From Across the Web

ERROR: Migration task failed to complete - DataStax Support
The migration tasks basically means getting the schemas from other nodes. The node won't bootstrap unless the migration tasks complete first.
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