欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

cocos2dx assets根目录录取失败

程序员文章站 2022-10-18 21:06:20
cocos2dx assets根目录录取失败,这个问题要怎么解决啊?先说原因创建出来的cocos2dx工程,assets应该是编译出来的。追加的资源要放到Resources中,编译的时候会自动copy到assetscocos run会先删除assets,重新载入资源。如果直接去改assets中的资源,会报WindowsError: [Error 5] :的错误网上说是python权限问题。不深究了。可能老手都没遇到过,我这样的新人小白要多注意本人初学cocos2dx,万事开头难啊。。。a...

cocos2dx assets根目录录取失败,这个问题要怎么解决啊?

先说原因
创建出来的cocos2dx工程,assets应该是编译出来的。
追加的资源要放到Resources中,编译的时候会自动copy到assets
cocos run会先删除assets,重新载入资源。
如果直接去改assets中的资源,会报WindowsError: [Error 5] :的错误
网上说是python权限问题。不深究了。


可能老手都没遇到过,我这样的新人小白要多注意
本人初学cocos2dx,万事开头难啊。。。


android-ndk-r9d
cocos2d-x-3.0rc0
按照http://blog.csdn.net/start530/article/details/21483729
1、python 配置环境变量
2、cocos new 新建工程
3、cocos run 编译执行


链接手机,执行OK。第一次运行发现挺顺利


然后试了试。
1、修改cpp 修改了字符串,hello world什么的 --------编译,运行OK


2、悲剧发生在这里,想换个图片,从网上下载了个png,应该不大 570*355
直接扔到了assets文件夹中,我没有修改任何文件,没有去使用这个资源
cocos run 报错,然后assets文件夹被自动删除了,里头的所有资源包括原来的图片
都没了  


跪求 解答 谢谢
-------------------------------------------------------------------------------------------------------------


D:\Cocos2dxDemo\HelloNew2dx>
D:\Cocos2dxDemo\HelloNew2dx>
D:\Cocos2dxDemo\HelloNew2dx>cocos run  -p android


D:\Cocos2dxDemo\HelloNew2dx>python D:\cocos2d-x-3.0rc0\tools\cocos2d-console\bin
\/cocos.py run  -p android
Runing command: compile
Building mode: debug
building native
The Selected NDK toolchain version was 4.8 !
running: 'D:\android-ndk-r9d\ndk-build -j4 -C D:\Cocos2dxDemo\HelloNew2dx\proj.a
ndroid -j1 NDK_MODULE_PATH=D:\Cocos2dxDemo\HelloNew2dx\proj.android\../cocos2d;D
:\Cocos2dxDemo\HelloNew2dx\proj.android\../cocos2d/cocos;D:\Cocos2dxDemo\HelloNe
w2dx\proj.android\../cocos2d/external'


Android NDK: WARNING: APP_PLATFORM android-19 is larger than android:minSdkVersi
on 9 in ./AndroidManifest.xml
Android NDK: WARNING:D:\Cocos2dxDemo\HelloNew2dx\proj.android\../cocos2d/cocos/2
d/Android.mk:cocos2dx_static: LOCAL_LDLIBS is always ignored for static librarie
s
Android NDK: WARNING:D:\Cocos2dxDemo\HelloNew2dx\proj.android\../cocos2d/cocos/2
d/platform/android/Android.mk:cocos2dxandroid_static: LOCAL_LDLIBS is always ign
ored for static libraries
make.exe: Entering directory `D:/Cocos2dxDemo/HelloNew2dx/proj.android'
[armeabi] Install        : libcocos2dcpp.so => libs/armeabi/libcocos2dcpp.so
make.exe: Leaving directory `D:/Cocos2dxDemo/HelloNew2dx/proj.android'
building apk
Android platform not specified, searching a default one...
android-19 is found
Traceback (most recent call last):
  File "D:\cocos2d-x-3.0rc0\tools\cocos2d-console\bin\/cocos.py", line 578, in <
module>
    run_plugin(command, argv, plugins)
  File "D:\cocos2d-x-3.0rc0\tools\cocos2d-console\bin\/cocos.py", line 558, in r
un_plugin
    dependencies_objects[dep_name] = run_plugin(dep_name, argv, plugins)
  File "D:\cocos2d-x-3.0rc0\tools\cocos2d-console\bin\/cocos.py", line 560, in r
un_plugin
    plugin.run(argv, dependencies_objects)
  File "D:\cocos2d-x-3.0rc0\tools\cocos2d-console\bin\..\plugins\project_compile
\project_compile.py", line 636, in run
    self.build_android()
  File "D:\cocos2d-x-3.0rc0\tools\cocos2d-console\bin\..\plugins\project_compile
\project_compile.py", line 140, in build_android
    builder.do_build_apk(sdk_root, ant_root, android_platform, build_mode, outpu
t_dir)
  File "D:\cocos2d-x-3.0rc0\tools\cocos2d-console\bin\..\plugins\project_compile
\build_android.py", line 125, in do_build_apk
    self._copy_resources()
  File "D:\cocos2d-x-3.0rc0\tools\cocos2d-console\bin\..\plugins\project_compile
\build_android.py", line 172, in _copy_resources
    os.mkdir(assets_dir)
WindowsError: [Error 5] : 'D:\\Cocos2dxDemo\\HelloNew2dx\\proj.android\\assets'
D:\Cocos2dxDemo\HelloNew2dx>

本文地址:https://blog.csdn.net/qq_21743659/article/details/108822306

相关标签: cocos2d