#Help i cant use **https://github.com/Dhaval2404/ImagePicker/** in my project

1 messages · Page 1 of 1 (latest)

zealous shuttle
#

build.gradle (app level) : ```plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
}

android {
namespace 'com.example.melonfeed'
compileSdk 34

defaultConfig {
    applicationId "com.example.melonfeed"
    minSdk 16
    targetSdk 34
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

}

dependencies {

implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.firebase:firebase-database:20.2.2'
implementation 'com.github.dhaval2404:imagepicker:2.1'
implementation 'com.google.firebase:firebase-auth:22.0.0'
implementation 'com.google.firebase:firebase-common-ktx:20.3.3'
testImplementation 'junit:junit:4.13.2'
implementation 'com.vanniktech:android-image-cropper:4.5.0'
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'com.google.firebase:firebase-storage:20.2.1'
implementation 'com.squareup.picasso:picasso:2.71828'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

}```

build.gradle (project level) : ```buildscript {
dependencies {
classpath 'com.google.gms:google-services:4.3.15'
}
}// Top-level build file where you can add configuration options common to all sub-projects/modules.

plugins {
id 'com.android.application' version '8.0.2' apply false
id 'com.android.library' version '8.0.2' apply false
}

tall crystalBOT
#

This post has been reserved for your question.

Hey @zealous shuttle! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

zealous shuttle
#

Help i cant use https://github.com/Dhaval2404/ImagePicker/ in my project

lyric tendon
#

You need to add jitpack to the repositories section as outlined in the README of the project you are trying to use

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

you need to add this to the project level build.gradle I think

zealous shuttle
#

i tried it

#

but didnt work

lyric tendon
#

What happens?

zealous shuttle
#

i mean like i try to use ImagePicker.with(this) .crop() //Crop image(Optional), Check Customization for more option .compress(1024) //Final image size will be less than 1 MB(Optional) .maxResultSize(1080, 1080) //Final image resolution will be less than 1080 x 1080(Optional) .start() but a red under line comes on ImagePicker

#

@lyric tendon (sorry for ping) please help

lyric tendon
#

What's shown when hovering over the red line?

#

What's the output of gradle build?

zealous shuttle
#

lemme just have a screenshot

lyric tendon
#

Did you refresh the Gradle project in your IDE?

zealous shuttle
#

here

lyric tendon
#

without that ImagePicker line

zealous shuttle
#

wait

#

Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugRuntimeClasspath'.

#

alot of errors

lyric tendon
#

Can you please show the full output?

zealous shuttle
#

can we get on a call

lyric tendon
lyric tendon
zealous shuttle
#

Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.github.dhaval2404:imagepicker:2.1.

zealous shuttle
#

that image picker thing is giving all the errors

lyric tendon
#

Can you show the errors?

zealous shuttle
#

the same two errors multiple times

#

Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.github.dhaval2404:imagepicker:2.1.

Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugRuntimeClasspath'.

#

these errors multiple times

lyric tendon
#

Can you show your project level build.gradle again?

lyric tendon
zealous shuttle
#
    repositories {
        maven {url "https://jitpack.io/"}
    }

    dependencies {
        classpath 'com.google.gms:google-services:4.3.15'
        classpath 'com.android.tools.build:gradle:4.2.2'
    }
}// Top-level build file where you can add configuration options common to all sub-projects/modules.


plugins {
    id 'com.android.application' version '8.0.2' apply false
    id 'com.android.library' version '8.0.2' apply false
}
#

its this right now

lyric tendon
#

I didn't mean in buildscript

zealous shuttle
#

ohh

lyric tendon
#

but in an allprojects block

#

I think

zealous shuttle
#

ok ok

#

build file 'C:\Users\Vedant Gupta\Documents\MelonFeed\build.gradle': 14: only buildscript {}, pluginManagement {} and other plugins {} script blocks are allowed before plugins {} blocks, no other statements are allowed

#
    dependencies {
        classpath 'com.google.gms:google-services:4.3.15'
        classpath 'com.android.tools.build:gradle:4.2.2'
    }
}// Top-level build file where you can add configuration options common to all sub-projects/modules.

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

plugins {
    id 'com.android.application' version '8.0.2' apply false
    id 'com.android.library' version '8.0.2' apply false
}
lyric tendon
#

maybe the allprojects should go into buildscript

#

or you take the

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

to the app-level build.gradle

zealous shuttle
#

i did this ```buildscript {
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}

dependencies {
    classpath 'com.google.gms:google-services:4.3.15'
    classpath 'com.android.tools.build:gradle:4.2.2'
}

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

plugins {
id 'com.android.application' version '8.0.2' apply false
id 'com.android.library' version '8.0.2' apply false
}
and it saysBuild was configured to prefer settings repositories over project repositories but repository 'maven' was added by build file 'build.gradle'```

lyric tendon
#

Do you have a settings.gradle?

#

maybe you should put it there in some way

zealous shuttle
#

where here ```pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
rootProject.name = "MelonFeed"
include ':app'

#

this is settings.gradle

lyric tendon
#

in repositories inside dependencyResolutionManagement

#

there, add maven { url "https://jitpack.io" }

#

I think

#

and don't put it in the other one

zealous shuttle
#

ok ok

#
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
        dependencyResolutionManagement{
            maven { url "https://jitpack.io" }
        }
    }
}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
    }
}
rootProject.name = "MelonFeed"
include ':app'
``` like this?
lyric tendon
#

no

#

You already have a dependencyResolutionManagement section

zealous shuttle
#

oh ok

lyric tendon
#

and that has a repositories section

zealous shuttle
#
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
        
    }
}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        maven { url "https://jitpack.io" }
        google()
        mavenCentral()
    }
}
rootProject.name = "MelonFeed"
include ':app'
lyric tendon
#

yeah

#

I think that should work

zealous shuttle
#

lets see

#

OHH MY GODDD

#

YOU ARE A LIFE SAVER

#

WE DID IT

#

thanks man

tall crystalBOT
# zealous shuttle thanks man

If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.