Not using prebuilt libs is really pain. I’m using Xcode only and really want to use only it.
I have hackintosh with Core i3 and SSD and new project using full source code building time is about 5 min. Also very slow indexing of the project. My xcode folder “DeliveredData” is really heavy after Xcode opens simple project. Also, if I want to clean up project it’s rebuild lib again and again. So that’s why using prebuilt libs really save my time.
Yeah. Honestly prebuilt should be the default. Most shouldn’t modify the engine. A dual target template could also be created that supports both.
It should check that prebuilts (and latest dependencies) exist and if not download from the prebuilt for common OS/arch/binaryformat in the same way many many oss projects do it.
Prebuilt Binaries should exist on GitHub releases wiki page or sourceforge for each version using auto build machine.
The default prob would still be copy source cocos folders like it does now. That way prebuilt is opt in for 3.x.
Obviously some want specific compile flags so a default normal flags in a debug and release mode would be created. Or even just prebuilts for debug only. Use source for release.
Maybe I’m off base here but we do something in the realm of what I’ve written and it streamlines many things. strong text
Also for iOS in debug mode after creating project using libs -it’s wont compile, but I’ve found solution for that.
But later this helped me
I modified these files and got build of android libs.
Then I created a new project:
cocos new ProjectName -p projectname.com.name -l cpp -t binary
And tried to compile it:
cocos compile -p android -m debug
And got this:
Android NDK: WARNING: APP_PLATFORM android-19 is larger than android:minSdkVersion 9 in ./AndroidManifest.xml
Android NDK: /Volumes/MacData/CocosX/cocos2d-x-3.13.1/cocos/./prebuilt-mk/Android.mk: Cannot find module with tag ‘android/cpufeatures/prebuilt-mk’ in import path
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…
@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.
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):
Yep, if a user want to using the engine as pre-built libraries. He/She should follow the two steps:
Has a template named [language]-template-binary.
Using 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.