In fact, the binary template is for Cocos Studio. Please don’t use option -t binary
in command cocos new
.
@slackmoehrle Could you please update the document to remove the -t binary
option in step cocos new
? Thanks very much!
In fact, the binary template is for Cocos Studio. Please don’t use option -t binary
in command cocos new
.
@slackmoehrle Could you please update the document to remove the -t binary
option in step cocos new
? Thanks very much!
Ok I can do that.
But I want to use libs and Android Studio. It’s possible. And also I want and successfully used prebuilt libs for iOS target. Removing -t binary is very bad idea…
upd.: I’ve found solution fix line in prebuilt-mk/Android.mk here thanks to @zhangxm - Can not build project with cocos 3.13.1
$(call import-module, android/cpufeatures)
cocos compile -p android -m debug
BUILD SUCCESSFUL.
Now I can create project using prebuilt libs and build it for android. But haven’t tested it yet on real device… need to buy something.
Now, next step - use Android Studio for development! What about this - Cocos2d-x v3.12 released! ?
today, I built the pre-builts using v3.13.1 and I didn’t have any trouble. Clean virtual machine, using OS X.
@zhangbin can you tell me how a user creates a new project with cocos new ...
using the pre-built libraries without the -t
flag? I can’t seem to make this happen. I can if I use the old Cocos Launcher.
No please… too much info… - I mean - what you did exactly? What downloaded, installed, which command did you run etc. Just from the beginning I got error “android-10” can’t be found.
git checkout cocos2d-x-3.13.1
git submodule update --init
git submodule update
./download-deps.py
cocos gen-templates
cocos gen-libs -m release -p ios
cocos gen-libs -m release -p android --ap android-10
I used the android
tool to ensure I have the SDK installed.
So I should use git, and not to download from official site - http://www.cocos2d-x.org/download ?
Why you tested from git if we talked about zip that was downloaded as I previously said?
Also, minimum target API for me currently 16 and I’ve installed only it, but I’m thinking even using API 19.
But anyway if I run with this command( just now tested this):
cocos gen-libs -m release -p android --ap android-10
I’m still getting this error:
The directory ‘android-10’ can’t be found in ANDROID_SDK_ROOT/platforms, please use --ap to set needed API level.
Anyway, I’ve downloaded latest cocos2d-x from git and tested on it and got same error.
However, when I specify android-16 it worked. So now --ap command works.
But, if you download official zip of cocos2d-x - it will not work.
I’ll look at this more. Thanks for all the description.
I’ve replied the reason before.
As I mentioned before, the binary template is added for the Cocos Studio. It’s not worked well in the cocos2d-x environment.
Sure. But please re-read my question.
can you tell me how a user creates a new project with cocos new … using the pre-built libraries without the -t flag? I can’t seem to make this happen.
Yep, if a user want to using the engine as pre-built libraries. He/She should follow the two steps:
cocos new
with option -t binary
.In cocos2d-x, there isn’t any template named with -binary
now. So, maybe some users are using command cocos gen-templates
to implement the first step.
But in fact, the templates generated by command cocos gen-templates
are used for Cocos Studio environment (It was invoked when generating the installer of Cocos Studio). It works not well in cocos2d-x environment. That’s why I suggested remove the usage of cocos new -t binary
in the User Guide Document.
So we don’t have a template to use pre-builts without Cocos Studio code in it?
I need prebuilt libs for iOS, currently it works perfectly and saved my time.
I pulled from the v3
branch compiled using
cocos gen-libs -p android --ap android-10
cocos gen-libs -p ios
Sure, about that I already answered before:
This will work when 3.14 is released in a few days.
I can confirm 3.14 gen-libs works
That helped me a lot, thanks. I also had to prebuilt again.