[SOLVED] "build_native.sh" refuses to work :(

[SOLVED] "build_native.sh" refuses to work :(
0.0 0


Hiya guys! I kinda new, and I hope I don’t screw up before asking stuff. I’m trying to get Cocos2DX working on an Android project and I stumbled upon something while trying to run the build_native.sh under Cygwin, as said in the official tutorial:
What happens is that I do the same thing on my Cygwin terminal, and this pops up:
$ ./build_native.sh
./build_native.sh: line 7: $’‘: command not found
./build_native.sh: line 17: syntax error near unexpected token `$’do\r’‘
’/build_native.sh: line 17: `do
Does anyone know why this happens? Thanks a bunch!
EDIT: Ok, I think I needed to specify how my code was on this, since I didn’t know if this is a common error or not, but if anything, here goes my build_native.sh code:
# set params
# make sure assets is exist
if [~~d $GAME_ANDROID_ROOT/assets ]; then
rm ~~rf $GAME_ANDROID_ROOT/assets
mkdir $GAME_ANDROID_ROOT/assets
# copy resources
for file in $RESOURCE_ROOT/*
if [~~d $file ]; then
cp ~~rf $file $GAME_ANDROID_ROOT/assets
if [~~f $file ]; then
cp $file $GAME_ANDROID_ROOT/assets

  1. build



Open file in any powerful text editor and make EOL conversion, this file must have UNIX-like format.

For example: Open build_native.sh in Notepad++ and use menu Edit~~>EOL Conversion~~>Convert to UNIX format.


*It worked![](* Thanks a lot Marat ;D

FYI, I used WinSyntax 2.0 and also did the trick :slight_smile:

After changing the format of the file, I found an error with the AWK application from the Android NDK, which I solved by overriding its use, following what was said in “this post”:http://www.cocos2d-x.org/boards/10/topics/6264?r=6452#message-6452 .

Now I’m facing some issues with the use of SimpleAudioEngine.h in the example, but I think I can sort it out.
Again thanks) :smiley:


if i change t format using notepad++ to a unix format , i get an error stating no such file or directory


You should check the path.
May be you should paste error message.