Cocos2D-x HelloCpp for Android cannot build apk from Windows due to denied access to asset file

I tried to launch a cocos2dx HelloCpp example project on Android built from a 64-bit version of Windows-7 with 64-bit Cygwin, however every time I try to build and run it complains that the permission was denied to "Marker Felt.fnt" , file in the assets / font folder.

I checked that there is no permission for this file and chmod to give it the correct permission, but every time I try to run again, this file seems to be regenerated and no longer has permission ...

Does anyone have the same problem? I was googling and the closest problem I found is this:

Cocos2dx Android: Failed to get data from file (assets / *)

However, this is completely different. I tried disabling UAC on my Windows machine, but the problem did not disappear.

Any help is appreciated

+4
source share
1 answer

Check proj.android/build_native.sh , every time you run the build, all resource information / * will be recreated, and thus your chmod will be invalidated.

You can chmod after the process of copying build_native.sh , put chmod somewhere after the cp assets/*

in my case, put

 chmod 777 -R "$APP_ANDROID_ROOT"/assets 

after copying the resource folder to build_native.sh as follows:

 if [ -f "$file" ]; then cp "$file" "$APP_ANDROID_ROOT"/assets fi chmod 777 -R "$APP_ANDROID_ROOT"/assets done 
+13
source

Source: https://habr.com/ru/post/1495253/


All Articles