how to Fix dependency resolution errors - retrofit

I am building a weather forecast app using API from this(openweathermap.org) website. For this I have used two dependencies such as
1.('com.appunity.retrofit2:converter-gson:2.0.2')
2.('com.squareup.retrofit:retrofit:2.0.0-beta2').
And I got this type of error that I have given below.
Duplicate class retrofit2.http.Path found in modules jetified-retrofit-2.0.2.jar (com.appunity.retrofit2:retrofit:2.0.2) and jetified-retrofit-2.5.0.jar (com.squareup.retrofit2:retrofit:2.5.0)
Duplicate class retrofit2.http.Query found in modules jetified-retrofit-2.0.2.jar (com.appunity.retrofit2:retrofit:2.0.2) and jetified-retrofit-2.5.0.jar (com.squareup.retrofit2:retrofit:2.5.0)
Duplicate class retrofit2.http.QueryMap found in modules jetified-retrofit-2.0.2.jar (com.appunity.retrofit2:retrofit:2.0.2) and jetified-retrofit-2.5.0.jar (com.squareup.retrofit2:retrofit:2.5.0)
Duplicate class retrofit2.http.Streaming found in modules jetified-retrofit-2.0.2.jar (com.appunity.retrofit2:retrofit:2.0.2) and jetified-retrofit-2.5.0.jar (com.squareup.retrofit2:retrofit:2.5.0)
Duplicate class retrofit2.http.Url found in modules jetified-retrofit-2.0.2.jar (com.appunity.retrofit2:retrofit:2.0.2) and jetified-retrofit-2.5.0.jar (com.squareup.retrofit2:retrofit:2.5.0)
Go to the documentation to learn how to Fix dependency resolution errors.

Related

Errors with Material UI AppBar

I am building a student project. I have tried several times to incorporate Material UI into my project but have had no success. For instance, I am attempting to add "App Bar with Menu" linked here. I have installed npm install #mui/material #emotion/react #emotion/styled #material-ui/icons in React, and copied the code exactly from MUI's example into its own component in my project, but am receiving the following errors:
Compiled with problems:
ERROR in ./src/components/MenuAppBar/MenuAppBar.js 12:0-48
Module not found: Error: Can't resolve '#mui/icons-material/Menu' in '/home/michael/flatiron/phase-5/project-template/frontend/src/components/MenuAppBar'
ERROR in ./src/components/MenuAppBar/MenuAppBar.js 13:0-62
Module not found: Error: Can't resolve '#mui/icons-material/AccountCircle' in '/home/michael/flatiron/phase-5/project-template/frontend/src/components/MenuAppBar'
What am I missing? I don't see any documentation on this AppBar that would tell me I have to install something other than what I've installed, and I pulled up three youtube videos which simply show the user copying the code into a component, as I've done.

Servlet class is not a javax.servlet.Servlet while deploying a bundle in felix jetty

I am trying to deploy an OSGI bundle in felix jetty. BootStrap is my class which extends HttpServlet.
I am getting the below Exception at deployment stage :
ins.server.servlet.HttpServlet30Dispatcher is not assignable from javax.servlet.http.HttpServlet
2018-07-11T07:46:55,044 WARN sure-rest-neo [] web-reactor - unavailable
javax.servlet.UnavailableException: Servlet class com.nokia.mdf.sure.neo.utils.Bootstrap is not a javax.servlet.Servlet
at org.eclipse.jetty.servlet.ServletHolder.checkServletType(ServletHolder.java:519) ~[jetty-servlet-9.3.10.v20160621.jar:9.3.10.v20160621]
at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:379) ~[jetty-servlet-9.3.10.v20160621.jar:9.3.10.v20160621]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.3.10.v20160621.jar:9.3.10.v20160621]
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:874) ~[jetty-servlet-9.3.10.v20160621.jar:9.3.10.v20160621]
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:349) ~[jetty-servlet-9.3.10.v20160621.jar:9.3.10.v20160621]
at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1404) ~[jetty-webapp-9.3.10.v20160621.jar:9.3.10.v20160621]
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1366) ~[jetty-webapp-9.3.10.v20160621.jar:9.3.10.v20160621]
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:778) ~[jetty-server-9.3.10.v20160621.jar:9.3.10.v20160621]
at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:262) ~[jetty-servlet-9.3.10.v20160621.jar:9.3.10.v20160621]
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:520) ~[jetty-webapp-9.3.10.v20160621.jar:9.3.10.v20160621]
I have embedded all dependencies including the transitive ones. How to resolve this, which I assume is due to jar conflict ?
The problem is exactly with embedding dependencies. When you embed the javax.servlet package then your bundle will use the embedded class while jetty will use the class available from an exported package. So while these classes are named the same there are different instances in the classloaders which leads to exactly this kind of error.
To generally solve this you make sure that ideally only one bundle exports each package and all bundles that need it import the package. So the easiest solution is to not embed dependencies.
If that does not work for you then you can try to import and export the javax.servlet package in your bundle. This allows the OSGi environment to decide which package it will actually wire and avoid having the same class names with different instances in bundles.

why composer fail during running the server?

The autoloader expected class "AppBundle\Resources\config\routing" to be de
fined in file "C:\xampp\htdocs\fp\vendor\composer/../../src/AppBundle\Resou
rces\config\routing.php". The file was found but the class was not in it, t
he class name or namespace probably has a typo in C:\xampp\htdocs\fp\app/co
nfig\services.yml (which is being imported from "C:\xampp\htdocs\fp\app/con
fig\config.yml").

FXML file can't load after obfuscation with proguard

I got the following error after running obfuscated jar:
Caused by: java.io.UncheckedIOException: Error loading FXML: /fxml/main.fxml
Caused by: javafx.fxml.LoadException:
unknown path
But the FXML file is exists on the specified path.
My ProGuard config file contains following rules:
-keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,LocalVariable*Table,*Annotation*,Synthetic,EnclosingMethod,javafx.fxml.FXML
-adaptresourcefilenames **.fxml,**.png,**.css,**.pdf,**.ttf,**.otf,**.txt
-adaptresourcefilecontents **.png,**.css,**.pdf,**.ttf,**.otf,**.txt
-adaptresourcefilecontents **.fxml,**.properties,META-INF/MANIFEST.MF
-adaptclassstrings
-keepclassmembernames class * {#FXML *;}
This question was duplicate; Here is the answer to this question:
The problem is that FXML cannot import classes that do not start with an upper case letter. Therefore one has to provide an own list of available names that ProGuard uses for obfuscating.
More details at: https://stackoverflow.com/a/29374932/2627659

`FeatureContext` context class not found and can not be used.

I'm new with symfony2 and i wnat to test my app using behat but when I followed the official install in this link http://docs.behat.org/en/latest/cookbooks/1.symfony2_integration.html#installing-and-enabling-symfony2-extension
i got this error :
[Behat\Behat\Context\Exception\ContextNotFoundException]
FeatureContext context class not found and can not be used.
it was just after the first line and when i ran the bin/behat command.
When using the Symfony2Extension, you are responsible for handling the autoloading. Make sure the FeatureContext class can be autoloaded by changing your composer.json autoload configuration and running composer dump-autoload.

Resources