In my build.gradle (app) I have added this dependency: implementation 'androidx.preference:preference:1.2.0'
When I compile and build my project with the previous dependency these errors are shown:
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
> Duplicate class androidx.lifecycle.ViewModelLazy found in modules jetified-lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1) and lifecycle-viewmodel-2.5.0-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.0)
Duplicate class androidx.lifecycle.ViewTreeViewModelKt found in modules jetified-lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1) and lifecycle-viewmodel-2.5.0-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.0)
I have been searching for information to solve it and adding these both dependencies has solved it but I think that this solution is a botched solution and maybe it can be solved in a really better way.
def lifecycle_version = "2.5.1"
implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
Does it exist a better solution to solve it? Thanks for the help
Related
I am trying to implement the TapTargetView library from https://github.com/KeepSafe/TapTargetView
I have included this dependency in my build.gradle (Module:app)
dependencies {
...
implementation 'com.getkeepsafe.taptargetview:taptargetview:1.11.0'
}
But upon implementing the code, I keep getting this error
Unable to resolve symbol TapTargetView
Why is that? I've tried using these other dependencies too:
implementation 'com.getkeepsafe.taptargetview:taptargetview:1.12.0'
implementation 'com.getkeepsafe.taptargetview:taptargetview:1.13.0'
I still get the same error.
There was a mismatch in the version, the following implementation works for now:
implementation 'com.getkeepsafe.taptargetview:taptargetview:1.13.3'
I added this library from GitHub into my android app:
implementation 'com.github.quiin:unifiedContactPicker:1.0'
Now, this library uses other libraries from GitHub.
When I run my app, it tells me that these internal libraries are not found, so I dig them up and find their dependencies and add them to my app's Gradle file. But the problem is that they are not being detected and this is the error I am getting both times.
Execution failed for task ':app:dataBindingMergeDependencyArtifactsDebug'.
Could not resolve all files for configuration ':app:debugCompileClasspath'.
Could not find com.hootsuite.android:nachos:1.0.0.
Required by:
project :app > com.github.quiin:unifiedContactPicker:1.0
Possible solution:
Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
Please help, I have been stuck at this for a long time and I need to use this dependency. I have also tried using similar dependencies that fulfil my purpose but they all seem to have the same problem. So I don't know if there's a problem with my project or the libraries.
I had the same problem but with geok library. I checked syntax of dependencies declaration lines on JitPack website and there were different than I had on my build.gradle file. Finally I changed
from:
implementation "com.github.piruin:geok:$geokVersion"
implementation "com.github.piruin.geok-gson:$geokVersion"
to:
implementation "com.github.piruin.geok:geok:$geokVersion"
implementation "com.github.piruin.geok:geok:$geokVersion"
and it works.
Issue:
I'm using Dexguard to obfuscate codes for release build.
Previously, I could build as normal without errors.
However, when I add this dependency com.github.hyperledger:iroha-java:7.0.0, the release build process failed with an error in the screenshot below:
I guess the library internally depends on io.grpc:protoc-gen-grpc-java, but somehow Dexguard SDK can't find the dependency with the correct artifactType = dexguard-consumer-rules.
What I have tried:
adding io.grpc:protoc-gen-grpc-java:1.33.1
downgrading/upgrading version of iroha-java
Now I am not sure if the problem is caused by Dexguard or the iroha-java library.
So in case you have experiences related to this issue, please guide.
Dexguard can be causing the issue. In our experience it might be beneficial to just set up some rules within it so it would avoid the library. That should work.
In case someone also faced this error:
The solution is to downgrade iroha version to 5.2.1 and exclude io.grpc from it.
implementation('com.github.hyperledger.iroha-java:client:5.2.1') {
exclude group: 'io.grpc', module: 'protoc-gen-grpc-java'
}
It seems like many people are having this problem, but none of the problems i have researched so far are that basic like my problem.
I only got this object:
and a basic call in my main method:
Bamm... already not working. The compilataion fails with this error
I am using IntelliJ and have installed the Lombok plugin.
If it helps... here is my build.gradle:
Any ideas ?
Lombok uses the annotation processor to do its magic so you have to add lombok annotationProcessor dependency in your build.gradle file. Add this line inside your dependencies block:
annotationProcessor 'org.projectlombok:lombok:1.18.6'
I have android module named A. I added dependency to another module B like so: implementation project(':B'). While the module A builds without an issue, when I try to build (and run) integration tests, I get
Duplicate class org.xmlpull.v1.XmlPullParser found in modules kxml2-2.3.0.jar (net.sf.kxml:kxml2:2.3.0) and xpp3-1.1.3.3.jar (xpp3:xpp3:1.1.3.3)
Duplicate class org.xmlpull.v1.XmlPullParserException found in modules kxml2-2.3.0.jar (net.sf.kxml:kxml2:2.3.0) and xpp3-1.1.3.3.jar (xpp3:xpp3:1.1.3.3)
Duplicate class org.xmlpull.v1.XmlPullParserFactory found in modules kxml2-2.3.0.jar (net.sf.kxml:kxml2:2.3.0) and xpp3-1.1.3.3.jar (xpp3:xpp3:1.1.3.3)
Duplicate class org.xmlpull.v1.XmlSerializer found in modules kxml2-2.3.0.jar (net.sf.kxml:kxml2:2.3.0) and xpp3-1.1.3.3.jar (xpp3:xpp3:1.1.3.3)
I tried to exclude org.xmlpull.kxml by changing my import statement to
implementation (project(':B')) {
exclude group: 'org.xmlpull.v1'
}
but the problem still exists. I have run out of ideas. Can anyone help?
In my case the solution was to exclude xpp3
implementation(':B') {
exclude module: 'xpp3'
}
here is a nice explanation