Android Maven build gives trouble processing “javax/xml/namespace/QName.class”:

前端 未结 2 820
青春惊慌失措
青春惊慌失措 2021-01-02 05:18

Following error is showing in Maven console everytime I do Project -> Clean. Only the jar file is built in the target folder, apk

相关标签:
2条回答
  • 2021-01-02 05:38

    You can exclude implicit dependencies using the exclude-tag. QName seems to be in e.g. the xpp3 package. I solved this problem by adding the following exclusions to my pom (that already contained the dependency to google-api-client-googleapis):

    <dependency>
      <groupId>com.google.api.client</groupId>
      <artifactId>google-api-client-googleapis</artifactId>
      <version>1.4.1-beta</version>
      <exclusions>
        <exclusion>
          <groupId>commons-logging</groupId>
          <artifactId>commons-logging</artifactId>
        </exclusion>
        <exclusion>
          <groupId>xpp3</groupId>
          <artifactId>xpp3</artifactId>
        </exclusion>
    </exclusions>
    </dependency>
    

    If you need to find where the conflicting class files come from, run for example:

    for x in `find ~/.m2/repository/ -name \*.jar`; do jar tf $x|grep QName.class && echo "Found in: $x"; done`
    
    0 讨论(0)
  • 2021-01-02 05:46

    If your are using android maven integration, you should add the "provided" scope in your android sdk dependency.

    <dependency>        
    <groupId>com.google.android</groupId>        
    <artifactId>android</artifactId>        
    <version>2.3.3</version>        
    <scope>provided</scope>        
    </dependency>
    
    0 讨论(0)
提交回复
热议问题