Unable to resolve symbol 'TapTargetView' - java

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'

Related

How to deal with "Duplicate class error" correctly

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

Execution failed for task ':app:dataBindingMergeDependencyArtifactsDebug'

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.

Cannot resolve method get() when using the Picasso library

When I try to use the Picasso library, I get an error saying "cannot resolve method get()". What might be the cause of this?
I've tried some solutions based on answers given on this type of question here on stack Overflow, but it didn't solve my problem.
Here is my dependency:
dependencies {
implementation 'com.squareup.picasso:picasso:2.5.2'
}
Here is my Java code that throws the error "cannot resolve method get()":
Picasso.get().load(retrieveProfileImage).into(targetImage);
I managed to solve the error by changing the Picasso library version from:
implementation 'com.squareup.picasso:picasso:2.5.2'
to:
implementation 'com.squareup.picasso:picasso:2.71828'
I know this is old but this answer may help of someone,
I had the same issue to resolve it instead of using this using .get()
Picasso.get().load(imageURL).into(imageView);
I used it using .with()
Picasso.with(context).load(imageURL).into(imageView);

Package does not exist on build but importing without errors?

My project was building fine until I added Kryo dependency to my project. I can use both Netty and Kryo without syntax errors in my IDE but it won't build. All I did was adding Kryo to my common module and started implementing Kryo in my code, when I wanted to run Gradle it returned a big list of errors about none existent Netty and Kryo packages.
My gradle is very simple, client and server module both depend on common which atm has 2 custom classes and implement Kryo and Netty.
project(":common") {
apply plugin:'java'
dependencies {
// https://mvnrepository.com/artifact/io.netty/netty-all
implementation group: 'io.netty', name: 'netty-all', version: '4.1.33.Final'
// https://mvnrepository.com/artifact/com.esotericsoftware.kryo/kryo
implementation group: 'com.esotericsoftware.kryo', name: 'kryo', version: '2.24.0'
}
}
project(":server") {
apply plugin:'java'
dependencies {
implementation project(":common")
// https://mvnrepository.com/artifact/org.mongodb.morphia/morphia
compile group: 'org.mongodb.morphia', name: 'morphia', version: '1.3.2'
}
}
project(":client") {
apply plugin:'java'
dependencies {
implementation project(":common")
}
}
In client and server (both just java applications atm) I am using Kryo and Netty without syntax errors but when I run or build I get the following list for each class that imports Netty or Kryo.
error: package io.netty.channel does not exist
error: package io.netty.channel does not exist
error: package io.netty.channel does not exist
error: package io.netty.channel.group does not exist
error: cannot find symbol class ChannelInboundHandlerAdapter
error: cannot find symbol class ChannelGroup
error: cannot find symbol class ChannelHandlerContext
error: cannot find symbol class ChannelGroup
error: cannot find symbol class ChannelHandlerContext
error: cannot find symbol class ChannelHandlerContext
error: method does not override or implement a method from a supertype
error: method does not override or implement a method from a supertype
I tried the most obvious invalidate cache / restart, cleaning, rebuilding without success. Apart from that I tried fiddling with the plugin, setting it to java-library and back. The only thing I did differently then usual is that I tried to exclude Kryo for the other 2 modules but I gave up on that after a few attempts for the time being and erased those exclude lines. It's probably just something I overlooked but I can't put my finger on it.

Firebase assistants error: Failed to resolve: firebase-messaging-15.0.0

I am currently facing the error when i try to connect to the Cloud Messaging using firebase assistants.
Failed to resolve: firebase-messaging-15.0.0
I search online, and the solution was to remove the last few digits in the dependency. However, when i tried that, it solved the error, but on the firebase assistants, it did not show "dependency being set up correctly" anymore. Hence, does this mean that i am not connected to the firebase cloud messaging?
Method tried:
change from implementation 'com.google.firebase:firebase-messaging:17.0.0:15.0.0' to implementation 'com.google.firebase:firebase-messaging:17.0.0'
The dependency being set up correctly is in green before i use the online method of removing the last few digits of the dependency
remove all firebase-messaging dependency and add This Dependency
implementation 'com.google.firebase:firebase-messaging:17.0.0'
You are getting the following error:
Failed to resolve: firebase-messaging-15.0.0
Because you are using a wrong dependency in your code. To solve this, please change the following line of code:
implementation 'com.google.firebase:firebase-messaging:17.0.0:15.0.0'
to
implementation 'com.google.firebase:firebase-messaging:17.3.4'
Because such a version 17.0.0:15.0.0 does not exist. Here you can find more informations.
In your top level build.gradle file please be sure to have the latest version of Google Service plugin and Gradle:
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'

Categories

Resources