[SOLVED] Build failed on latest cocos2dx and sdkbox

Android Studio 3.1.4
cocos2d-x 3.17 release
SDKBOX v1.0.1.39
facebook 2.4.0.3
iap 2.4.0.3

steps performed:

  • cocos new -p cocos.test -l cpp cocostest

  • in gradle.properties, change PROP_MIN_SDK_VERSION=14 to PROP_MIN_SDK_VERSION=15

  • sdkbox import facebook

  • sdkbox import iap

  • Build in Android Studio

Build failed:
Multiple dex files define Landroid/support/annotation/FontRes;

Am I missing something here? Help would be much appreciated.

If I import either facebook or iap it works fine. It is when importing both of them that the problem occurs. This leads me to think that there is a conflict between them. I can’t believe I am the first one to see this?

checking on this.

1 Like

Any update?

I tried --staging version of the plugins as well, same problem.

solution

rm ./cocos2d/cocos/platform/android/java/libs/support-annotations-27.1.1.jar

result:

Starting application.
running: '/Users/admin/Documents/sdk/android/android-sdk-macosx/platform-tools/adb shell am start -n "org.cocos2dx.cpp317/org.cocos2dx.cpp.AppActivity"'

Starting: Intent { cmp=org.cocos2dx.cpp317/org.cocos2dx.cpp.AppActivity }
~/test/cpp317 [master] $ sdkbox info
  _______ ______  _     _ ______   _____  _     _
  |______ |     \ |____/  |_____] |     |  \___/
  ______| |_____/ |    \_ |_____] |_____| _/   \_
 Copyright (c) 2016-2018 SDKBOX Inc. v1.0.1.39
 installed packages:
     v2.4.0.3 facebook
     v2.4.0.3 iap
~/test/cpp317 [master] $

Thanks,

1 Like

There is no support-annotations-27.1.1.jar file in that folder. But there is one under proj.android\app\libs and when I remove that file the build is successful.

What is the reason for this? Will it be fixed in the next version?

planned on 2018/09/05

1 Like

Great, thanks!