Cocos2d-x V3.7.1 Android Compile Error

  • onurtnrkl
    Likes 0

    Problem Description

    I builded my game on ios successfully, I tried to build on android but terminal gives this error.

    GoogleInc.:GoogleAPIs:23 is not a valid Android target platform.
  • onurtnrkl
    Likes 0

    I solve this but new problem occurred. I tried to compile with only using cocos helper google play services it works but when I added facebook it gives error when compile.

    [dx] UNEXPECTED TOP-LEVEL EXCEPTION:
           [dx] com.android.dex.DexException: Multiple dex files define Lcom/facebook/AccessToken$1;
           [dx]     at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
           [dx]     at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
           [dx]     at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
           [dx]     at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
           [dx]     at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
           [dx]     at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
           [dx]     at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
           [dx]     at com.android.dx.command.dexer.Main.run(Main.java:246)
           [dx]     at com.android.dx.command.dexer.Main.main(Main.java:215)
           [dx]     at com.android.dx.command.Main.main(Main.java:106)
           [dx]

    BUILD FAILED
    ../sdk/tools/ant/build.xml:888: The following error occurred while executing this line:
    ../sdk/tools/ant/build.xml:890: The following error occurred while executing this line:
    ../sdk/tools/ant/build.xml:902: The following error occurred while executing this line:
    ../sdk/tools/ant/build.xml:283: null returned: 2

    Total time: 48 seconds
    Error running command, return code: 1.


  • Sonar Systems admin
    Likes 0

    Did you use our facebook plugin from the helper?

  • onurtnrkl
    Likes 0

    Yes, I watched video, I did exactly same things.

  • Sonar Systems admin
    Likes 0

    Does Facebook work for you in a fresh project on its own?

  • onurtnrkl
    Likes 0

    I didnt try in fresh project but I added Google play services it works.

  • Sonar Systems admin
    Likes 0

    Try facebook on its own to see if you can get that to work

Login to reply