I have problems with Cocos 2d-x (can’t build project for Android: Can’t build project for Android (Ubuntu)), I think that may be something wrong with my Ubuntu or I do something wrong. So would be nice if someone could setup everything (Ubutnu 14.0.4.3 with current SDK/NDK) and confirm that it works.
Yes, I have compiled in Ubuntu 14.04, everything is fine. I build ubuntu, android-project and androidstudio-project and all of them worked well.
Great, could you describe sequencing of setup process, thank you very much.
I just follow steps in Programming Guide. Have you compiled for desktop app (not android platform) ?
If everything is fine, have you setup Android SDK and NDK path for cocos2d ?
Paths are OK.
I installed Oracle JDK 8, adjusted enviroment variables;
Installed AndroidStudio/SDK/NDK, updated it;
Installed ant using sudo apt-get install ant;
Adjusted paths for cocos 2d-x (setup.py) and did source /home/user/.bashrc;
I’ve created project cocos new MyGame -p com.MyCompany.MyGame -l cpp -d ~/MyCompany;
Tried to build and run it: cocos run -s ~/MyCompany/MyGame -p android.
What did I miss ? Can it be caused by incompatibility with my hardware - can this problem be specific for some hardware ? (I tried to reinstall Ubuntu)
(Problem is: .cocos-project.json is not found.)
this works.
Sorry, I have no clue about your case. It is not about your hardware, I think you missed some configurations. What is your IDE ? Have you tried compile with your IDE ? At least you can compile for desktop. I use netbeans. I compile with netbeans for making sure everything is fine before compile for another platform. File “.cocos-project.json” is in root project folder. Do you have it ? I attached my “.cocos-project.json” if you don’t have it..cocos-project.json.zip (203 Bytes)
Cheers 
I did like that, cpp tests worked, but with android project still the same problem.
I have .cocos-project.json
Have you tried install ant ?
Yes, like I said before.
Sorry, maybe the others can help you 
The problem was in Java, now I have installed it correctly and got this problem: Can't build project for Android (Ubuntu)
Would you like sent folder structure that be generated by cocos2d and screenshot of error that you got (more process, not only compile result that you attach before) ?
I solved these problems, I can build and run project on my smartphone now, problem was in the latest SDK Build Tools, in latest AndroidStudio it seems to be impossible to choose previous versions of Build Tools.
I downloaded more older version (August 2015) - “android-studio-ide-141.2135290-linux”, then removed latest version of Build Tools and installed Android SDK Build Tools 19.1. Everything works now. This should be noticed in documentation.
I can run project on a real device, but can’t do it on AVD - with AndroidStudioProject there are problems:
Gradle sync failed: Argument for @NotNull parameter 'aFileName' of com/intellij/openapi/util/io/FileUtil.toSystemIndependentName must not be null
IllegalArgumentException: Failed to set up Android modules in project 'proj.android-studio': Argument for @NotNull parameter 'aFileName' of com/intellij/openapi/util/io/FileUtil.toSystemIndependentName must not be null
Thats great ![]()
I think you can flag [solve] for this thread, maybe somebody have same case. and this thread
I have no experience build in AVD. It doesnt recomended for build in AVD because GPU doesnt run well.
I reinstalled my Ubuntu, I have “.json not found” problem again. Difference - now I installed openjdk-7 instead of Oracle JDK 8.
Then I tried to install Oracle JDK 8, and got new problem: ant is not found. Every time after installation of Oracle JDK 8 ant disappears somehow. Then after installation of ant I got this:
BUILD FAILED
/home/user/Android/Sdk/tools/ant/build.xml:597: The following error occurred while executing this line:
/home/user/Android/Sdk/tools/ant/build.xml:716: The following error occurred while executing this line:
/home/user/Android/Sdk/tools/ant/build.xml:730: Compile failed; see the compiler error output for details.