StfalconImageViewer icon indicating copy to clipboard operation
StfalconImageViewer copied to clipboard

Migration from JCenter

Open jakoss opened this issue 4 years ago • 11 comments

In may this library won't be available from JCenter: https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/

Please migrate this library to some other repository

jakoss avatar Feb 08 '21 11:02 jakoss

For anyone that wants to get rid of jcenter() without having to migrate away from this library, you can compile this project yourself to an AAR file and include that in your dependencies.

  1. Clone this repo
  2. Build the AAR: ./gradlew :imageviewer:assembleRelease
  3. The AAR file can be found at imageviewer/build/outputs/aar/imageviewer-release.aar. Copy this into app/libs/ in your project.
  4. Add this to your dependencies:
    implementation files("libs/imageviewer-release.aar")
    implementation "com.github.chrisbanes:PhotoView:2.2.0" 
    
    The AAR file does not include transitive dependencies, so you will need to include PhotoView yourself
  5. Subscribe to notifications on this issue so that you can get notified if this project ever moves to another repository and you can remove all of the above :)

petitJAM avatar May 12 '21 16:05 petitJAM

Any updates? Will we get a Maven Central (or other repository) update for the library? Thank you for looking into this!

marcosalis avatar Jun 01 '21 13:06 marcosalis

implementation 'com.github.omkar-tenkale:StfalconImageViewer:d11578fe3fd30c33a58b49978e3a9fd425291673'

EDIT: This works too

implementation 'com.github.stfalcon-studio:StfalconImageViewer:master-SNAPSHOT'

Use with maven { url 'https://jitpack.io' } in project build gradle inallprojects { repositories { ... block

Happy Coding 😁

omkar-tenkale avatar Jun 07 '21 11:06 omkar-tenkale

implementation 'com.github.omkar-tenkale:StfalconImageViewer:d11578fe3fd30c33a58b49978e3a9fd425291673'

I just forked this repo and added to my project via Jitpack (https://jitpack.io/)

You can use the line above Else if you want to host this library yourslelf follow these steps

1.Fork this repo 2.Go to your forked repo eg https://github.com/omkar-tenkale/StfalconImageViewer 3. Create your own implementation string like above in format implementation com.github,my_user_name:StfalconImageViewer:d11578fe3fd30c33a58b49978e3a9fd425291673

The last part is commit hash,You can use a different commit hash for a diferent version.

4 Just paste this newly created string in your build gradle sync a few times took me 2-3 syncs

Done :)

You also need to add this line to build gradle

  	maven { url 'https://jitpack.io' }

My root build gradle file


buildscript {
    repositories {
        google()
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.2.1"

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

allprojects {
    repositories {
        google()
        jcenter()
        maven { setUrl("https://jitpack.io") }
        maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

omkar-tenkale avatar Jun 07 '21 11:06 omkar-tenkale

For gradle plugin version 7.0.3, I need to edit settings.gradle to use the library from the jitpack repository.

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        jcenter() // Warning: this repository is going to shut down soon
        maven { url "https://jitpack.io" }
    }
}

dncks1525 avatar Oct 14 '21 13:10 dncks1525

@dncks1525 Remember that order matters. With such setup - library will still be downloaded from jCenter. I'd recommend to move it to the end

jakoss avatar Oct 14 '21 13:10 jakoss

@omkar-tenkale I believe the jitpack.io repo is protected by authentication. If we try to download it from jitpack we get an authentication error. I am wondering if you have jitpack authentication already configured so it is working for you.

brian-pinwheel avatar Jan 13 '22 22:01 brian-pinwheel

@brian-pinwheel No its public

omkar-tenkale avatar Jan 17 '22 19:01 omkar-tenkale

@omkar-tenkale This is the URL that was computed when I included the library and when I tried to access it, I was met with an authentication prompt. Is the URL not computed correctly from the build or is the maven artifact repository private?

Screen Shot 2022-01-18 at 10 57 20 AM

brian-pinwheel avatar Jan 18 '22 16:01 brian-pinwheel

You tried using the new

implementation 'com.github.stfalcon-studio:StfalconImageViewer:v1.0.1'

omkar-tenkale avatar Jan 18 '22 17:01 omkar-tenkale

@omkar-tenkale I was going off the readme of the repo. Should I be looking elsewhere for which version to use?

Also, do you make the current version public and password protect older versions? I would think if you were trying to use an authentication model you would want to password protect the latest version. I am a bit concerned about depending on a library that might make the version I'm using password-protected in the future.

brian-pinwheel avatar Jan 27 '22 21:01 brian-pinwheel