Home > Blockchain >  Unable to resolve dependency 'com.github.dhaval2404:imagepicker-support:1.7.1' for ':
Unable to resolve dependency 'com.github.dhaval2404:imagepicker-support:1.7.1' for ':

Time:09-28

I am new in Android. While adding Dhaval2404 Image Picker dependency: implementation 'com.github.dhaval2404:imagepicker-support:1.7.1', I found an exception error while syncing project.

build.gradle:

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

buildscript {
    repositories {
        google()
        jcenter()
        
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'
        classpath 'com.google.gms:google-services:4.3.13'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        
    }
}

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

app:gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 33
    buildToolsVersion "33.0.0"
    defaultConfig {
        applicationId "com.project.app"
        minSdkVersion 17
        targetSdkVersion 33
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.firebase:firebase-core:11.8.0'
    implementation 'com.github.dhaval2404:imagepicker-support:1.7.1'
    implementation 'com.google.firebase:firebase-database:11.8.0'
    implementation 'com.google.firebase:firebase-storage:11.8.0'
    implementation 'com.firebaseui:firebase-ui-database:3.2.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
}
apply plugin: 'com.google.gms.google-services'

Thanks in advance.

CodePudding user response:

You don't added maven repositories. Add maven repositories in build.gradle:

 allprojects {
   repositories {
        maven { url "https://jitpack.io" }
   }
}
  • Related