Cocos2d-x 3.0 以后,运行build_native.py 直接编译打包apk。
build_native.py会将Resources中的内容直接拷贝assets中,如果Resoucres有版本控制。.svn文件夹一样会被拷贝过去。
当assets目录中已经存在.svn文件夹时,就会编译报错。
所以每次运行py文件前都要先把assets清空。
也通过修改build_native.py,来达到不拷贝.svn文件夹的目的。
def copy_files(src, dst): for item in os.listdir(src): path = os.path.join(src, item) # Android can not package the file that ends with ".gz" if not item.startswith('.') and not item.endswith('.gz') and os.path.isfile(path): shutil.copy(path, dst) if os.path.isdir(path) and not item.endswith('.svn') : new_dst = os.path.join(dst, item) os.mkdir(new_dst) copy_files(path, new_dst)
加入
and not item.endswith('.svn')