Android Dex: UNEXPECTED TOP-LEVEL EXCEPTION: Already added

后端 未结 6 2460
傲寒
傲寒 2020-12-10 10:06

My app depends on a library project. This library project depends on the Android Compatibility Package V4. I have NOT exported the library project\'s depend

6条回答
  •  误落风尘
    2020-12-10 10:58

    If you use exactly the same lib jar in different projects (libs project or standard projects), the apk tools get rid automatically of the duplicate ones.

    The problem starts when you have two libs with the same name but not at the same revision.

    The android-support-v4.jar and android-support-v13.jar files can be from different revision since there always have the same name in different support package release (http://developer.android.com/tools/extras/support-library.html#Notes)

    I would check that you use exactly the same revision of the support libs in your main project and in your lib project.

    To make sure, copy the two support libraries jars (located in the android-sdk folder) to your projects libs folder.

    {android-sdk}/extras/android/support/v4/android-support-v4.jar
    AND
    {android-sdk}/extras/android/support/v13/android-support-v13.jar
    

    It should get rid of the problem.

提交回复
热议问题