最近有很多朋友在群里问用VS+Cocos2d-x 加载图片资源时总是报“ Get data from file(xxx.png) failed!  ” 错误,问题虽小,但却能影响项目的往下进行,在一遍又一遍的检查后,还是没有什么发现,这着实让人抓狂哇~~~~(>_<)~~~~ 。下面我就来说说这是为什么以及如何解决这个问题吧:

原因一:

在程序中的要引用的图片名字写错了~(低级错误^_^),解决方法我就不说了哈~

原因二:

在VS 项目工程中,你所看到的Resource 路径只是一个虚拟路径,也就是如果你将图片直接添加到VS项目中的Resource,则这张图片是放在虚拟路径中,并不是项目路径下的Resource,不信你可以打开你项目的本地路径,在Resource文件夹下你会找不到刚才在VS的Resource下添加的图片。

原因二的解决方法:

找到项目本地路径下的Resource,将项目所需要的图片直接copy到其中,然后在VS中将其添加到Resource,这时,问题就解决了!

图文:

1、

2、

3、

本文转蓬莱仙羽51CTO博客,原文链接:http://blog.51cto.com/dingxiaowei/1366388,如需转载请自行联系原作者

Get data from file(xxx.png) failed!相关推荐

  1. Directory lookup for the file xxx.mdf failed with the operating system error 2

    Directory lookup for the file "xxx.mdf" failed with the operating system error 2(系统找不到指定的文 ...

  2. Cocos2d: Get data from file(image.png) failed!

    1.前言 今天启动Cocos2d-x2.2的项目,build success后,遇到"Cocos2d: Get data from file(image.png) failed!" ...

  3. Failed to transform file 'xxx' to match attributes 的解决办法

    打开之前的项目,遇到了Failed to transform file 'xxx' to match attributes 的错误. 反复查阅资料,确定是添加的依赖缓存有问题,解决办法: C:\Use ...

  4. 加载.npz文件时,出现错误:OSError: Failed to interpret file ‘xxx.npz‘ as a pickle

    1..npz文件的内容是怎样的,怎么打开? 因为以npz结尾的数据集是压缩文件,里面还有其他的文件. 使用:cat_data.files 命令进行查看 import numpy as np cat_d ...

  5. 导入AAR报错 Failed to transform file 'xxx.aar' to match attributes {artifactType=jar}

    Failed to transform file 'xxx.aar' to match attributes {artifactType=jar} Failed to transform file ' ...

  6. insmod: init_module ‘xxx.ko‘ failed (No such file or directory)

    linux 加载模块时遇到: insmod: init_module 'xxx.ko' failed (No such file or directory) 解决办法: 使用dmesg查看问题 dme ...

  7. mac Apple M1 在根目录无法创建文件和文件夹 mkdir: /data : Read-only file system

    mac 根目录下无法创建文件夹 问题: mkdir: /data : Read-only file system 问题: mount_apfs: volume could not be mounted ...

  8. 关于ORA-01187: cannot read from file because it failed verification tests 的处理方法

    环境:OEL+Oracle 11.2.0.3+physical standby 问题描述:查询dba_temp_files试图时显示Ora-01187错误号: ORA-01187: cannot re ...

  9. mysql 1033_mysql报错1033 Incorrect information in file: ''''xxx.frm''''问题的解决方法(图)...

    这篇文章主要介绍了关于mysql报错1033 Incorrect information in file: 'xxx.frm'问题的解决方法,文中通过示例代码介绍的很详细,需要的朋友可以参考借鉴,下面 ...

最新文章

  1. 微型数据中心正在向边缘发展
  2. Spring Boot EasyPoi导出Excel下载
  3. vlookup两个条件匹配_vlookup,你还是只会基础的单条件查找?
  4. 深度学习(六十)网络压缩简单总结
  5. 程序员误区1:软件开发职业是青春饭
  6. 在Oracle中写出性能优良的SQL语句
  7. ThreadPoolExecutor运转机制详解
  8. TypeError: this.getResolve is not a function
  9. EEGLAB 使用记录
  10. 射频卡读写器c#源码
  11. 康奈尔笔记法,高效学习方法推荐
  12. 计算机网络实验一:网线制作和局域网组建lab1 report
  13. 第十二天-函数名 迭代器
  14. python钻石和玻璃球游戏_python使用pygame实现笑脸乒乓球弹珠球游戏
  15. 【品牌DTC增长力】私域,你做的可能是“假的”
  16. 大4女生想做软件测试岗,如何系统性学习测试呢?
  17. 圆周率一千万亿位_目前圆周率已经达到十万亿位了,为何还要算?有什么用处?...
  18. 制作一个chrome插件
  19. 真正的程序员职场高手,都是怎么沟通的?
  20. android简易计算器

热门文章

  1. HTTP错误404.3-Not Found
  2. eclipse执行单元测试报CreateProcess error=87的解决方法
  3. 使用连接来代替in和not in(使用外连接技巧)
  4. Nginx的Gzip模块配置指令(二)
  5. Nginx服务器启停方式介绍
  6. 已经被处理的消息不能丢
  7. 对称加密-DES加密
  8. 用循环求出1-100之间的偶数和
  9. 常用的函数式接口_Predicate接口_默认方法and
  10. MapReduce案例-wordcount-准备工作