Is this a machine being used by multiple users? Was cygwin+ndk installed as another user?
It appears as though the user whom the
build_native.sh script is running as does not have permission to read source (and asset) files required for the compilation script.
Notice in the logs:
At the time the script tries to copy resources (into proj.android/res)
cp: cannot open `/d/android/cocos2d-x-master/TestPrj1/proj.android/../Resources/CloseNormal.png’ for reading: Permission deniedAt the time it tries to compile main.cpp, which tries to #include Classes/AppDelegate.h:
Compile++ thumb : hellocpp_shared <= main.cpp
jni/hellocpp/main.cpp:1:25: fatal error: jni/../../Classes/AppDelegate.h: Permission denied
You may want to allow the read permission on all files in your project directory to the user you’re (eclipse is) running
build_native.sh. Note that this (cygwin user) may be separate from your Windows user. You’ll have to issue the permission granting command under cygwin. You’d do this on the lines of the steps mentioned below (you may have to run cygwin as the Windows user that installed it on the computer). Also note that right-clicking and adding permissions to files using Windows Explorer may not necessarily apply under cygwin (I’ve noticed this on machines using domain accounts, though it may be related to incorrect configuration/installation).
Launch the cygwin terminal (as the installing user). This may be in
C:\cygwin\bin\mintty.exe etc. You might also have “Cygwin Terminal” shortcut installed on your desktop or program menu.
Switch to your
TestPrj1 (Project’s) directory
cd /d/android/cocos2d-x-master/TestPrj1/Allow permissions to the group or just all users for files in this directory:
sudo chmod -R g+w *
sudo chmod -R a+w *Then try and run
build_native.sh either from Eclipse (or from the Cygwin Terminal as); You may be able to use your own user now)
Understanding unix permissions - the type of permissions that apply to your files in cygwin/ndk