Contribution: Fix for template/android/

Contribution: Fix for template/android/
0.0 0


Here’s a little fix for template/android/

A potential problem happens when the filename of a resource being copied by the script has a space character in it.

Example: having “My Resource.png” in your resource folder causes the bash warning “binary operator expected” and fails to copy the file in the copy resources phase.

To fix it, simply enclose the $file variable in the copy resources for loop with double quotes:

# copy resources
for file in $RESOURCE_ROOT/*
    #echo $file
    if [ -d "$file" ]; then
        cp -rf "$file" $GAME_ANDROID_ROOT/assets

    if [ -f "$file" ]; then
        cp "$file" $GAME_ANDROID_ROOT/assets


Thank you.
Could you mind pull a request to cocos2dx?
The github address is


Minggo. Thanks for all your work on Cocos2D-X! :slight_smile:

I just submitted a pull request. Although, I did not create a topic branch as GitHub suggests. Is it okay to send you pull requests as I did? Or must I create a topic branch? Any feedback here would really help, as I’d like to make it really easy for you.

From :

Pull requests can be sent from any branch or commit but it’s recommended that a topic branch be used so that follow-up commits can be pushed to update the pull request if necessary.


Thank you Nat Weiss.

I have merged it.
Good work.