Cannot resolve method get() when using the Picasso library - java

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);

Related

Unable to resolve symbol 'TapTargetView'

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'

java.lang.IncompatibleClassChangeError at DotenvPropertyLoader.java:11

I updated spring-dotenv to 2.5.3 from 1.0.0 like below build.gradle.
dependencies {
implementation 'me.paulschwarz:spring-dotenv:2.5.3'
}
then, I execute ./gradlew build happened IncompatibleClassChangeError.
java.lang.IncompatibleClassChangeError at DotenvPropertyLoader.java:11
Why caused this error?
I have seen other answers like below. But I can't solve this problem.
What causes java.lang.IncompatibleClassChangeError?
Does anyone have any idea?
Thanks.
I solved this problem.
I edited build.gradle like below.
// before
implementation ('me.paulschwarz:spring-dotenv:2.5.3')
// after
api ('me.paulschwarz:spring-dotenv:2.5.3')
but, I don't know why this solved it.

DaggerAppComponent Not found

I am trying to build the project which has a large dependency graph and uses dagger 2.
I use following dependencies
implementation 'com.google.dagger:dagger:2.11'
androidTestImplementation 'com.google.dagger:dagger:2.11'
annotationProcessor 'com.google.dagger:dagger-compiler:2.11'
I am not able to build the app because it shows 50 errors like
cannot find symbol class DaggerAddressComponent
cannot find symbol class DaggerAddToCartActivityComponent
cannot find symbol class DaggerPaymentFragmentComponent
cannot find symbol variable GlideApp
...More 50 like this
All the DaggerComponent are not found and I also don't see any dagger classes created in generatedJava Folder.
I know this may happen due to syntax error, but I checked all the modules and don't see any.
Does Someone know how to fix this? Or guide me on how to track down any mistakes in my modules/components. gradle log does not show anything related to dagger so how can we know where is the mistake?
After whole day and going through every line of my code, I found that I have one duplicate method in my view interface, which happened during merge. Removed that and all the things were good.
It is strange how Android studio shows all the class not found error and does't show that error. I know it is a silly mistake but it is confusing to find the real error if you don't see that error in logs.

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'

android error while compiling com.android.support:support-v4:24.0.0

Currently, my android compileSdkVersion is set to 24 and in my dependencies, I have included compile 'com.android.support:support-v4:24.0.0'
However when I try to build, I get an error of:
java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct
Does anyone know how to resolve this?
This is because there is a compatibility issue in your dependencies. Your support library is not compatible with the other library, something like Firebase/Google Play Service.

Categories

Resources