I have this exception after upgrade to the Android Gradle 3.0.1 version.
I use Jacoco in my multimodule android project.
java.nio.channels.OverlappingFileLockException
at sun.nio.ch.SharedFileLockTable.checkList(FileLockTable.java:255)
at sun.nio.ch.SharedFileLockTable.add(FileLockTable.java:152)
at sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:1063)
at java.nio.channels.FileChannel.lock(FileChannel.java:1053)
at org.jacoco.agent.rt.internal_290345e.output.FileOutput.openFile(FileOutput.java:69)
at org.jacoco.agent.rt.internal_290345e.output.FileOutput.writeExecutionData(FileOutput.java:53)
at org.jacoco.agent.rt.internal_290345e.Agent.shutdown(Agent.java:137)
at org.jacoco.agent.rt.internal_290345e.Agent$1.run(Agent.java:54)
Any ideas on how to fix this error?
I faced the same issue during Jacoco report generation. my issue was solved by adding the following entries on the build.Gradle file
jacoco {
toolVersion = "0.8.8"
}
According to this Github issue (not yet fixed), you should add this to your tests :
#PowerMockIgnore("org.jacoco.agent.rt.*")
Related
I added the stripe sdk to my kotlin app and can no longer build my application.
Addition to grade file:
implementation 'com.stripe:stripe-android:16.8.2'
Build error:
/Users/username/.gradle/caches/transforms-2/files-2.1/6fabb8e15860d0b2ea75a56e95ee9aa5/jetified-kotlin-stdlib-common-1.5.0.jar!/META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.16.
Removing the stripe dependency fixes the issue. I also tried deleting the cache folder referenced in the error message and it was just recreated and the issue persisted.
The problem seems to be a mismatch between the kotlin library used in your project and the version of the plugin that is not compatible.
Upgrade your Gradle version by going to File>Project Structure.
Ps:(also try downgrading your kotlin version to one of the 1.4.x versions)
Another developer ran into this same issue and solved it by upgrading Gradle
I updated my gradle like this
// id 'org.jetbrains.kotlin.android.extensions' deprecated
id 'kotlin-parcelize'
and in project gradle add this
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.32"
so now it works.
I added
apply plugin: 'com.google.firebase.firebase-perf'
and when I ran build script I got
/transforms/FirebasePerformancePlugin/dev/debug/174/module-info.class:
D8: Unsupported source file type
What kind of problem it could be?
I updated all plugins, play services, and Android Studio, but with no luck
I Solve This issue by updating gradle version
classpath 'com.android.tools.build:gradle:3.5.3'
Update: Android Gradle Plugin 3.5.0 fixes this. See this issue and this one issue, both fixed.
(Unfortunately, in my project, this other issue still remains even in 3.5.3.)
I started getting the same error after updating a (company internal) library dependency, but then I kept getting it even after reverting that update. Very strange!
> Task :app:transformClassesAndResourcesWithR8ForBetaRelease FAILED
R8 is the new Android code shrinker. If you experience any issues, please file a bug at
https://issuetracker.google.com, using 'Shrinker (R8)' as component name. You can
disable R8 by updating gradle.properties with 'android.enableR8=false'.
.../transforms/FirebasePerformancePlugin/beta/release/66/module-info.class:
D8: Unsupported source file type
The only thing I found that helped was to do what the Gradle build output says and temporarily switch back to ProGuard, with:
android.enableR8=false
in gradle.properties.
This issue was fixed somewhere between Android Studio 3.5 Beta 2 and Android Studio 3.6 Canary 5, there were a bunch of similar issues with module-info.class.
In my case to fix issue I had not only update Android Studio, but also update gradle plugin.
Steps is:
Install new version alongside your stable version (You also can configure current version to use updates from canary chanel)
More info here
Download link (I downloaded 3.6 Canary 5)
After you installed new Android Studio update grade plugin:
in
gradle/wrapper/gradle-wrapper.properties
chande distributionUrl to
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip
Don't forget Build->Clean Project
Turn off Firebase-performance plugin.
Android Studio 3.6 Canary 1 has this issue too.
I didn't find another way to release build my project.
i solve this problem with 3 steps:
1.update the "distributionUrl=https://services.gradle.org/distributions/gradle-5.6.4-all.zip"
2.update the "classpath "com.android.tools.build:gradle:3.6.3"
3.update the Studio 3.6.3
in other way(i don't like it)
//apply plugin: 'com.google.firebase.firebase-perf'
...
//classpath "com.google.firebase:perf-plugin:1.3.1"
I am getting below error only when I try to merge my branch with the main branch in my project.
The SourceSet 'instrumentTest' is not recognized by the Android Gradle Plugin.
And when I reset my branch to the last commit, it works.
This was happening in Android Studio Version 3.1.2 and it's still there in current version 3.2 also.
This issue has already taken a lot of my time.
I tried to fix it by replacing instrumentTest with androidTest answered here but it's not working for me.
This error leads to the above Unable to resolve dependency errors
Thanks in advance.
Somehow, I found the answer to this problem.
After reading the errors carefully, I came to know that the problem is there in my lib module.
And the error was not actually the one mentioned in Title.
Then I did below changes in the code.
I tried upgrating gradle version from 3.2.0 to 3.3.0-alpha13 and
gradle distribution version from 4.6 to 4.10.1 in gradle-wrapper.properties.
Earlier my lib/build.gradle containing only release buildType.
So I added same buildTypes which were in app/build.gradle.
Now my lib/build.gradle and app/build.gradle have same buildTypes
lib/build.gradle
app/build.gradle
And after syncing & building the project, I got rid of these errors(errors from image; Unable to resolve dependency).
Hope this will help someone.
Thanks.
I' using Gradle 2.9 in my Android Studio Project.
And today I try to update Gradle to 2.10, but got an error :
I follow the tip and change it to 2.2, but it doesn't work, 2.10 neither.
I use local gradle distribution not the wrapper, so I think this tip looks useless.
It has been marked as bug, which will be fixed in next Android Studio version (1.5.x).
Until then, temporary fix is adding following line in top-level build.gradle:
buildscript {
System.properties['com.android.build.gradle.overrideVersionCheck'] = 'true'
...
}
I'm using JaCoCo plugin for code coverage in my Android project. When I open sonar it shows me that following line isn't covered.
I'm using SonarQube Version 4.5.1 and JaCoCo Gradle plugin 0.7.1.201405082137.
Is this a bug in JaCoCo plugin? How can I fix it?
Edit: reported to Gradle forum.
Very strange, but if I change code style, then everything is fine.
I'll report this to Gradle community.