Earlier my project was running without error but today i am getting following error. I would appreciate if anyone can help to get out of this issue.
Note- I am not using jCenter in my app, payment sdk flutter_stripe using jCenter
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not resolve com.stripe:stripe-android:20.12.+.
Required by:
project :app > project :stripe_android
> Failed to list versions for com.stripe:stripe-android.
> Unable to load Maven meta-data from https://jcenter.bintray.com/com/stripe/stripe-android/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/com/stripe/stripe-android/maven-metadata.xml'.
> Read timed out
* 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 1m 47s
Exception: Gradle task assembleDebug failed with exit code 1
Here is a link to a solution in the flutter_stripe issue list
You need to add the following line inside app level build.gradle file:
constraints { implementation('com.stripe:stripe-android') { version { strictly '20.11.0' } } }
constraints { implementation('com.stripe:financial-connections') { version { strictly '20.11.0' } } }
I also had this problem and for two days I tried to figure out what the cause was. The problem is jcenter. Not so why it decided not to work. I solved it by replacing with mavenCentral in your project level build.gradle.
Reference: My flutter Android build broke all sudden with a gradle error, with no changes to the gradle configuration on my part
If you also have the "Stripe" plugin, you have to add this extension as well as the user indicated above
Jcenter seems down today.I guess you should switch to mavenCentral instead.
Related
I am going through Android Tutorials to learn how to code. I haven't dealt with Gradle before. So I am having a hard time understanding the error codes. I build a very basic app.
When I go to build and click Make Project I get a weird error at the bottom:
And it doesn't do much after that. I am not sure if that is a warning that I can ignore or not. When it comes to Android dev, I am just a spring chicken.
EDIT: If i run the gradle.bat file from the command line I get this:
C:\git\Others\android-code\MyTestApp>gradlew.bat
Starting a Gradle Daemon, 2 stopped Daemons could not be reused, use --status for details
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\git\Others\android-code\MyTestApp\build.gradle' line: 7
* What went wrong:
Plugin [id: 'com.android.application', version: '7.4.0', apply: false] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'com.android.application:com.android.application.gradle.plugin:7.4.0')
Searched in the following repositories:
Google
MavenRepo
Gradle Central Plugin Repository
* 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 6m 14s
Any help would be appreicated. I cant even get through the tutorial with these errors!
If you use a proxy I suggest You look at this issue.
Pay attention to it:
Also I had clean my proxy in gradle.properties. Don't know if there is
any check that I have left.
Thx I finally found the problem:
After I set the proxy in Android Studio, it set the proxy to the file
in /User/.gradle/gradle.properties
Thanks again for your help and sorry for the bothering.
I keep facing this issue.
I tried
1)
./gradlew clean -> npm i -> expo i
2) add this line to build.graddle(:app)
multiDexEnabled true
3) add this line to build.graddle(project)
maven {
url "$rootDir/../node_modules/expo-camera/android/maven"
}
But nothing works.
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:mergeDebugAssets'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
> Could not find com.google.android:cameraview:1.0.0.
Searched in the following locations:
- file:/Users/hayat/.m2/repository/com/google/android/cameraview/1.0.0/cameraview-1.0.0.pom
- https://dl.google.com/dl/android/maven2/com/google/android/cameraview/1.0.0/cameraview-1.0.0.pom
- https://repo.maven.apache.org/maven2/com/google/android/cameraview/1.0.0/cameraview-1.0.0.pom
- https://devrepo.kakao.com/nexus/content/groups/public/com/google/android/cameraview/1.0.0/cameraview-1.0.0.pom
Required by:
project :app > project :expo > project :expo-camera
> Could not find com.github.CanHub:Android-Image-Cropper:1.1.1.
Searched in the following locations:
- file:/Users/hayat/.m2/repository/com/github/CanHub/Android-Image-Cropper/1.1.1/Android-Image-Cropper-1.1.1.pom
- https://dl.google.com/dl/android/maven2/com/github/CanHub/Android-Image-Cropper/1.1.1/Android-Image-Cropper-1.1.1.pom
- https://repo.maven.apache.org/maven2/com/github/CanHub/Android-Image-Cropper/1.1.1/Android-Image-Cropper-1.1.1.pom
- https://devrepo.kakao.com/nexus/content/groups/public/com/github/CanHub/Android-Image-Cropper/1.1.1/Android-Image-Cropper-1.1.1.pom
Required by:
project :app > project :expo > project :expo-image-picker
* 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.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings
How to resolve this issue? please help me.
Encountered the same issue and solved it by adding the following code block to my android\build.gradle file.
allprojects {
repositories {
// * Your other repositories here *
maven {
// expo-camera bundles a custom com.google.android:cameraview
url "$rootDir/../node_modules/expo-camera/android/maven"
}
}
}
NOTE I believe the instructions given here are kinda misleading. You must add the whole code block. I was only adding the code block below to no success. It's only after adding the whole block above that I was able to successfully build my project
maven {
// expo-camera bundles a custom com.google.android:cameraview
url "$rootDir/../node_modules/expo-camera/android/maven"
}
I am working on an old project. It worked fine before 5 days ago. Now I am facing an error with agora. I didn't any change on my previous code.
here is error-
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':agora_rtc_engine:compileDebugKotlin'.
> Could not resolve all files for configuration ':agora_rtc_engine:debugCompileClasspath'.
> Could not find native-full-sdk-3.4.6.jar (com.github.agorabuilder:native-full-sdk:3.4.6).
Searched in the following locations:
https://www.jitpack.io/com/github/agorabuilder/native-full-sdk/3.4.6/native-full-sdk-3.4.6.jar
* 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 38s
Running Gradle task 'assembleDebug'... 40.0s
Exception: Gradle task assembleDebug failed with exit code 1
I am using agora_rtc_engine: ^3.3.1 bacause this project developed without null-safety (maybe flutter 1.5). How can I solve this problem ?
1.Run flutter upgrade in the terminal to upgrade Flutter
2.Run dart migrate to run the dart migration tool
3.Solve all errors which the migration tool shows
4.Run flutter pub outdated --mode=null-safety to print all outdated packages
5.Run flutter pub upgrade --null-safety to upgrade all packages automatically
6.Check the code for errors and solve them
7.Run dart migrate again and it should now be successful. Follow the link to checkout the proposed changes
8.Press the "Apply Migration" button
9.Check the code for errors again and fix them.
Run flutter run in the command line and the application should run...
Note: If there are any library in you project that don't support null safety you must need to upgrade that library. if that library don’t have null safety remove the library and use another library
So you have to migrate your project to null-safety first and then get
agora_rtc_engine: ^4.2.2
Then you to to your build.gradle and add that last line
allprojects {
repositories {
google()
jcenter()
// add this line.
maven { url ‘https://www.jitpack.io' }
}
}
Because following this issue here on GitHub there is no solution for it because this issue has been closed on the agora project.
For anyone who is still facing this issue
1: Run flutter pub outdated --mode=null-safety to check which dependencies are outdated
2: Run flutter pub upgrade --null-safety to upgrade all dependencies
3: It would update agora_rtc_engine to latest sdk, try to change that to agora_rtc_engine: 4.2.2
4: Set ext.kotlin_version = '1.6.10' in *build.gradle
Note: If you face any incompatibility with other packages for setting minSdk as 19, change minSdk to 19
5: If you faced any gradle error, you might need to change gradle-wrapper.properties
//add this line
distributionUrl=https://services.gradle.org/distributions/gradle-7.3.1-all.zip
Thats all
After i have updated android studio to 3.4.2 and gradle,
when i run this line
gradlew publishApkappNameRelease
im getting this error :
* What went wrong: Some problems were found with the configuration of task ':app:generateappNameReleasePlayResources'.
> File 'E:\Projects\packagename\app\src\main\play' specified for property '$1' does not exist.
> File 'E:\Projects\packagename\app\src\appName\play' specified for property '$2' does not exist.
> File 'E:\Projects\packagename\app\src\release\play' specified for property '$3' does not exist.
> File 'E:\Projects\packagename\app\src\appNameRelease\play' specified for property '$4' does not exist.
* 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 6.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 2m 47s 56 actionable tasks: 55 executed, 1 from cache
note: this line is used to auto publish apk using
apply plugin: 'com.github.triplet.play'
classpath 'com.github.triplet.gradle:play-publisher:1.1.5'
same when i run this command line gradlew --recompile-scripts i get error
Unknown command-line option '--recompile-scripts'
These commands were running fine before the updates.
UPDATE:
when i try to update the triplet.play to any of t hose versions (2.2.1 - 2.2.0 - 2.1.1 - 2.1.0 - 2.0.0 - 2.0.0-rc2) i get this error
Could not find com.github.triplet.gradle:play-publisher:2.2.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/triplet/gradle/play-publisher/2.2.1/play-publisher-2.2.1.pom
- https://dl.google.com/dl/android/maven2/com/github/triplet/gradle/play-publisher/2.2.1/play-publisher-2.2.1.jar
- https://jcenter.bintray.com/com/github/triplet/gradle/play-publisher/2.2.1/play-publisher-2.2.1.pom
- https://jcenter.bintray.com/com/github/triplet/gradle/play-publisher/2.2.1/play-publisher-2.2.1.jar
- https://repo.maven.apache.org/maven2/com/github/triplet/gradle/play-publisher/2.2.1/play-publisher-2.2.1.pom
- https://repo.maven.apache.org/maven2/com/github/triplet/gradle/play-publisher/2.2.1/play-publisher-2.2.1.jar
Required by:
project :
Apparently this can be fixed by upgrading the version of the play-publisher plugin from 1.1.5 to 2.1.1 as per the GitHub issue here: https://github.com/Triple-T/gradle-play-publisher/issues/532
However, it seems that the newer versions of the plugin aren't available on all artifact repositories. I found it here which has clear steps of doing it: https://plugins.gradle.org/plugin/com.github.triplet.play
Lastly it is advised that you check their GitHub page again to make sure that the config you currently have is still compatible: https://github.com/Triple-T/gradle-play-publisher
With regards to gradlew --recompile-scripts, this has been deprecated and removed in the new version since most of the times the gradle daemon is running and ignores this option. More info here: https://github.com/gradle/gradle/issues/1425
First, add a new repo to your repositories on build.gradle (Project)
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
}
Now , upgrade your classpath.
classpath 'com.github.triplet.gradle:play-publisher:2.1.1'
I am attempting to break a large project into sub-projects. Mostly its working despite the many bug related to dependency handling in grade, however Ive run across a conflict, that I can't get a graph to resolve.
What I expect is to be abel to get a graph of dependencies so I can track down which library has the two conflicting dependencies, but the command stops before the dependency graph is printed for me to review.
I am unsure if this is somehow by design or just another bug in gradle or the android plugin.
This is my output.
$ ./gradlew androidDependencies
Defining custom 'clean' task when using the standard Gradle lifecycle plugins has been deprecated and is scheduled to be removed in Gradle 3.0
Incremental java compilation is an incubating feature.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':xlivestream'.
> Could not resolve all dependencies for configuration ':xlivestream:_debugCompile'.
> A conflict was found between the following modules:
- com.android.support:support-annotations:23.4.0
- com.android.support:support-annotations:23.1.1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Can anyone tell me how I'm supposed to get a dependency graph, to resolve this problem?
The error occurs because the configuration parameter resolutionStrategy.failOnVersionConflict() is enabled.
However, there appears to be a bug in gradle that prevents the dependency task from listing dependencies, because that parameter fails the build before it can execute.