Why can't I create an Android project anywhere?

This might be a silly question, but why can’t I create an Android project anywhere in my filesystem? I can do so for iOS.

I don’t know why it’s not possible to do this out of the box but it does seem odd that you can’t.
Anyway I modified the android project creation scripts so that I can and it works fine. I’ve attached the two scripts so that you can diff them against the vanilla versions to see what I did. I have an env var called COCOS2DX_DIR which points at the root of the cocos2dx install (I’m working on windows). I generally create a visual studio project first then use the attached .bat file to create an android project in the same place. Apologies if some things don’t quite work as I’ve also modified the visual studio wizard to create the project in a way that I like. Let me know what’s broken and I’ll point you in the right direction.

Cheers,
tony

Seems difficult to attach two files, so here’s the other one…

That helped some with regards to getting the project created. Now I’m just having problems getting it built. It seems like all over, everything is hard-coded to assume that particular directory.

Take a look at this tutorial: http://www.raywenderlich.com/33028/how-to-make-a-cross-platform-game-with-cocos2d-javascript-tutorial-the-platforms
Here author in section “Deploying for Android” is creating step by step properly configured project. It is very fragile, but it works.
Maybe it can help you.

For me, I gave up with setting up Android project in external dir and I have it in cocos2dxhome/projects :frowning:

I started from that post. But it seems the build script still has some problems.

I also have spaces in the path to the NDK, which might be causing problems too.

Steve Malsam wrote:

That helped some with regards to getting the project created. Now I’m just having problems getting it built. It seems like all over, everything is hard-coded to assume that particular directory.
Yeah, sorry I should have mentioned that - it was late and I wasn’t actually working with cocos. I went through all the projects and fixed the hard-coded paths using my COCOS2DX_DIR env var. It was a bit tedious getting it set up but imo having to work within the cocos hierarchy was a restriction I didn’t want to live with.

Have you considered committing your changes back to the project?

It would be amazing if that was in the vanilla build
Even better would be a templatized compound project (i.e. when making a new project, select which platforms you want involved, outputting a nicely linked and setup project) but i realize the amount of work involved in this endeavor :stuck_out_tongue: