Android Studio Compiling Error : duplicate entry: retrofit/android/AndroidApacheClient.class

  • mihir77
    Likes 0

    Problem Description

    Hi, I got multidex error after upgrading to cocos2dx 3.15

    So i had to use android studio and now i am compiling from android studio i am getting this error..

        Execution failed for task ':Fun:transformClassesWithJarMergingForDebug'.
        > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: retrofit/android/AndroidApacheClient.class

    Can you please help.. really stuck here...

  • Sonar Systems admin
    Likes 0

    So you upgraded an existing project to a newer version?

  • mihir77
    Likes 0

    Nope i created a new project using cocos2dx 3.15 and then copied classes and resources file and then imported share and appodeal plugin.

    I used to compile using cocos console but since i had to use multidex, as i needed facebook and appodeal plugin both , i had to switch to androdi studio.

    So now i am compiling using android studio..and it gives this error..

  • mihir77
    Likes 0

    I just found this one post with same error : but with different entry and this is the solution mentioned. – http://discuss.cocos2d-x.org/t/solved-post-facebook-integration-issue-cocos-compile-failed/29931/14?u=mihir77

    I had done 2 and 3 points but in first point..

    1. updated my Application class:

    public class App extends Application {
      @Override
      protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
     }
    }

    I cannot find the application class and if i have to create how and where?

  • Sonar Systems admin
    Likes 0

    Did the new project work without adding the extra files?

  • mihir77
    Likes 0

    Yes it works without adding share plugin and multidex.

    Does cocos helper plugins – facebook and twitter share supoort cocos2dx 3.15.

    Should i use that instead of sdkbox share?


  • Sonar Systems admin
    Likes 0

    Yes Cocos Helper does. I would use it over SDKBOX.

Login to reply