Duplicate class com.google.android.gms.common.util.VisibleForTesting - class

Duplicate class com.google.android.gms.common.util.VisibleForTesting
found in modules classes.jar
(com.google.android.gms:play-services-basement:17.0.0) and
libGoogleAnalyticsServices.jar (libGoogleAnalyticsServices.jar)
Go to the documentation to learn how to Fix dependency resolution errors.

Go to gradle project file then update it to :
classpath 'com.google.gms:google-services:4.3.3'
Or go to 'Refactor' menu then click on 'Migrate to AndroidX'

Related

How to find android dependencies from all flutter plugins

I am trying to implement flutter plugin in_app_review in one of my flutter project but i am getting duplicate dependency error.
I think some of the plugin from my project is somewhere adding play core dependency which is causing this issue.
Please help me figure out the solution.
I am getting this error log.
Execution failed for task ':app:checkUatDebugDuplicateClasses'.
A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
Duplicate class com.google.android.play.core.common.IntentSenderForResultStarter found in modules jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0) and jetified-core-common-2.0.2-runtime (com.google.android.play:core-common:2.0.2)
Duplicate class com.google.android.play.core.common.LocalTestingException found in modules jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0) and jetified-core-common-2.0.2-runtime (com.google.android.play:core-common:2.0.2)
Duplicate class com.google.android.play.core.common.PlayCoreDialogWrapperActivity found in modules jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0) and jetified-core-common-2.0.2-runtime (com.google.android.play:core-common:2.0.2)
Duplicate class com.google.android.play.core.listener.StateUpdatedListener found in modules jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0) and jetified-core-common-2.0.2-runtime (com.google.android.play:core-common:2.0.2)
Duplicate class com.google.android.play.core.review.ReviewInfo found in modules jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1)
Duplicate class com.google.android.play.core.review.ReviewManager found in modules jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1)
Duplicate class com.google.android.play.core.review.ReviewManagerFactory found in modules jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1)
Duplicate class com.google.android.play.core.review.testing.FakeReviewManager found in modules jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1)
it was happening because i was using
implementation 'com.google.android.play:core:1.10.3'
implementation 'com.google.android.play:core-ktx:1.8.1'
These two dependencies are in my android folder for in-app update and I thought om.google.android.play:core:1.10.3 is responsible for the duplicate dependency issue so when I commented that out it was still giving duplicate dependency issue as com.google.android.play:core-ktx:1.8.1 is also the same so I check on developer guide page where this dependency is now separated according to feature from core dependency then I removed this two dependencies and added implementation 'com.google.android.play:app-update-ktx:2.0.1' this one as I was doing the in-app update as well.
which helped me fix my problem.

Eclipse does not resolve dependencies

I have declared dependencies in several subproject to another specific subproject like
dependencies {
...
implementation project(':projectx')
...
}
However all subprojects can not resolve this dependency, however ctrl+click works an jumps direcly to the class.
I am confused, but I guess this might be an Eclipse problem. Any idea? Are there any infos from my side are missing?
Downgrading from Gradle 7.5.1 to 7.4.2 solved the exact same problem for me. Windows -> Preferences -> Gradle -> Specific Gradle Version

include gwt-graphics into a Eclipse WebApp-Project

I try to include the gwt-graphics library into a WebApp-Project made with Eclipse.
This is the description: https://code.google.com/archive/p/gwt-graphics/wikis/Manual.wiki
"Download gwt-graphics.jar and add it to the class path of your GWT project. In addition, you have to add the following line to the GWT module file: After these two steps, you are ready to use GWT Graphics in your GWT project!"
I have done this and after I start the app in super-dev-mode, I got an error from the compiler:
"[ERROR] Unable to find 'org/vaadin/gwtgraphics/GWTGraphics.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?"
I am not sure how I can solve this.
Did you add it to the class path? If not, you can right click to the jar file and do Add to Classpath

Update my gradle dependencies in eclipse

I have a simple gradle project in my eclipse. I update the build.gradle to include a few apache http jars...
dependencies {
compile group: 'commons-collections', name: 'commons-collections', version: '3.2'
compile 'org.apache.httpcomponents:httpclient:4.2.3'
compile "org.apache.httpcomponents:httpmime:4.2.3"
testCompile group: 'junit', name: 'junit', version: '4.+'
}
However in my code, where I reference some Apache HTTP stuff I get:
The import org.apache.http cannot be resolved
Any tips on what I need to do to make Eclipse see the new dependencies in my build.gradle?
I tried doing a clean but that does not work. My gradle plugin is:
Gradle IDE 3.3.0.201307040643-RELEASE org.springsource.ide.eclipse.gradle.feature.feature.group GoPivotal, Inc.
You have to select "Refresh Dependencies" in the "Gradle" context menu that appears when you right-click the project in the Package Explorer.
Follow those steps to update Gradle project in Eclipse:
First, please check you have include eclipse gradle plugin. apply plugin : 'eclipse'
Then go to your project directory in Terminal. Type gradle clean and then gradle eclipse.
Then go to project in eclipse and refresh the project (Go to Project Explorer, select root of the project and hit F5 to refresh, or right click and select refresh in context menu).
Looking at the Eclipse plugin docs I found some useful tasks that rebuilt my classpath and updated the required dependencies.
First try gradle cleanEclipse to clean the Eclipse configuration completely. If this doesn;t work you may try more specific tasks:
gradle cleanEclipseProject to remove the .project file
gradle cleanEclipseClasspath to empty the project's classpath
Finally gradle eclipse to rebuild the Eclipse configuration
You have to make sure that "Dependency Management" is enabled. To do so, right click on the project name, go to the "Gradle" sub-menu and click on "Enable Dependency Management". Once you do that, Gradle should load all the dependencies for you.
I tried all above options but was still getting error, in my case issue was I have not setup gradle installation directory in eclipse, following worked:
eclipse -> Window -> Preferences -> Gradle -> "Select Local
Installation Directory"
Click on Browse button and provide path.
Even though question is answered, thought to share in case somebody else is facing similar issue.
Cheers !
In my case, I solved weird issues in Spring Tools Suite (essentially Eclipse) after I tried to upgrade Spring Boot and the changes didn't seem to be taking effect.
Right click on your project -> Gradle -> Refresh Gradle Project

Eclipse Compilation Error

I imported some JTB and JavaCC generated files into Eclipse and there is one line giving me an error - the first line (a comment) most of the class files says "The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files" How do I fix this?
Have you tried removing and adding the JRE in your project?
Select Project -> Properties
Select Java Build Path
Navigate to the Libraries Tab
Remove the JRE
Click Add Library and add the default JRE again
PS: Project -> Clean can be very useful, too.