You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When somebody adds the kuksa-java-sdk AND the androidx libraries to their application dependencies, they will face the following errors due to a clash of the javax:annotation-api and the org.apache.tomcat:annotations-api during the build of the application
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
> Duplicate class javax.annotation.Generated found in modules annotations-api-6.0.53.jar -> annotations-api-6.0.53 (org.apache.tomcat:annotations-api:6.0.53) and javax.annotation-api-1.3.2.jar -> javax.annotation-api-1.3.2 (javax.annotation:javax.annotation-api:1.3.2)
Duplicate class javax.annotation.PostConstruct found in modules annotations-api-6.0.53.jar -> annotations-api-6.0.53 (org.apache.tomcat:annotations-api:6.0.53) and javax.annotation-api-1.3.2.jar -> javax.annotation-api-1.3.2 (javax.annotation:javax.annotation-api:1.3.2)
Duplicate class javax.annotation.PreDestroy found in modules annotations-api-6.0.53.jar -> annotations-api-6.0.53 (org.apache.tomcat:annotations-api:6.0.53) and javax.annotation-api-1.3.2.jar -> javax.annotation-api-1.3.2 (javax.annotation:javax.annotation-api:1.3.2)
Duplicate class javax.annotation.Resource found in modules annotations-api-6.0.53.jar -> annotations-api-6.0.53 (org.apache.tomcat:annotations-api:6.0.53) and javax.annotation-api-1.3.2.jar -> javax.annotation-api-1.3.2 (javax.annotation:javax.annotation-api:1.3.2)
Duplicate class javax.annotation.Resource$AuthenticationType found in modules annotations-api-6.0.53.jar -> annotations-api-6.0.53 (org.apache.tomcat:annotations-api:6.0.53) and javax.annotation-api-1.3.2.jar -> javax.annotation-api-1.3.2 (javax.annotation:javax.annotation-api:1.3.2)
Duplicate class javax.annotation.Resources found in modules annotations-api-6.0.53.jar -> annotations-api-6.0.53 (org.apache.tomcat:annotations-api:6.0.53) and javax.annotation-api-1.3.2.jar -> javax.annotation-api-1.3.2 (javax.annotation:javax.annotation-api:1.3.2)
Duplicate class javax.annotation.security.DeclareRoles found in modules annotations-api-6.0.53.jar -> annotations-api-6.0.53 (org.apache.tomcat:annotations-api:6.0.53) and javax.annotation-api-1.3.2.jar -> javax.annotation-api-1.3.2 (javax.annotation:javax.annotation-api:1.3.2)
Duplicate class javax.annotation.security.DenyAll found in modules annotations-api-6.0.53.jar -> annotations-api-6.0.53 (org.apache.tomcat:annotations-api:6.0.53) and javax.annotation-api-1.3.2.jar -> javax.annotation-api-1.3.2 (javax.annotation:javax.annotation-api:1.3.2)
Duplicate class javax.annotation.security.PermitAll found in modules annotations-api-6.0.53.jar -> annotations-api-6.0.53 (org.apache.tomcat:annotations-api:6.0.53) and javax.annotation-api-1.3.2.jar -> javax.annotation-api-1.3.2 (javax.annotation:javax.annotation-api:1.3.2)
Duplicate class javax.annotation.security.RolesAllowed found in modules annotations-api-6.0.53.jar -> annotations-api-6.0.53 (org.apache.tomcat:annotations-api:6.0.53) and javax.annotation-api-1.3.2.jar -> javax.annotation-api-1.3.2 (javax.annotation:javax.annotation-api:1.3.2)
Duplicate class javax.annotation.security.RunAs found in modules annotations-api-6.0.53.jar -> annotations-api-6.0.53 (org.apache.tomcat:annotations-api:6.0.53) and javax.annotation-api-1.3.2.jar -> javax.annotation-api-1.3.2 (javax.annotation:javax.annotation-api:1.3.2)
Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.
kuksa-java-sdk embeds the org.apache.tomcat:annotations-api while the other applications mostly use the javax:annotation-api.
Right now we need to manually exclude either library e.g. by using the following snippets:
When somebody adds the kuksa-java-sdk AND the androidx libraries to their application dependencies, they will face the following errors due to a clash of the javax:annotation-api and the org.apache.tomcat:annotations-api during the build of the application
kuksa-java-sdk embeds the org.apache.tomcat:annotations-api while the other applications mostly use the javax:annotation-api.
Right now we need to manually exclude either library e.g. by using the following snippets:
Possible solutions are:
a) exchange the org.apache.tomcat:annotations-api with javax:annotation-api (I think there were some license issues with the javax:annotations-api)
b) don’t use implementation scope but a scope (compileOnly?) which is not added as a transitive dependency for the annotations-api
c) don’t implement anything, note down what to do in the troubleshooting guide.
The text was updated successfully, but these errors were encountered: