FragNav icon indicating copy to clipboard operation
FragNav copied to clipboard

Failed to resolve: com.ncapdevi:frag-nav:3.2.0 (jcenter sunset)

Open t1d opened this issue 1 year ago • 33 comments

Dependency Resolution Issue: frag-nav

Background: On August 15, 2024, Jcenter was officially sunset, redirecting all its content to MavenCentral. However, the following dependency is not available on MavenCentral and cannot be resolved:

  • classpath "de.mannodermaus.gradle.plugins:android-junit5:1.3.1.1"
  • (maybe more)

Details:

  1. Jcenter Sunset The sunsetting of Jcenter has caused issues with dependency resolution, as it now redirects to MavenCentral where some dependencies, like the one mentioned above, are not hosted. Official announcement: Jcenter Sunset - JFrog.
  2. Jitpack.io Issues As a potential workaround, I explored using Jitpack.io. Unfortunately, Jitpack.io builds dependencies on-demand. This makes it unreliable for resolving the frag-nav dependency because of the mentioned jcenter redirect. Reference: Jitpack Building. #252 and @eggplants comment in this issue.
  3. Gradle Caching Masking the Issue The issue was initially discovered during the setup of a new development environment. The problem did not manifest for my co-workers due to Gradle's caching mechanism, which retained the dependency locally. Even after invalidating caches in Android Studio, the issue persists on a fresh setup because the required dependency is no longer resolvable.

Proposed Next Steps

I'm open to working on resolving this issue, but the repository appears to have been inactive for a few years. Given this, I’m wondering whether you, @ncapdevi, or other maintainers would suggest a long-term solution or have any input on the best course of action.

I wanna made this insights available for everyone because as seen in the repository there are still people using frag-nav

Any guidance or suggestions would be appreciated!

t1d avatar Sep 05 '24 14:09 t1d

Hi @t1d yes, if I can get some feedback that the library is still in active use, then taking a weekend to migrate things over seems like the right call, and something that I could do.

ncapdevi avatar Sep 05 '24 20:09 ncapdevi

Hi @ncapdevi, we have the same problem and we continue using the library in version 2.4.0, we hope to continue using it, thank you.

GerardBizagi avatar Sep 05 '24 21:09 GerardBizagi

Its impossible build the pipeline in Azure with this, we use 2.4.0 version and don't works

bryancubillos avatar Sep 05 '24 21:09 bryancubillos

Hi @ncapdevi, we have the same issue and we need this library in any way. Thank you!

Failed to transform FragNav-3.3.0.aar (com.github.ncapdevi:FragNav:3.3.0) to match attributes {artifactType=android-databinding, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-api}. > Could not find FragNav-3.3.0.jar (com.github.ncapdevi:FragNav:3.3.0). Searched in the following locations: https://jitpack.io/com/github/ncapdevi/FragNav/3.3.0/FragNav-3.3.0.aar https://jitpack.io/com/github/ncapdevi/FragNav/3.3.0/FragNav-3.3.0.jar

headsmanxxx avatar Sep 06 '24 06:09 headsmanxxx

Hi @ncapdevi, we have the same issue when building with Github actions. We got the same error as @headsmanxxx (we are also using version 3.3.0) Thank you šŸ™

PaulineKlein avatar Sep 06 '24 08:09 PaulineKlein

Hi @ncapdevi , can confirm it is in use (3.3.0), I would be extremely grateful if you'd migrate it. Thank you!

amatsegor avatar Sep 06 '24 08:09 amatsegor

Hi @ncapdevi we have the same issue and our release pipeline is now down :-( We use version 3.3.0

thorre avatar Sep 06 '24 10:09 thorre

FragNav build is failing. https://jitpack.io/com/github/ncapdevi/FragNav/3.3.0/build.log

android-junit5 has to be updated to 1.7.1.0 or higher. https://github.com/ncapdevi/FragNav/blob/498317c96c4436edd219f2bc10aa9e4ec3a94720/build.gradle#L12

https://jcenter.bintray.com/de/mannodermaus/gradle/plugins/android-junit5/ ↓ redirect https://repo1.maven.org/maven2/de/mannodermaus/gradle/plugins/android-junit5/

eggplants avatar Sep 09 '24 03:09 eggplants

Hi All, thanks for those replies. So I'm seeing this Issue getting a lot of traction, which confirms, that the lib is still in use. So I'm investing a few hours and see if i can fix the problem.

t1d avatar Sep 09 '24 15:09 t1d

This Udemy course uses this library and for now it's impossible to build a GitHub project that is linked to this course so students can't do exercises that are included there.

Enjot avatar Sep 09 '24 16:09 Enjot

Hi @ncapdevi we have the same issue and our release pipeline is now down :-( We use version 3.3.0

abhishekgupta-mset avatar Sep 10 '24 08:09 abhishekgupta-mset

Hi @ncapdevi we are also facing the same issue causing our release pipeline resulting in failure. We are using version 3.3.0

mohammadhaseeb-mset avatar Sep 10 '24 08:09 mohammadhaseeb-mset

Hii @ncapdevi we are also facing same issue, our pipeline is down now.. using 3.3.0.

@abhishekgupta-mset @mohammadhaseeb-mset @muhammadsabeelahmed-mset You can fork and modify this repo under Apache License freely.

eggplants avatar Sep 10 '24 15:09 eggplants

Hey, the same issue here. Who can help with this? I am already thinking about forking the lib and put it into the project!!

davit-zakaryan avatar Sep 10 '24 15:09 davit-zakaryan

also have problem

TonyLead avatar Sep 10 '24 19:09 TonyLead

maybe author can share aar ?

TonyLead avatar Sep 11 '24 07:09 TonyLead

@ncapdevi I have added aar and jar file for 3.3.0 PR link

A7ak avatar Sep 11 '24 08:09 A7ak

@A7ak do you also have one for 2.4.0, as my project has not been upgraded to use version 3?

sunenielsen avatar Sep 13 '24 09:09 sunenielsen

@ncapdevi I managed to make the frag-nav project running but i have issues with the demo project. I invested a few hours but did not manage to made it work. I could push the changes to a branch.

t1d avatar Sep 16 '24 13:09 t1d

@t1d

I could push the changes to a branch

This one? https://github.com/t1d/frag-nav-reworked

eggplants avatar Sep 16 '24 13:09 eggplants

@t1d

I could push the changes to a branch

This one? https://github.com/t1d/frag-nav-reworked

Sorry haven't pushed it yet. There you go: https://github.com/t1d/FragNav/tree/misc/dump-dependencies

t1d avatar Sep 16 '24 13:09 t1d

@t1d Failed to build on JitPack. https://jitpack.io/com/github/t1d/FragNav/misc~dump-dependencies-8c36037dd3-1/build.log It appears that Gradle 8.2 requires Java 11, whereas some dependencies require Java 8.

error
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'build'.
> Could not resolve all files for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:8.2.2.
     Required by:
         project :
      > No matching variant of com.android.tools.build:gradle:8.2.2 was found. The consumer was configured to find a library for use during runtime, compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.2' but:
          - Variant 'apiElements' capability com.android.tools.build:gradle:8.2.2 declares a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component for use during compile-time, compatible with Java 11 and the consumer needed a component for use during runtime, compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.2')
          - Variant 'javadocElements' capability com.android.tools.build:gradle:8.2.2 declares a component for use during runtime, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.2')
          - Variant 'runtimeElements' capability com.android.tools.build:gradle:8.2.2 declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component, compatible with Java 11 and the consumer needed a component, compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.2')
          - Variant 'sourcesElements' capability com.android.tools.build:gradle:8.2.2 declares a component for use during runtime, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.2')
   > Could not resolve de.mannodermaus.gradle.plugins:android-junit5:1.11.0.0.
     Required by:
         project :
      > No matching variant of de.mannodermaus.gradle.plugins:android-junit5:1.11.0.0 was found. The consumer was configured to find a library for use during runtime, compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.2' but:
          - Variant 'apiElements' capability de.mannodermaus.gradle.plugins:android-junit5:1.11.0.0 declares a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component for use during compile-time, compatible with Java 11 and the consumer needed a component for use during runtime, compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.2')
          - Variant 'runtimeElements' capability de.mannodermaus.gradle.plugins:android-junit5:1.11.0.0 declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component, compatible with Java 11 and the consumer needed a component, compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.2')

* 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 1s
Running: ./gradlew -Pgroup=com.github.t1d -Pversion=misc~dump-dependencies-8c36037dd3-1 publishToMavenLocal
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2

eggplants avatar Sep 16 '24 14:09 eggplants

@t1d Try:

https://github.com/t1d/FragNav/blob/misc/dump-dependencies/frag-nav/build.gradle#L62-L65

To:

java {
-    sourceCompatibility = JavaVersion.VERSION_1_8
-    targetCompatibility = JavaVersion.VERSION_1_8
+    sourceCompatibility = JavaVersion.VERSION_11
+    targetCompatibility = JavaVersion.VERSION_11
}

References: https://docs.gradle.org/current/javadoc/org/gradle/api/JavaVersion.html#VERSION_11 https://stackoverflow.com/questions/72117858

eggplants avatar Sep 16 '24 14:09 eggplants

use this fix https://medium.com/@ag7aka/how-to-find-and-integrate-a-library-from-cache-in-android-jcenter-shudown-63682c8535f6

A7ak avatar Sep 26 '24 17:09 A7ak

@A7ak do you also have one for 2.4.0, as my project has not been upgraded to use version 3? https://github.com/ncapdevi/FragNav/issues/255#issuecomment-2377510790

A7ak avatar Sep 26 '24 17:09 A7ak

Any update?

bryancubillos avatar Oct 04 '24 15:10 bryancubillos

Hi! thanks for the active work in this library! We're still using version 3.3.0 in our App. 1M+ downloads šŸ™‚ It'd be awesome to have an available dependency. For the moment we'll use the jar and the aar

voghDev avatar Oct 15 '24 14:10 voghDev

This is the final dependency we've used after some failed attempts with other combinations:

root build.gradle:

allprojects {
  repositories {
    google()
    mavenCentral()
   ...
    maven(url = "https://jitpack.io") // <-- Make sure you have this dependency added
  }
}

app/build.gradle

implementation "com.github.ncapdevi:fragnav:3.3.0"

it is currently working for us. I hope it does for you too

voghDev avatar Oct 17 '24 10:10 voghDev

Solved! Add the next code in settings.gradle:

import org.gradle.api.initialization.resolve.RepositoriesMode


dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven { url "https://maven.google.com" }
        maven { url "https://jitpack.io" }
    }
}

Remove from root build.gradle:

allprojects {
   // Remove repositories from here
    repositories { -> Removed
        google()
        mavenCentral()
        maven { url "https://maven.google.com" }
        maven { url "https://jitpack.io" }
    }
   ....

Use your dependency like:

implementation "com.github.ncapdevi:fragnav:3.3.0"
    

jordizspmobile avatar Nov 02 '24 11:11 jordizspmobile