Im getting this below error after updating the gradle android plugin.
Execution failed for task ':App:jacocoTestReport'.
Unable to read execution data file app/build/outputs/code-coverage/connected/coverage.ec
jacoco version = "0.7.6.201602180812"
android plugin version: 'com.android.tools.build:gradle:2.1.0'
Is there any problem with the latest plugin?
try changing version to toolVersion = "0.7.4+". it worked for me.
Related
I've got a problem when I launch a build on Jenkins. I would like to have the coverage report of my instrumented tests in Jenkins but it is stuck while executing Jacoco Test reports.
In my Android project, I've added the line apply plugin: 'jacoco' in the app/build.gradle file. I have used,
gradle plugin version- 7.0.2
Kotlin version - 1.4.32
jacoco version - 0.8.7
build gradle - 4.2.2
Previously it was working with below mention configuration:
gradle plugin version- 6.5
Kotlin version - 1.4.32
jacoco version - 0.8.7
build gradle - 4.1.3
And I have used Robolectric and Hilt in my project and in test cases. Locally it is working fine. Only in jenkins it is getting stuck. Please help me out what I have missed.
I just tried out Android Studio 4.1 today. I started the Android Studio and created empty activity and I run it using the android virtual device. Then it was failed and this error is shown:
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':app:processDebugManifest' (type 'ProcessMultiApkApplicationManifest').
> File 'E:\Project\AndroidLayout\app\build\intermediates\merged_manifest\debug\out\AndroidManifest.xml' specified for property 'mainMergedManifest' does not exist.
When I rebuild the project, the error message is shown here:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> com.android.manifmerger.ManifestMerger2$MergeFailureException: java.io.FileNotFoundException: E:\Project\AndroidLayout\app\build\intermediates\navigation_json\debug\navigation.json (The system cannot find the path specified)
Note that this is fresh install and fresh project without any modification in the code.
UPDATE 1:
Youtube: https://www.youtube.com/watch?v=g4w_NOA_UVQ
Bug Report: https://issuetracker.google.com/issues/170720311
UPDATE 2:
After I downgrade the Android Gradle Plugin version from 4.1.0 to 4.0.2 and the Gradle version from 6.5 to 6.4.1 now it is working.
So my conclusion is there is a bug in the Android Gradle Plugin 4.1.+ and Gradle 6.5.+.
I find a temporary solution:
After I downgrade the Android Gradle Plugin version from 4.1.0 to 4.0.2 and the Gradle version from 6.5 to 6.4.1 now it is working. So my conclusion is there is a bug in the Android Gradle Plugin 4.1.+ and Gradle 6.5.+.
In order to downgrade, just go to File -> Project Structure.
Had same issue. Moving project files to ntfs drive fixed it.
Downgrading the Android Gradle Plugin version from 4.1.0 to 4.0.2 and the Gradle version from 6.5 to 6.4.1 now it is working; works for me as well. Now app is no longer experiencing building errors.Thanks.
Error message was :
A problem was found with the configuration of task ':app:processDebugManifest' (type 'ProcessMultiApkApplicationManifest').
File 'F:\NietsPastApp\app\build\intermediates\merged_manifest\debug\out\AndroidManifest.xml' specified for property 'mainMergedManifest' does not exist.
Thanks for help, downgrade it's ok. just for other who search the file :
gradle 4.0.2 change here : /build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:4.0.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
gradle 6.4.1 : gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip
File -> Project Structure. reduce your build tools version to 29
i tried it's work
In my case and for kotlin I have downgraded kotlin version from 1.4.32 to 1.4.31
Long story short: My android phone keeps disconnecting from ADB. I was told to update android studio, did that. I open my project in Intellij and try to run on android and I get an error:
BUILD FAILED
Total time: 48.986 secs
Error: /Users/me/Desktop/comp/Development/comp-ionic/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> java.lang.NullPointerException (no error message)
My first thought is that my gradle is the wrong version. For this specific app, I need to use gradle version 2.14.1.
When I type gradle -v I'm getting version 3.3.
Is there a way to delete/downgrade gradle from 3.3 to 2.14.1?
Or is this another problem?
If you're using the gradle wrapper, then there'll be a folder in your project named "gradle" with a subfolder named "wrapper", inside that, there are 2 files:
- gradle-wrapper.jar
- gradle-wrapper.properties
Open "gradle-wrapper.properties" and change the place where it says "3.3" to "2.14.1". Then sync gradle, and it will automatically download 2.14.1.
If you're using the new 2.3 Android Studio, you HAVE to use gradle wrapper 3.3, as its the minimum supported gradle wrapper version. If so, then you'll have to download Android Studio 2.2, or fix whatever issue you have in your project that needs gradle wrapper version 2.14.1.
To get more information about whatever the issue is, try running this:
./gradlew clean assemble -stacktrace
That will clean your project, try and compile it, and if/when it fails, it will show you a stacktrace of the error.
What you should do is to change the gradle build tools version to the one that matches your gradle version. According to here you can set the gradle to 2.14.1 by changing build tools to lower than 1.0.0.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'// For gradle 2.2.1 - 2.3
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
Notice: if you keep checking the mentioned link you'll see Higher is better for gradle.
For me, Android Studio > File > Invalidate Caches / Restart did the trick.
I got the same problem when upgrading to Android Studio 2.3.1. There is something funky about Gradle 3.3 (It fails by "java.lang.NullPointerException: null value in entry: destinationDir=null at com.google.common.collect.CollectPreconditions.checkEntryNotNull(CollectPreconditions.java:33)").
Good news: seems like the current most recent version (3.5) works.
Go to File|Project Structure|Project, and use these versions:
Gradle version=3.5
Android Plugin version=2.3.1
I update the Android Studio version to 3.3 Canary 4, then update the gradle plugin, and the project stops working.
I do not know how to restore my AS to the previous state, nighter the gradle plugin.
But just with this command, the project now works, for me: gradlew clean assemble -stacktrace, in terminal tab in AS.
I've recently updated to Android Studio 2.2 and changed Gradle plugin version to 2.2.0 com.android.tools.build:gradle:2.2.0.
Now I'm getting the following error when trying to sync Gradle files:
Gradle sync failed: Unable to load class
'com.android.builder.profile.Recorder$Property'.
If I change Gradle plugin version to 2.1.3, the problem disappears. How I can use the latest version 2.2.0?
P.S. I'm also using gradle-experimental for NDK support - com.android.tools.build:gradle-experimental:0.7.3
I solved the problem by updating gradle-experimental to version 0.8.0 :)
classpath 'com.android.tools.build:gradle:2.2.0'
classpath "com.android.tools.build:gradle-experimental:0.8.0"
hope this will fix it for you too and will not generate new errors!
I am trying to build an android project from the command line.
I am following this tutorial
My project structure and files match the tutorial exactly.
When I run gradle build it tells me that version 2.2 of gradle is required, but I have a newer version of gradle installed, 2.10. So does that mean I must download an older version of gradle to build android?
* What went wrong:
A problem occurred evaluating root project 'GradleJavaApp'.
> Failed to apply plugin [id 'com.android.application']
> Gradle version 2.2 is required. Current version is 2.10. If using the gradle wrapper, try editing the distributionUrl in H:\GradleJavaApp\gradle\wrapper\gradle-wrapper.properties to gradle-2.2-all.zip
Don't use older version of Gradle! Stick to version 2.10 (or newer).
If you followed the tutorial thoroughly,
you probably used version 1.1.3 of Android build plugin:
buildscript {
…
dependencies {
classpath 'com.android.tools.build:gradle:1.1.3'
}
}
Build plugin version 1.1.3 is terribly outdated from the view of Android development (released on March 2015 according to the release notes).
Change that to the latest version 2.1.0.
Gradle wrapper should then stop complaining about Gradle version and
you should be able to use Gradle 2.10 normally.
Also replace all mentions of Gradle 2.3 in the tutorial with version 2.10.