Android build works in Eclipse but not with Ant (“already added”)

后端 未结 4 1831
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-05 12:47

My Android project uses several git submodules marked as Android Libraries. These submodules all have different uses of the ORMlite Android jars and thus have the ORMlite ja

相关标签:
4条回答
  • 2021-01-05 13:04

    My problem was that all jars in any ./libs folder were included, not just the ones as specified in my eclipse .classpath. So I had some duplicates laying around there. I just needed to clean up my ./libs. You can find out what ant is all including in its "classpath" by running "ant -v debug", somewhere in the top half of the output.

    0 讨论(0)
  • 2021-01-05 13:06

    I solved my problem by creating a third Android project with only the ORMlite JAR in it that the two other projects depended on.

    0 讨论(0)
  • 2021-01-05 13:11

    i got the same problem using maven because it correctly added the ormlite-core-jarfile, which contains the packages and classes as the core-jar with a few additional classes.

    I added an exclusion and now it works

                <dependency>
                    <groupId>com.j256.ormlite</groupId>
                    <artifactId>ormlite-android</artifactId>
                    <version>4.9</version>
                    <exclusions>
                        <exclusion>
                            <groupId>com.j256.ormlite</groupId>
                            <artifactId>ormlite-core</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
    
    0 讨论(0)
  • 2021-01-05 13:11

    Had the same problem but with android-support-v4.jar — it was used in referenced project library and app project. Here's the solution

    Workaround: 1. Remove file android-support-v4.jar from App/libs 2. In Eclipse add jar referenced to ReferencedProjectLibrary/libs/android-support-v4.jar

    It works in Eclipse and Ant too ;)

    0 讨论(0)
提交回复
热议问题