android + eclipse + maven + actionbarsherlock

前端 未结 5 1505
心在旅途
心在旅途 2021-02-10 04:27

I read lots of things about actionbarsherlock, maven, android but none of the solution I\'ve seen worked for me :(

I\'m sure that I\'m pretty close to the solution but I

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-10 05:04

    You need to identify which dependencies in your pom.xml are including the classes that the Dalvik compiler is complaining about.

    1. In eclipse, you can identify what jar the problematic class belongs to by Open Type (on mac Command-T).

    2. Then you determine which transitive dependencies to those jars you have by looking up each direct dependency you have in maven central. And peering into the projects pom.xml.

    3. Once identified you need to add exclusion clauses to the corresponding dependency configuration in your project pom.xml.

    project pom.xml:

    
    
            ...
            ...
            
                
                    org.hamcrest
                    hamcrest
                
            
        
    
    

    There's a brute force way to do it as well. Just open up the project in eclipse, expand the 'Maven Dependencies' in project viewer, then add the exclusion clause to each direct dependency in your project pom one by one, each time hitting save. The android maven configuration plugin will recalculate the dependencies under 'Maven Dependencies' and you'll see the problematic jar disappear. Once you get all of them your Dalvik errors will disappear as well.

提交回复
热议问题