的Cocos2D-X HelloCpp为Android无法从Windows构建APK由于拒绝的权限资源文件 [英] Cocos2D-x HelloCpp for Android unable to build apk from Windows due to permission denied on asset file

查看:141
本文介绍了的Cocos2D-X HelloCpp为Android无法从Windows构建APK由于拒绝的权限资源文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图运行cocos2dx在Android HelloCpp示例项目,从Windows 7 64位与Cygwin的64位建筑,然而,每次我尝试建立和运行,它抱怨权限被拒绝的标记Felt.fnt文件中的资产/字体文件夹。

I was trying to run cocos2dx HelloCpp sample project on Android, building from Windows-7 64 bit with Cygwin 64 bit, however, everytime I try to build and run, it complains that permission was denied on "Marker Felt.fnt" file in assets/font folder.

我查了一下,有关于该文件和chmod没有权限给它适当的权限,但每次我尝试再次运行时,该文件似乎是再生和再没有权限...

I checked that there's no permission on that file and chmod to give it proper permission, but everytime I try to run again, that file seems to be regenerated and has no permission again...

有没有人有同样的问题?我一直在谷歌上搜索我发现最近的问题是这样的:

Does anyone has the same problem? I have been googling and the nearest problem I've found is this:

<一个href="http://stackoverflow.com/questions/12417748/cocos2dx-android-get-data-from-fileassets-failed">Cocos2dx安卓:从文件中获取数据(资产/ *)失败

但是,这是相当不同的。我试图禁用UAC我的Windows机器上,但问题并没有消失。

However, it is quite different. I've tried disabling UAC on my Windows machine, but the problem doesn't go away

任何帮助是非常AP preciated

Any help is highly appreciated

推荐答案

检查 proj.android/build_native.sh ,每次运行构建,整个资产的时间/ *文件夹将被重新创建,因此,您的文件模式的被废止。

Check the proj.android/build_native.sh, every time you run the build, the entire assets/* folder will be re-created, and thus, your chmod is nullified.

您可以复制过程本身的 build_native.sh ,将文件模式后的搭配chmod 的CP后某处资产/ *

You can chmod after the copy process itself in the build_native.sh, place the chmod somewhere after cp the assets/*

在我的情况下,把

chmod 777 -R "$APP_ANDROID_ROOT"/assets 

复制资产的文件夹中的 build_native.sh 这样的后:

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

chmod 777 -R "$APP_ANDROID_ROOT"/assets
done

这篇关于的Cocos2D-X HelloCpp为Android无法从Windows构建APK由于拒绝的权限资源文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆