Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JCenter goes into read-only state after March 31st 2021 (new artifacts will not be accepted) #10906

Closed
dejan2609 opened this issue Feb 4, 2021 · 15 comments
Labels

Comments

@dejan2609
Copy link

dejan2609 commented Feb 4, 2021

Before everything else: I can help and I will help.

(for a draft PR skip here)#10907

External links:

Quote (JFrog original blog post, published on February 3rd, 2021):

May 1st | Bintray, JCenter, GoCenter, and ChartCenter services will no longer be available

It seems that this build depends on a 'com.amulyakhare.textdrawable' plugin that is hosted on a Bintray: https://github.com/signalapp/Signal-Android/blob/v5.3.12/app/build.gradle#L37

    maven { // textdrawable
        url 'https://dl.bintray.com/amulyakhare/maven'
        content {
            includeGroupByRegex "com\\.amulyakhare.*"
        }
    }

What can be done:

Note: I will expand on this asap.


➡️ UPDATE: JFrog partially reversed their decision on February 8th, 2021: #10906 (comment)

Title changed from [Important] some dependecies are missing from a Maven Central (and JCenter sunset is announced for a May 1st 2021) to JCenter goes into read-only state after March 31st 2021 (new artifacts will not be accepted)

@dejan2609
Copy link
Author

dejan2609 commented Feb 5, 2021

Update: it seems that JetBrains will move 'org.jetbrains.trove4j', 'trove4j', '20160824' (required for this build) to a Maven Central:

@dejan2609
Copy link
Author

@greyson-signal @greysonp and others: I hope you don't mind that I took the liberty to work on this😃 (some draft PR will land asap).

@dejan2609
Copy link
Author

dejan2609 commented Feb 5, 2021

Draft PR is created.

Gradle build execution command ./gradlew clean assemble --refresh-dependencies returns errors below (given a fact that I removed references to a JCenter it is obvious that some dependencies are missing from a Maven Central).

Note: com.google.android.exoplayer libraries will be re-published to a Maven Central: google/ExoPlayer#5246

I also created issues for other libraries that were published exclusively to a JCenter:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':Signal-Android:lintVitalWebsiteStagingPerf'.
> Could not resolve all artifacts for configuration ':Signal-Android:playProdDebugCompileClasspath'.
   > Could not find com.google.android.exoplayer:exoplayer-core:2.9.1.
     Required by:
         project :Signal-Android
   > Could not find com.google.android.exoplayer:exoplayer-ui:2.9.1.
     Required by:
         project :Signal-Android
   > Could not find com.google.android.exoplayer:extension-mediasession:2.9.1.
     Required by:
         project :Signal-Android
   > Could not find mobi.upod:time-duration-picker:1.1.3.
     Required by:
         project :Signal-Android
   > Could not find com.amulyakhare:com.amulyakhare.textdrawable:1.0.1.
     Required by:
         project :Signal-Android
   > Could not find cn.carbswang.android:NumberPickerView:1.0.9.
     Required by:
         project :Signal-Android
   > Could not find com.tomergoldst.android:tooltips:1.0.6.
     Required by:
         project :Signal-Android
   > Could not find com.takisoft.fix:colorpicker:0.9.1.
     Required by:
         project :Signal-Android
   > Could not find com.codewaves.stickyheadergrid:stickyheadergrid:0.9.4.
     Required by:
         project :Signal-Android

* 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.

@dejan2609 dejan2609 changed the title JCenter/Bintray repository sunset (on May 1st); build depends on a Bintray's-published plugin [Important] some dependecies are missing from a Maven Central (and JCenter sunset is announced for a May 1st 2021) Feb 5, 2021
@dejan2609
Copy link
Author

Just to sum this up:

  • we can be certain that 'org.jetbrains.trove4j', 'trove4j', '20160824' plugin and two 'com.google.android.exoplayer' libraries will be published to Maven Central
  • I created issue for 'com.amulyakhare.textdrawable' dependency, but last repository commit is 6+ years old... so i decided to add that library via Gradle flat-directory feature
  • also, issues (related to publishing to Maven Central) are created for these 5 libraries (see links in a previous comment):
    • mobi.upod:time-duration-picker
    • cn.carbswang.android:NumberPickerView
    • com.tomergoldst.android:tooltips
    • com.takisoft.fix:colorpicker
    • com.codewaves.stickyheadergrid:stickyheadergrid

In case that maintainers do not respond (for whatever reason... time flies and priorities change) I opt to add missing libraries to a flat-directory also.

All-in-all... it seems that we will have a fully baked solution soon 🚀

FYI @signalapp

@dejan2609
Copy link
Author

dejan2609 commented Feb 5, 2021

JetBrains people just provided some updates (for https://youtrack.jetbrains.com/issue/IDEA-261387) and it turns out they already released trove4j to a Maven Central with a new version(s) and under the group/artifact name that slightly changed 😅.

Related Android Studio ticket: https://issuetracker.google.com/issues/179291081 com.android.tools:sdk-common needs to update its dependency on trove4j

@dejan2609
Copy link
Author

dejan2609 commented Feb 6, 2021

Just pushed another commit to a draft PR.

I just tested is it possible to refresh Gradle dependencies against different Android Studio versions (i.e. against 'com.android.tools.build:gradle' plugin versions) and herewith some results:

Android Studio update channel Android Studio version 'com.android.tools.build:gradle' version Gradle version Refresh result (pass / fail)
stable 4.1.2 4.1.2 6.5
beta 4.2 Beta 4 4.2.0-beta04 6.7.1
canary Arctic Fox, 2020.3.1 Canary 5 7.0.0-alpha05 6.8.2 ✔️

It seems that Android Studio team will have to backport changes from a Canary version to a Beta/Stable; i.e. they will have to use org.jetbrains.intellij.deps:trove4j versions published to Maven Central (https://search.maven.org/artifact/org.jetbrains.intellij.deps/trove4j) instead of a 'org.jetbrains.trove4j:trove4j:20160824' that was published to a JCenter only).


➡️ UPDATE (please scroll below) after some more digging it turns out that root cause was Kotlin version (and not an
Android Studio version)

SECOND UPDATE#10906 (comment)

@dejan2609
Copy link
Author

Note: I presume that all comments above are justifying rationale, so I will continue to use PR for a code related comments:
👉 #10907 ⬅️

@dejan2609
Copy link
Author

dejan2609 commented Feb 7, 2021

Just to update my findings from above: it seems that Android Studio version has nothing to do with projects not being able to refresh it self (after JCenter is removed as a repository, that is). I posted my findings to a Android Studio ticket also: https://issuetracker.google.com/issues/179291081

After some digging it turns out that:

  • Kotlin 1.4 projects are able to refresh dependencies ✅
  • while Kotlin 1.3 projects fail to do so ❌

Root cause for refresh issues lays in the fact that jetbrains trove4j different versions are scattered across different repositories with some versions published exclusively to JCenter... for much more details see this PR comment: #10907 (comment)

All-in-all there are four solutions for this:

  1. easy solution: JetBrains could re-publish his (deprecated, I guess) org.jetbrains.trove4j:trove4j:20160824 to a Maven Central; corresponding JetBrains tickets:
  2. (disclaimer: not sure is this possible): JetBrains could try to release a patch for a Kotlin 1.3 line and upgrade trove4j with some recent version that was already published to Maven Central: https://search.maven.org/artifact/org.jetbrains.intellij.deps/trove4j
  3. every team around the world that uses Kotlin 1.3 could (should ?) handle org.jetbrains.trove4j:trove4j:20160824 on his own ASAP; ideas:
  4. some projects can opt to upgrade from Kotlin 1.3 to 1.4:

@dejan2609
Copy link
Author

dejan2609 commented Feb 7, 2021

One more update 😩: it turns out that that we (both original Android Studio ticket reporter and me) were using a same Kotlin version (1.4.21) but with a completely different results: https://issuetracker.google.com/issues/179291081#comment6

So... at the moment we can only be sure that root cause is somewhere in between of Kotlin version and Android Gradle plugin version (and maybe even Gradle version has something to do with this ?)

I guess it is time for me to take a break and let two teams Kotlin (JetBrains) and Android Studio (Google) to pick this up (I will continue to work on this at some point, of course).

@dejan2609
Copy link
Author

dejan2609 commented Feb 8, 2021

I think I finally got it !

  • if you are using Kotlin Android app you are on a safe side, but (edit: I bumped into the corner case, see next comment)
  • if you have a Java Android app you may end up with org.jetbrains.trove4j:trove4j:20160824 issues (after you switch from jcenter() to mavenCentral())

I will prepare POC for both cases....

And some great news: nice people from JetBrains will publish org.jetbrains.trove4j:trove4j:20160824 to a Maven Central 🎉 https://youtrack.jetbrains.com/issue/IDEA-261387#focus=Comments-27-4675742.0-0 💪

@dejan2609
Copy link
Author

dejan2609 commented Feb 9, 2021

Now, this was a corner case that tricked me into beliving that Kotlin-powered projects are fine:

Resource missing. [HTTP HEAD: https://dl.google.com/dl/android/maven2/org/jetbrains/intellij/deps/trove4j/1.0.20181211/trove4j-1.0.20181211.pom]
Cached resource https://repo.maven.apache.org/maven2/org/jetbrains/intellij/deps/trove4j/1.0.20181211/trove4j-1.0.20181211.pom is up-to-date (lastModified: Tue Dec 11 13:54:51 CET 2018).
Resource missing. [HTTP HEAD: https://dl.google.com/dl/android/maven2/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom]
Resource missing. [HTTP HEAD: https://repo.maven.apache.org/maven2/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom]
Cached resource https://plugins.gradle.org/m2/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom is up-to-date (lastModified: Mon Feb 06 17:59:32 CET 2017).
Cached resource https://repo.maven.apache.org/maven2/org/jetbrains/intellij/deps/trove4j/1.0.20181211/trove4j-1.0.20181211.jar is up-to-date (lastModified: Tue Dec 11 13:55:34 CET 2018).
Cached resource https://plugins.gradle.org/m2/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.jar is up-to-date (lastModified: Mon Feb 06 17:59:32 CET 2017).

You will find out that build is able to fetch not one, but two trove4j versions:

  • version 1.0.20181211 was taken from a Maven Central
  • version 20160824 was obviously found on a Gradle plugins portal: (https://plugins.gradle.org)

image

What a ride 😄

@dejan2609
Copy link
Author

dejan2609 commented Feb 9, 2021

I will just provide a quick POC using two Android projects, one for Kotlin and another for Java):

  • clone project https://github.com/dejan2609/PocJcenterSunsetSimpleKotlinApp
  • and open in it via Android Studio 4.1.2 (Beta or Canary versions are still ok) in order to generate file local.properties file
  • pay no attention to this error: This version of the Android Support plugin for IntelliJ IDEA (or Android Studio) cannot open this project, please retry with version 4.3 or newer.
  • open terminal and checkout git tags one by on (six tags in total: 3 android plugin versions X 2 Kotlin versions)
  • and execute ./gradlew --refresh-dependencies (or ./gradlew --refresh-dependencies --info for a better experience 😄 )
  • repeat steps above for https://github.com/dejan2609/PocJcenterSunsetSimpleJavaApp (here you have only 3 tags)

Keep in mind that only two things were changed across both projects: android gradle plugin version and gradle version.

Results are the same for both Java and Kotlin (1.3/1.4) projects:

  • Stable AS version: com.android.tools.build:gradle:4.1.2 + gradle 6.5 -->> refresh fails ❌
  • Beta AS version: com.android.tools.build:gradle:4.2.0-beta04 + gradle 6.7.1 -->> refresh fails ❌
  • Alpha AS version: com.android.tools.build:gradle:7.0.0-alpha05 + gradle 6.8 -->> refresh works fine ✅

All in all: one of my previous comments was on point (that one with a fancy table here: #10906 (comment)) but after I bumped into that corner case things started to look strange...

No more long comments then... I think I will take a back seat now for a while 😃

@dejan2609
Copy link
Author

And just to recap (for all watchers out there): don't worry if you can't refresh your projects after removing jcenter() due to missing org.jetbrains.trove4j:trove4j:20160824; good people from JetBrains will solve that: https://youtrack.jetbrains.com/issue/IDEA-261387#focus=Comments-27-4675742.0-0

@dejan2609
Copy link
Author

Latest development: JFrog partially reversed their decision: they decided to serve artifacts via JCenter until February 1st 2022 (but they will stop receiving new artifacts after March 31st 2021). https://www.infoq.com/news/2021/02/jfrog-jcenter-bintray-closure

Update 8th Feb

JFrog have released an update to their original blog post to clarify that the date has been extended:

UPDATE: To better support the community in this migration, JFrog has extended the JCenter new package versions submission deadline through March 31st 2021.

To clarify, the JCenter repository will keep serving packages for 12 months until February 1st 2022. Only the JCenter REST API and UI will be sunsetted on May 1st 2021.

(You may have to refresh the post if since it may have been cached by your browser since you last visited in order to see the update.)

@dejan2609 dejan2609 changed the title [Important] some dependecies are missing from a Maven Central (and JCenter sunset is announced for a May 1st 2021) JCenter goes into read-only state after March 31st 2021 (new artifacts will not be accepted) Feb 13, 2021
@stale
Copy link

stale bot commented Jan 26, 2022

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the wontfix label Jan 26, 2022
@stale stale bot closed this as completed Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant