Jar Mismatch Found 2 versions of android-support-v4.jar in the dependency list

前端 未结 14 1953
半阙折子戏
半阙折子戏 2020-11-27 11:32

I am trying to create 2 versions of an Android app (free/paid). I have an Android Library that contains files common to both. I created a new Android project and am trying t

相关标签:
14条回答
  • 2020-11-27 11:51

    Resolution:

    1. Right click on 'free' project > Android Tools > Add Support Library.
    2. Do the same thing on 'paid' project.
    3. Clean all projects
    0 讨论(0)
  • 2020-11-27 11:53

    Just copy the library from one of the projects to the other one. Maybe the timestamp needs to be the same on both.

    0 讨论(0)
  • 2020-11-27 11:54

    Any ideas on how to resolve this?

    Delete one.

    I've been playing with the build path to no success.

    Step #1: Undo all that. If you are messing with the build path, on R16 or higher version of the ADT plugin for Eclipse, you're doing it wrong.

    Step #2: Pick one of those two versions of the JAR, or pick the one from the "extras" area of your SDK installation.

    Step #3: Put the right JAR in App Library.

    Step #4: Delete the one from App Free, since it will pick up that JAR from App Library.

    You are welcome to instead have the same actual JAR file in both spots (App Free and App Library), though that just takes up extra space for no reason.

    0 讨论(0)
  • 2020-11-27 11:54

    This is a more elegant fix than deleting and adding files!

    You just need to :

    1. Right Click the project App Free
    2. Go To "Android Tools" > "Add Support Library"
    3. Approve the permissions and let it update the library
    4. Repeat this process for the project App Library

    The Android Support Library will then be in sync (:

    0 讨论(0)
  • 2020-11-27 11:55

    well.. it works for me:

    Go to

    Project folder > libs

    then, delete "android-support-v4.jar"

    Then

    project > Clean

    It will work!

    0 讨论(0)
  • 2020-11-27 11:57

    There are some scenarios where you have multiple library projects having the the android-support-v4.jar in their libs and build paths and your project has a dependency towards both of them. Say for example in my case I have the following library projects in my workspace,

    • libfacebook
    • libsherlockactionbar

    Both these projects are independent and my project.properties looks like the following,

    # Project target.
    target=android-17
    android.library.reference.1=../libfacebook
    android.library.reference.2=../libsherlockactionbar
    

    When I build my project, I get a jar mismatch problem having duplicate references to two copies of the same file. What I did to solve this issue is a bit of trickery. I created a new library project named libcommons as a parent to all the other library projects in my workspace, including libfacebook and libsherlockactionbar. Then I removed the support library from all other projects and kept only one copy inside libcommons's libs folder. Then I have added libcommons as a reference to all my other library projects. Once cleaned my workspace, everything works like a charm.

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