Prebuilt generation not working in 3.13.1 and 3.11.1

I solved it by delete all object in folder tool/simlator/frameworks/runtime-src/proj.android/obj

3 Likes

Worked! Thanks! :slight_smile:

Same here.
I’m trying:

cocos gen-libs -p android --ap android-19 --app-abi armeabi
and
cocos gen-libs -c -p android --ap android-19

Always getting same error:

Why also it’s showing that it will build in debug?

I’m using just downloaded cocos2d-x-3.13.1 By the way - I was able to build libs for iOS and macOS.

And to be sure. Do you have Android-10 installed?

android list targets

id: 1 or "android-19"
     Name: Android 4.4.2
     Type: Platform
     API level: 19
     Revision: 4
     Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
 Tag/ABIs : no ABIs.
----------
id: 2 or "android-22"
     Name: Android 5.1.1
     Type: Platform
     API level: 22
     Revision: 2
     Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
 Tag/ABIs : no ABIs.
----------
id: 3 or "android-25"
     Name: Android 7.1.1
     Type: Platform
     API level: 25
     Revision: 3
     Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
 Tag/ABIs : no ABIs.

So, @slackmoehrle I do not give up. However, really I’m struggling already 3rd day, just trying to set up this and build for android.
I don’t see any explanation of my problems, but only this - it’s feels like you never tested latest cocos2d-x on macOS, right? Didn’t check for setup & build etc.? Because main target is windows?

Also, why when I creating project with static libs I get no proj.android-studio inside my project. But if I create new project using source code I get this folder and I can probably try open it in Cocos Studio? Right? And how I can use Eclipse? Old tutorials and docs are not working … omg Please help!!! Better in my initial thread - Need help getting started with Cocos2d-x to build for iOS & android

Install Android-10 I recall something about the libs use an older version to maintain comparability.

Or I think you can change the version in project.properties.

@zhangxm can you help here? We should notate how to fix in our docs.

I asked @zhangbin to take a look.

@crittergorge @anon98020523 @camkadev why did you use cocos gen-libs? Did you use Cocos Studio, or how did you use these prebuilt libs?

cocos gen-libs is not support option --ap in version 3.13.1, it’s added recently.

Version 3.13.1 is based version 3.13, it’s not contains the changes for the option.

So, if you want to run cocos gen-libs command without android-10. Maybe you can try on of the two choices:

  1. Update the cocos2d-console submodule to the latest commit of github.
  2. Manual modify the target config in project.properties files:
    • tools/simulator/frameworks/runtime-src/proj.android/project.properties
    • cocos/platform/android/java/project.properties

Sorry for the inconvenience! Hope it’s helpful!

1 Like

@zhangxm i use gen-libs because i dont like to wait about 10 minutes when all project builds, so generated libs of cocos helps me to compile it one time and then just compile my project, so gen-libs is saves my time
and no i do not use Cocos Studio

1 Like

Got it, so you should modify the project yourself to use prebuilt libs.

@zhangxm yes i did it 10 month ago and it is works fine with different version of cocos, but question is “why compilation is failed”

About your error, i think all libs are generated, the error happens when generating binary codes. The error seems that you use wrong cocos console, did you update cocos console yourself?

@zhangxm no i dont update console, just use console that comes with cocos

But i checked v3.13.1, the cocos console doesn’t include the codes that cause the error. It should be like this.

Edit: i mean the file content of tools/cocos2d-console/plugins/plugin_compile/build_android.py.

@zhangxm ok i need to check

If you use github repo, you can easily check out correct commit. If not, you can clone cocos console and replace the codes. The commit used in cocos2d-x v3.13.1 is here.

I’ve installed it, and not it’s asking same but now for android-13. I want to use android-19 and up. I don’t need lower devices.

Working with simple cocos2d-x project on my macOS hackintosh PC Intel Core i3 with SSD extremely slow! Compilation and indexing in Xcode is about 5 min. Building libs for macOS, iOS is about 25 min.

I’m following getting started tutorial from here - http://cocos2d-x.org/docs/editors_and_tools/cocosCLTool/
To save my time. I’m not using cocos studio, because it’s bad as all editors ever made and provided by cocos2d-x. Normal editor should work and be like SpriteBuilder… Why you don’t use it! If dev’s developing cross-platform games they would need to use macOS anyway.

Thats nice to hear after my 3 days of struggling to just get started with cocos2dx lol.
As I see guys you documentation is outdated, many things doesn’t work. I believe many many new developers that just tried all this dummy docs just gave up finally. But NOT me lol/

I just downloaded cocos2d-x from main site in downloads section, so there is no git or something.

Thats helps! Thanks! By the way - in first file there is anroid-10 and in the second android-13.
Thats why - this

isn’t worked.


Hurray! Libs compiled for android! On the 4th day or more even… I missing counting already - I finally compiled android libs on my macOS. Thanks god and dev’s here :slight_smile:

I’m afraid to imagine what to do next and how to read the documentation if all outdated and nothing is clear and missed at all.

So, now I want to open my android project and develop game in it. Which IDE for android on my Mac should I use? How to add in-apps, additional SDK’s like Flurry or unity ads? Or some specific android code, like game center? What next steps for me as new developer here? How to debug my code on android? Well, all typical question for developing of games…

p.s. compiling iOS libs is wrong(my main target is android, but anyway), libs compiled in debug mode - can’t compile iOS project. Info here - Need help getting started with Cocos2d-x to build for iOS & android But if libs compiled in release mode - I can compile project.

All right, I tried to move next a little bit. Assuming that now I have compiled libs for android.
So, I wanna create a new project:

cocos new ProjectName -p projectname.com.name -l cpp -t binary

And execute:

cocos compile -p android -m debug

As usually - it’s not compiling. :slight_smile: I would be surprised if something should just work.

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
Error running command, return code: 2.

@zhangxm @zhangbin ? What I should change to be able to compile? And also I should ask: is this a bug?