Pre-built libs for android not compiles with NDK 14+

As I see, almost all this functions is legacy:

image gone for some reason, forum bug: !_23|690x462

But not Tremolo/misc.c:189: error: undefined reference to 'stderr'

I’m using all latest SDK’s, that probably because of that. My game code was compiled before without any problems with some old SDK, but I don’t remember which kind. Anyway I think this is a bug…
@zhangxm can you please take a look?

Also, when I’m building with:

cocos gen-libs -p android --ap android-19 --app-abi x86:armeabi-v7a

it’s not compiling, but with android-19 it is… strange. But the errors are the same as when compiling project in studio:

Cocos2d-x/cocos/./2d/CCActionGrid3D.cpp:509: error: undefined reference to ‘rand’
Cocos2d-x/cocos/./2d/CCActionGrid3D.cpp:510: error: undefined reference to ‘rand’
Cocos2d-x/cocos/./2d/CCActionGrid3D.cpp:513: error: undefined reference to ‘rand’
Cocos2d-x/cocos/./2d/CCActionTiledGrid.cpp:87: error: undefined reference to ‘rand’
Cocos2d-x/cocos/./2d/CCActionTiledGrid.cpp:278: error: undefined reference to ‘srand’
Cocos2d-x/cocos/./2d/CCActionTiledGrid.cpp:603: error: undefined reference to ‘srand’
Cocos2d-x/cocos/./platform/CCFileUtils.cpp:274: error: undefined reference to ‘atof’
Cocos2d-x/cocos/./platform/CCFileUtils.cpp:283: error: undefined reference to ‘atof’

and many same type of errors in other classes.

By downgrading to NDK 13.1.3 - without any changes in any files - I was able to compile my project.
So this is problem with latest NDK. Is anyone has the same issue?
@piotrros @energyy ?

I’m using NDK 13.1.3, yet still can’t get this working.

I’ve ran exactly the same command and the error is: “Ant (Eclipse project) is not supported from Android SDK Tools 25.3.0.”.

1 Like

@zhangxm With NDK 14+ hack with replacement tools folders will not work and this topic about that.

What command did you use to build prebuilt lib with NDK 14+?

@zhangxm cocos gen-libs -p android --android-studio --ap android-19 --app-abi x86:armeabi-v7a

@slackmoehrle For some reason my uploaded images in this thread are gone. Can you recover it?

Do you have any idea why they are missing? I looked at the file names and they are not even on the file system

It were in my posts for sure when I’ve created and posted. It’s just a screen-shoots made on macOS. Nothing special. Just your server problems I think.

UPD: @slackmoehrle also I saw in other forum threads some images were gone, a little bit old threads and some fresh. But when I’ve created this topic and added images - all was ok, but some days after they are gone.

@zhangxm Any progress? It’s really can be done? Can I use all latest SDK and tools with something like:
cocos gen-libs -p android --android-studio --app-abi armeabi-v7a --ap android-19 ?

Using pre-built libs I believe should be n1 options for developing. Moreover you can provide them already build, so user can download them and for example generate template as before with -binary flag and easily will compile project and very fast.

I wanted to write a simple tutorial for SBX and pre-built libs but it’s currently not possible to use them for android without hacks(replace tools folder and use oldest NDK). I just want to use all latest and without hacks.

I will need to look into the image issue.

@piotrros do you have any updates? Or anyone have any updates? @zhangxm ? Can you please tell me is any progress about this?

Not, i am busy with Creator for CPP, i think i will try to fix it in v3.17. I will ask the QA, they tested gen-libs command before releasing v3.16.

@anon98020523 the QA tested with cocos gne-libs without issue. Why you need to add --android-studio --ap android-19 ?

What they tested?
Because you advised to do so.

They just use the command cocos gen-libs. And they copy tools folder from older Android SDK.

Gen libs for android? Which parameters?

I’m using
cocos gen-libs -p android --ap android-19 --app-abi x86:armeabi-v7a

With all latest updates in android studio 3.0, but for sure replaced tools folder hack I got that errors as in 1st my post.

They just use cocos gen-libs without any parameter. We use Android Studio 2.3.3 since 3.0 is not released that time. We will use Android 3.0 in next version.

Without any parameters make no sense.