Crop Image library Android - android

does some one has already attemted use this https://github.com/CanHub/Android-Image-Cropper
library ? could please to send your own github or explain me how to setup. I've setted up but always graddle failing . because I've attempted to setup this library
but in gradle syncning time always I'm getting build faild .
please without bulling or hating
Execution failed for task ':app:mergeDebugNativeLibs'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.github.CanHub:Android-Image-Cropper:3.3.4.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/CanHub/Android-Image-Cropper/3.3.4/Android-Image-Cropper-3.3.4.pom
- https://repo.maven.apache.org/maven2/com/github/CanHub/Android-Image-Cropper/3.3.4/Android-Image-Cropper-3.3.4.pom
- https://jcenter.bintray.com/com/github/CanHub/Android-Image-Cropper/3.3.4/Android-Image-Cropper-3.3.4.pom
Required by:
project :app
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0.2/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 1s
19 actionable tasks: 18 executed, 1 up-to-date
Because of updating ArctixFox Android Studio allproject {repositories } not exist anymore maven { url 'https://jitpack.io' } whe should I add this

From the error you are getting, it seems like Gradle is unable to resolve CanHub dependency. It could be most probably because you may not have included the jitpack repository in your project's build.gradle (not module's build.gradle).
To add jitpack to the repositories, add maven { url 'https://jitpack.io' } to your project level build.gradle
buildscript {
repositories {
....
maven { url 'https://jitpack.io' }
}
}
Because of updating ArctixFox Android Studio allproject {repositories } not exist anymore
allprojects is still available to use in project-level build.gradle, but now it's not get added by default to the new project, and you would get a GradleScriptException after adding it, as the build is configured to prefer settings.gradle over it.
setting.gradle now includes a dependencyResolutionManagement. If you want to add new repositories using allprojects you have to comment or remove dependencyResolutionManagement, or you can just add your repositories to the repositories block of dependencyResolutionManagement in settings.gradle
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}

Related

I am unable to use TouchImageView dependency

I'm trying to use the dependency of TouchImageView for android. I'm unable to use the functions in the class and getting this error in Log
[1]: https://github.com/MikeOrtiz/TouchImageView
Task failed with an exception.
What went wrong:
Execution failed for task ':hideItPro:mergeDebugNativeLibs'.
Could not resolve all files for configuration ':hideItPro:debugRuntimeClasspath'.
Could not resolve com.github.MikeOrtiz:TouchImageView:1.1.1.
Required by:
project :hideItPro
> Could not resolve com.github.MikeOrtiz:TouchImageView:1.1.1.
> Could not get resource 'https://s3.amazonaws.com/moat-sdk-builds/com/github/MikeOrtiz/TouchImageView/1.1.1/TouchImageView-1.1.1.pom'.
> Could not GET 'https://s3.amazonaws.com/moat-sdk-builds/com/github/MikeOrtiz/TouchImageView/1.1.1/TouchImageView-1.1.1.pom'. Received status code 403 from server: Forbidden
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 27s
303 actionable tasks: 270 executed, 33 up-to-date
In settings.gradle
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
//here the dependency
maven { url 'https://jitpack.io' }
jcenter() // Warning: this repository is going to shut down soon
}
}
include ':app'
rootProject.name = "Apk"
this worked for me
Add maven repository in project build.gradle file,
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add dependencies in app build.gradle file,
dependencies {
...
implementation 'com.github.MikeOrtiz:TouchImageView:1.4.1' // last SupportLib version
// or
implementation 'com.github.MikeOrtiz:TouchImageView:$LAST_VERSION' // Android X
}

Build failed when adding Neumorphism dependency in Android

I am trying to add Neumorphism and DayNightSwitch dependency in Android but the build failed every time.
I tried many times but I didn’t figured out what's the problem is.
The gradle plugin is 7.2 and the Gradle version is 7.0.1
Neumorphism dependency
dependencies {
implementation 'com.github.fornewid:neumorphism:{latest_version}'
}
DayNightSwitch dependency
dependencies {
implementation 'com.github.Mahfa:DayNightSwitch:1.4'
}
8: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.github.fornewid:neumorphism:0.3.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/fornewid/neumorphism/0.3.0/neumorphism-0.3.0.pom
- https://repo.maven.apache.org/maven2/com/github/fornewid/neumorphism/0.3.0/neumorphism-0.3.0.pom
Required by:
project :app
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Please try to specify a version for the dependency
implementation 'com.github.fornewid:neumorphism:0.3.0'
Please add Neumorphism dependecy in your app level build.gradle as below,:
implementation 'com.github.fornewid:neumorphism:0.3.0'
And add these lines inside dependencyResolutionManagement to your Settings.gradle:
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
jcenter() // Warning: this repository is going to shut down soon
}

Could not find com.android.tools.build:gradle:3.0.1

When I try to build my project with gradle wrapper I get this error:
./gradlew
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all files for configuration ':app:classpath'.
> Could not find com.android.tools.build:gradle:3.0.1.
Searched in the following locations:
https://maven.fabric.io/public/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom
https://maven.fabric.io/public/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.jar
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.jar
Required by:
project :app
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
The same project builds OK in Android Studio.
I've already checked this and this but I'm using gradle wrapper version 4.1, have added google() repository and even tried setting android.enableAapt2=false. Any other tips? Thanks.
My root build.gradle file:
// 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.0.1'
// 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
}
My gradle-wrapper.properties file:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
UPDATE: Gabriele was right. I'd to add the repository also in the app/build.gradle file:
...
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
...
I guess that I was confused with this stament "To add one of these libraries to your build, include Google's Maven repository in your top-level build.gradle file" in here.
just wanted to leave an extra tip. When I installed Android Studio, I read somewhere that it was recommended to leave this configuration (with the '+' symbol)
build.gradle (project)
dependencies {
classpath 'com.android.tools.build:gradle:+'
.....
#more lines here
}
However, the project I am using uses an old version of gradle, and this line always requested the latest version. Took me a while to figure it out.
Check your proxy setting on Android Studio
File > Settings > Appearance
&
Behavior > System Settings > HTTP Proxy
Here was how I resolved the issue.
Change the root build.gradle file:
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
.....
//other codes here
}

Missing com.android.tools.build.gradle4.1 in Android Studio

Here is my build.gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And here is gradle-wrapper:
#Fri Jan 12 02:39:29 EST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-all.zip
The full error trace is here:
Error:FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'CryptoGallery'.
> Could not resolve all files for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:4.1.
Searched in the following locations:
file:/home/xavi/android-studio/gradle/m2repository/com/android/tools/build/gradle/4.1/gradle-4.1.pom
file:/home/xavi/android-studio/gradle/m2repository/com/android/tools/build/gradle/4.1/gradle-4.1.jar
https://jcenter.bintray.com/com/android/tools/build/gradle/4.1/gradle-4.1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/4.1/gradle-4.1.jar
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1/gradle-4.1.pom
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1/gradle-4.1.jar
Required by:
project :
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
I took a look in the directory /home/xavi/android-studio/gradle/m2repository/com/android/tools/build/gradle/4.1/ and saw that I do have a gradle 4.1 build, but it doesn't contain a simple .jar like the others do. It's the full download from the official gradle website. It contains many executables, but none labeled gradle-4.1.jar like the others.
Edit: After changing classpath to the correct line, android studio prompts me to update my gralde to 4.4.1, and I get a traceback.
Don't confuse gradle with the androd plugin for gradle.
Change:
classpath 'com.android.tools.build:gradle:4.1'
with:
classpath 'com.android.tools.build:gradle:3.0.1'
More info here.

react-native run-android Could not find com.android.tools.build:gradle:3.0.1

apple#mosesdeMacBook-Pro:~/Desktop/sxtbdemo2$ react-native run-android
Scanning folders for symlinks in /Users/apple/Desktop/sxtbdemo2/node_modules (8ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'sxtbdemo2'.
Could not resolve all files for configuration ':classpath'.
Could not find com.android.tools.build:gradle:3.0.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.jar
Required by:
project :
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Get more help at https://help.gradle.org
BUILD FAILED in 12s
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have set up your Android development environment: https://facebook.github.io/react-native/docs/android-setup.html
It is usually a problem with your repositories in your gradle files.
for me worked to modify the build.gradle like this:
buildscript {
repositories {
mavenLocal()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
so when you add google() it should work.
buildscript {
repositories {
jcenter()
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
Add google() inside buildscript() and Sync Project.
Reference : https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#apply_plugin

Categories

Resources