I have faced this issue whenever I updated the Gradle from 5.4.1 to 5.6.1 following issue is generated. :
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
> No value has been specified for this provider.
> KotlinJvmAndroidCompilation with name 'productionDebug' not found.
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':app'.
at org.gradle.configuration.project.LifecycleProjectEvaluator.wrapException(LifecycleProjectEvaluator.java:80)
at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:73)
at org.gradle.configuration.project.LifecycleProjectEvaluator.access$600(LifecycleProjectEvaluator.java:53)
at org.gradle.configuration.project.LifecycleProjectEvaluator$NotifyAfterEvaluate.run(LifecycleProjectEvaluator.java:199)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject$1.run(LifecycleProjectEvaluator.java:112)
at org.gradle.internal.Factories$1.create(Factories.java:26)
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:58)
... 125 more
* Get more help at https://help.gradle.org
CONFIGURE FAILED in 2s
Using
- kotlin version v1.3.70
- Gradle v5.6.4
- Android Studio v3.6.1
Please help.
Thanks in advance
I've faced the same issue and it turned out that the cause of the issue is the fabric gradle plugin (crashlytics) rather than gradle itself.
Basically, the issue occurs when setting ext.enableCrashlytics = true in your build.gradle file using io.fabric.tools:gradle:1.31.2 fabric plugin.
Workaround
You have to avoid explicitly setting ext.enableCrashlytics to true (false is okay).
For example, you can replace the following code
def enableCrashlytics = // comes from somewhere
ext.enableCrashlytics = enableCrashlytics
by
def enableCrashlytics = // comes from somewhere
if (!enableCrashlytics) {
ext.enableCrashlytics = false
}
The behavior remains the same since crashlytics is enabled by default.
As an alternative, you can revert to using 1.31.0 which works fine, but I'd not recommend doing it since the latest version contains a couple of critical bug fixes.
Also, you can consider migrating to Firebase Crashlytics (currently in beta) since Google is dropping support for Fabric soon and this issue might not get fixed.
Originally answered here.
Could anyone help me out with the following error. When i clean the project, it doesn't show any error but every time i try to run i get this message.
Error:Execution failed for task ':app:dexDebug'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_45\bin\java.exe'' finished with non-zero exit value 2
The application was running with no errors but as my system crashed and restarted android studio i had few updates for Android API 22. After the update the application keep giving me this error message. I downloaded JDK 8 and tried to run but didn't work. Later i downgraded to JDK 7 after this stack post but still has not fixed it.
Is it possible to use Java 8 for Android development?
I have looked through numerous similar question but none works for me. Some similar issues found on stack were
why java.exe exit with value 1 in android studio
Error:Execution failed for task ':app:dexDebug'. > comcommand finished with non-zero exit value 2
Java finished with non-zero exit value 2 - Android Gradle
java.exe finished with non-zero exit value 2
Process 'command' C: \ Program Files \ Java \ jdk1.8.0_31 \ bin \ java.exe '' finished with a non -zero exit value 2
I have looked through dependencies in gradle built to see if there were any conflict but found none.
I even tried to copy the code into a new project and run it but still no success. Anyone who has faced the same issue and solved it please help me out.
After days of trying out finally could fix the issue. The problem with one of my .jar files. I had to remove each jar and check one by one until i found it. I removed the .jar file and cleaned my project and ran successfully. If any one should face similar issue check your jar file one by one.
I had the same error
app:dexDebug ExecException finished with non-zero exit value 2
i solve it by adding this line of code
defaultConfig {
multiDexEnabled true
}
The reason is that i was using too many libraries
Hope this post will help anyone
I had the same problem when I compiled google play services to my dependencies.
My mistake was I was compiling the enitre package like this
compile 'com.google.android.gms:play-services:8.3.0'
Instead when I tried the selective compile, it worked.In my case I was using for google sign in,so it had just had to be
compile 'com.google.android.gms:play-services-auth:8.3.0'.
More details are in the documentaion. https://developers.google.com/android/guides/setup#split
Hope this will be of a little help to someone someday :)
I know it's late.
But that's what actually worked for me.
1. Build > Clean Project
2. Close gradle daemon processes (ps -e| grep gradle //this will list gradle processes)
3. File > Invalidate caches & Restart
I hope this will work for everyone.
For future readers. If you're using your own AARs and upgraded one that has a shared dependency, you can also just try cleaning the project. In Android Studio "Build" -> "Clean Project".
This solved the issue for me, so I'd recommend giving it a quick try before you start digging for dependencies.
For me the solution was to remove an unnecessary/duplicate dependency entries. This is a similar solution others offered here that makes sense, but not exactly the same solution as those offered by others.
Since I was already including *.jar files in the list of files to be compiled, there was no need for additional entries in the dependencies list.
Before:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.parse.bolts:bolts-android:1.+'
compile fileTree(dir: 'libs', include: 'Parse-*.jar')
}
After:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
}
Remove
compile 'com.parse:parse-android:1.+'
add this linecompile fileTree(dir: 'libs', include: ['Parse-*.jar'])
Finally, it will look like this
dependencies {
compile fileTree(dir: 'libs', include: ['Parse-*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.facebook.android:facebook-android-sdk:4.5.0'
compile 'com.android.support:design:22.2.0'
compile 'com.parse.bolts:bolts-android:1.+'
}
I had the same problem, just i did Biuld--> Rebiuld project and it works again ;)
I was using the robolectric dependency in my android project. I removed all robolectric dependencies in gradle and deleted all my robolectric tests, then I built the app and finally I could run the android project. Hope this can work for us.
I faced the same problem when trying to add the SignalR Java client library to my project's dependencies. I first changed the target JDK of my app from 1.8.0_XX to 1.7.0_XX, but it didn't work. Then I changed the SignalR project to target 1.7.0_XX as well, rebuilt and added it to my project's libs folder instead of the first build (which was in 1.8.0_XX), and that miraculously worked.
For me, the problem was that I was using different versions of "Google Play services sub API's"
Before:
Click to see the image
After:
Click to see the image
Check if there are 2 classes with same name. Each class name should be unique.
maybe for this issue you got means you added same liberay file in more than one time
I'm trying to use the ShowcaseView project in my project on Android Studio but can't get the project to build.
Showcase link: https://github.com/amlcurran/ShowcaseView
I have included the following:
In app/build.gradle-
compile 'com.github.amlcurran.showcaseview:library:5.4.1'
In build.gradle-
repositories
{
mavenCentral()
}
I get the following error:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not resolve com.github.amlcurran.showcaseview:library:5.4.1.
Required by:
BLEDemo:app:unspecified
> Could not resolve com.github.amlcurran.showcaseview:library:5.4.1.
> Could not get resource 'https://jcenter.bintray.com/com/github/amlcurran/showcaseview/library/5.4.1/library-5.4.1.pom'.
> Could not GET 'https://jcenter.bintray.com/com/github/amlcurran/showcaseview/library/5.4.1/library-5.4.1.pom'.
> Connection to https://jcenter.bintray.com refused
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Ive tried several suggestions online but couldn't find a solution to this.
I have also tried to import the library an include it in settings.gradle and get an error.
Can some please help me.
Thank you in advance.
It looks like gradle is searching for the library in jCenter. If you add jCenter to your repositories closure does it work? Like this:
repositories
{
mavenCentral()
jCenter()
}
Are there any proxy-servers in use in your environment? If yes: configure it with your user and password. The build cannot find the package, which is located on github and breaks with an error.
You can check this answer if you want to learn more how to do this: gradle-behind-proxy-in-android-studio-1-3
For 2 days, I have been trying to fix my Android Studio setup, but despite a lot of googling have had no luck fixing this problem. Gradle keeps giving me the error
Error:Execution failed for task ':Android-Tabbedout-30:processQaReleaseResources'.
Error: A library uses the same package as this project
You can temporarily disable this error with android.enforceUniquePackageName=false
However, this is temporary and will be enforced in 1.0
If I add in the enforceUniquePackageName=false to the gradle file, then the project can be successively refreshed by Gradle, but once I try to run it I get this error:
Error Code:
2
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define
Any ideas on how to fix this?
I was searching for that same problem and i find this on github
https://github.com/DWorkS/AStickyHeader/issues/12
And this solved my problem.
All this says is to rename the package name on the AndroidManifast.xml file.
And its done.
I'm new to Grails web framework. I got this error when running my first grails app from the terminal. Below is the error I got.
> | Downloading:
> org/apache/commons/commons-parent/17/commons-parent-17.pom | Error
> Resolve error obtaining dependencies: Failed to read artifact
> descriptor for org.hamcrest:hamcrest-core:jar:1.3 (Use --stacktrace
> to see the full trace)
>
> | Error Required Grails build dependencies were not found. This is
> normally due to internet connectivity issues (such as a misconfigured
> proxy) or missing repos itories in grails-app/conf/BuildConfig.groovy.
> Please verify your configuration to continue.
I'm running this app with the internet connection but this error still occurs. How can I fix this error?
are u sure you are using a the correct download for grails, it seems that your trying to connect to the internet and your grails can't ? may be check your proxy settings? or what you are really trying to do in the command line ?
Your console log says, you can not connect to internet for downloading dependencies.
But its not the case. Maven has stopped http repositories and that is the root cause.
You have to use https. If you could not connect to https for some reason, here is workaround to that:
mavenRepo "http://insecure.repo1.maven.org/maven2/"
Putting above line in BuildConfig.groovy will resolve your issue and start downloading dependencies.
What mavenRepo's do you have in your BuildConfig.groovy. I found that I had to add a few, here's mine:
repositories {
inherits true // Whether to inherit repository definitions from plugins
grailsPlugins()
grailsHome()
mavenLocal()
grailsCentral()
mavenCentral()
// uncomment these (or add new ones) to enable remote dependency resolution from public Maven repositories
mavenRepo "http://repository.codehaus.org"
mavenRepo "http://download.java.net/maven/2/"
mavenRepo "http://repository.jboss.com/maven2/"
mavenRepo 'http://repo.spring.io/milestone'
}
Have you tried running:
grails refresh-dependencies
before you try to run your app?
What version of Grails, SO and JDK do you have?, in Windows 8 with JDK Java SE 7u45 and Grails 2.3.1 i have a lot of problems; I had to make a downgrade to JDK