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

Failed to resolve: com.github.chrisbanes:PhotoView:2.3.0 #740

Open
masterholdy opened this issue Feb 9, 2020 · 11 comments
Open

Failed to resolve: com.github.chrisbanes:PhotoView:2.3.0 #740

masterholdy opened this issue Feb 9, 2020 · 11 comments

Comments

@masterholdy
Copy link

masterholdy commented Feb 9, 2020

ERROR: Failed to resolve: com.github.chrisbanes:PhotoView:2.3.0
Show in Project Structure dialog
Affected Modules: app

Root Build.Gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.kotlin_version = '1.3.61'
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.3'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

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

app build.gradle

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.2"
    defaultConfig {
        applicationId "de.hsos.ma.adhocdb"
        minSdkVersion 22
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true // This line

        javaCompileOptions {
            annotationProcessorOptions {
                arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
            }
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.core:core-ktx:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'


    def cardViewVersion = "1.0.0"
    def recyclerViewVersion = "1.0.0"
    def glideVersion = "4.11.0"
    def roomVersion = "2.2.3"
    def materialIoVersion = "1.2.0-alpha04"
    def kotlinCoroutinesVersion = "1.3.3"
    def materialDialogVersion = "3.1.1"
    def gsonVersion = "2.8.6"
    def photoViewVersion = "2.3.0"

    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesVersion"


    // room
    kapt "androidx.room:room-compiler:$roomVersion"
    implementation "androidx.room:room-runtime:$roomVersion"
    implementation "androidx.room:room-ktx:$roomVersion"

    //material io
    implementation "com.google.android.material:material:$materialIoVersion"
    // Card View
    implementation "androidx.cardview:cardview:$cardViewVersion"

    // Recyclerview
    implementation "androidx.recyclerview:recyclerview:$recyclerViewVersion"

    //glide
    implementation "com.github.bumptech.glide:glide:$glideVersion"
    annotationProcessor "com.github.bumptech.glide:compiler:$glideVersion"

    implementation "com.afollestad.material-dialogs:core:$materialDialogVersion"
    implementation "com.afollestad.material-dialogs:input:$materialDialogVersion"


    implementation "com.google.code.gson:gson:$gsonVersion"

    implementation 'com.camerakit:camerakit:1.0.0-beta3.11'
    implementation 'com.camerakit:jpegkit:0.1.0'
    implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.0'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.0.0'

    implementation "com.github.chrisbanes:PhotoView:$photoViewVersion"
}

@masterholdy
Copy link
Author

def photoViewVersion = "2.1.4"

works but shouldnt 2.3.0 work aswell?

@stephanenicolas
Copy link

The lib is hosted on jitpack. It is not a satisfying solution for industrial builds.It is too easy to publish on jitpack on major companies will not do it.

Can you release it to central / jcenter, please ?

@endrjudev
Copy link

Yes, please provide working host, i have the same problem.

@yuhaoz
Copy link

yuhaoz commented Jun 24, 2020

作者重写了代码,然后重新修正发布为2.0.0 ;不知道为啥版本号后退了,而不是前进。

@Alexs784
Copy link

Alexs784 commented Aug 9, 2021

Did anyone find a solution to this? It doesn't seem to work with any version

@PatricioIN
Copy link

Still not working?

@gegarcia
Copy link

it worked for me when I added maven { url 'https://jitpack.io' } to my settings.gradle:

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

@marwanRahmo
Copy link

marwanRahmo commented Dec 19, 2021

1--> first close all the windows like MainActivity and all class and all the Layout XML
2--> second copy the implementation {implementation 'com.github.chrisbanes:PhotoView:2.3.0'} and go up all the implementation in your project Build.gradle module and paste it and sync it. that will work ;)

oh don't forget to paste the url in your project build gradle repositories {
maven { url "https://jitpack.io" }

    google()
    mavenCentral()
}

@noel77543
Copy link

gegarcia

Thx a lot!
You save my day.


just add this

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

1647422807362

@drtyrell969
Copy link

Does anyone have a 2023 resolution? I keep seeing jcenter() references. None of the above solutions work for a modern Kotlin project. The example project code on GIT is still in the Java stone ages.

@rivancic
Copy link

rivancic commented Aug 20, 2023

You can add it directly to your project as local library/dependency.
Done in Readium kotlin toolkit.
https://github.com/readium/kotlin-toolkit/blob/main/readium/navigator/build.gradle.kts#L57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests