Yalantis / uCrop

Image Cropping Library for Android
https://yalantis.com/blog/introducing-ucrop-our-own-image-cropping-library-for-android/
11.88k stars 2.16k forks source link

Gradle build fail.. Android Gradle v.7.0.1 and Setup is too good #779

Open chirag-deshwal opened 3 years ago

chirag-deshwal commented 3 years ago

Do you want to request a feature or report a bug? Bug

What is the current behavior? Gradle build failed

What is the expected behavior?

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

Please attach any image files, URL and stack trace that can be used to reproduce the bug.

Which versions of uCrop, and which Android API versions are affected by this issue? Did this work in previous versions of uCrop?

Gradle Version - 7.1.1 Android Gradle - 7.0.1

**Error

FAILURE: Build completed with 8 failures.

1: Task failed with an exception.

==============================================================================

2: Task failed with an exception.

_____ My Gradle File(Project) ____

// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { google() mavenCentral() maven { url { "https://jitpack.io" } } }

dependencies { classpath "com.android.tools.build:gradle:7.0.1" classpath 'com.google.gms:google-services:4.3.10' classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } }

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

____ Gradle (App) __

plugins { id 'com.android.application' }

android { compileSdk 31

defaultConfig {
    applicationId "<My Package >"
    minSdk 21
    targetSdk 31
    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.3.1'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

   implementation 'com.github.yalantis:ucrop:2.2.6' // Crop Image 

     Other Livery ________________ continued 

}

apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'

}

rwnhrmwn23 commented 3 years ago

same problem, have you solved the probem?

oneenam commented 3 years ago

Works after disabling the below-mentioned stuff from settings.gradle!

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

rwnhrmwn23 commented 3 years ago

finally I can find the solution, you just move maven { url "https://jitpack.io" } from build.gradle (Project) to settings.gradle

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        jcenter()
        maven { url "https://maven.google.com" }
        maven { url "https://jitpack.io" }
    }
}
rootProject.name = "<Project Name>"
include ':app'
hussein414 commented 2 years ago

Could not find com.android.tools.build:gradle:7.0.1. Searched in the following locations:

hi cant find gradle