Ant (Eclipse project) is not supported from Android SDK Tools 25.3.0

Ant (Eclipse project) is not supported from Android SDK Tools 25.3.0
0.0 0

#1

How can I solve this problem:

cocos compile -p android
Python 2.7.10
Building mode: debug
Using Eclipse project : /PROJECTS/COCOS/test/proj.android
Ant (Eclipse project) is not supported from Android SDK Tools 25.3.0.

My configuration is:

macOS Sierra 10.12.5
java version “1.8.0_131”
cocos2d-x-3.15.1
android-ndk-r14b
android studio 2.3.2

I readed old post that suggest to downgrade android-sdk but I can’t found old SDK for Mac. Can you help me to compile or downgrade SDK.


#2

I uploaded the tools folder: https://share.weiyun.com/a56bd766ef612243a2967f99f7be3a51. You just need to replace the folder in Android SDK. The link will be invalid in 7days.


#3

Are there plans to solve this issue?
Are there best practices to cocos2d-x android development on MacOSX?


#4

forget ant , start using android-studio and gradle. Ant really not making sense for cocos 3.x :slight_smile: no any advantage over gradle.


#5

Yep, we suggesting to use Android Studio instead.


#6

I’ve tried different sdk versions because of ant. I think cocos needs better documentation. The existing tutorials are outdated and i lost a day before finding this thread.


#7

How to build prebuilt libs with gradle?


#8

Same problem here.

Cocos docs need to be updating.

How to start a new cocos2dx project within Android Studio ?
Like @piotrros asked, how to build prebuilt libs with gradle ?


#9

Does it mean proj.android would not be supported since SDK Tools 25.3.0?


#10

Yep, since some tools removed by Android SDK. Of course you can copy tools from older Android SDK version if you really like ant building.


#11

But will it regain support? Recently I updated with new SDKManager embedded in Android-Studio and even with downgrading to Android SDK tools revision 25.2.3 or 25.2.3 I get this error during compilation:

   [dx] java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0
   [dx]     at java.lang.ClassLoader.defineClass1(Native Method)
   [dx]     at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
   [dx]     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
   [dx]     at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
   [dx]     at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
   [dx]     at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
   [dx]     at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
   [dx]     at java.security.AccessController.doPrivileged(Native Method)
   [dx]     at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
   [dx]     at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
   [dx]     at java.lang.ClassLoader.loadClass(ClassLoader.java:412)
   [dx]     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
   [dx]     at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
   [dx]     at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
   [dx] Exception in thread "main"
BUILD FAILED

Even when building with --ap android-20.


#12

@MatrixAndrew i don’t quite understand your issue. Will you please describe your issue in more detail?


#13

mm

Unsupported major.minor version 52.0

I think it is related to installed on machine Java version so you need newest java


#14

Exactly; buildToolsVersion larger than 23.0.3 requires JDK8, I now successfully use the latest (26.0.0). Also, for me NDK r13b is the highest version that seems to work with Ant projects (proj.android). Plus, the hack of downgrading to platform tools version r25.2.5 is mandatory as well for successful compilation as of now.


#15

I would recomend to intsall/configure on machine cocos2d-x 3.15 and then with it you should be able to compile your ant project event with latest android sdk, I preferring to use NDK 10 it seems have less crashes nad buildtools 25.0.0 , targetsdk 22, minsdk 15


#16

I think this gives better results:
NDK r13b, latest build tools (26.0.0), min sdk 15, target sdk 25, compile sdk 20 (for highest compatibility, not entirely sure though) and platform tools 25.2.5 (with the downgrade hack).


#17

Are u implementing permissions requests on fly because using target sdk 25?


#18

I overlooked, I use targetSdkVersion 23.


#19

permission requests should be implemented starting from target sdk 23 :slight_smile: anyway


#20

During debugging it isn’t needed, I’m not planning on using dangerous permissions anyways. It shouldn’t be hard to implement on-the-fly permissions though.