求助copypng emittedphp display errorss 新手求助

1091人阅读
NSString* headerData=***;
headerData = [headerData stringByTrimmingCharactersInSet:[NSCharacterSet
whitespaceAndNewlineCharacterSet]]; &//去除掉首尾的空白字符和换行字符
&& & & headerData = [headerData stringByReplacingOccurrencesOfString:@&\r&
withString:@&&];
&& & & headerData = [headerData stringByReplacingOccurrencesOfString:@&\n&
withString:@&&];
如此即可。
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:257458次
排名:千里之外
原创:15篇
转载:12篇
评论:12条
(1)(1)(3)(1)(3)(3)(1)(5)(7)(1)(1)本文纯属个人见解,是对前面学习的总结,如有描述不正确的地方还请高手指正~
&&&&错误:
& & CopyPNGFile /Users/gongihou/Library/Developer/Xcode/DerivedData/KTVgo-frborfduejxrajgpkfdaipygijow/Build/Products/Debug-iphoneos/KTVgo.app/zhuangtai.png KTVgo/zhuangtai.png
& & cd /Users/gongihou/Documents/910
& & setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
& & /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/copypng -compress "" /Users/gongihou/Documents/910/KTVgo/zhuangtai.png /Users/gongihou/Library/Developer/Xcode/DerivedData/KTVgo-frborfduejxrajgpkfdaipygijow/Build/Products/Debug-iphoneos/KTVgo.app/zhuangtai.png
&& Not a PNG filCommand /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/copypng emitted errors but did not return a nonzero exit code to indicate failure
&&&&[attachment=47489]&
&&&&方案:
TexturePacker PNG 图片优化
&&&&如果你有某些原因,让你保持要使用PNG文件格式而不是我之前极力向你推荐的pvr.ccz文件格式,那么TexturePacker有一个选项,叫做&Png Opt Level&(Png优化级别),可以帮助我们增加png文件的大小(注意:这样并不会影响图片加载时间)
&&&&就我现在的理解来看,最大的优化级别可以生成最小的文件大小。但是,它有一个缺点,就是非常耗时。对于2009年出的27寸的iMac来说,处置尺寸稍大的纹理,须要消耗10-20的时间来处置。由于该优化过程采用了多线程的方式,所以,如果你有呆板是四核的,那么速度应该会快一些。
&&&&当然,你只有在真正宣布应用的时候才须要利用这个优化特性。当初的问题是,它到底可以增加多少文件体积呢?
&&&&我最大的一张png图片从2.4MB增加到了2.2MB.小一些的纹理从180kb减至130kb。可能单个文件增加的量并非很多,可是当你的png图片的总大小有18MB时,它可以使之增加至16MB。
注意,在xcode里头有一项设置,你可能会把它忽略失落。你须要关闭"Compress PNG files"开关,因为这个选项有可能会使你的png图片膨胀。你可以在xcode的build settings里头设置,如下所示:
&&&&如果激活此png压缩选项,xcode会在png文件打包进程序的时候运行自带的png优化程序。所以,有可能会使我们先前使用TP优化过的png图片再次膨胀。因此,再次确保这个选项已关闭!
&&&&不过即使你没有禁用此选项,你的程序大小还是会有所减小。因为,你有可能使用一些没有被TP优化过的png图片。
&&&&2、将图片放到bundle里边(制作bundle方法,创建一个文件夹,将内容放进去,然后重命名,将文件夹后缀名改成bundle就OK了)。然后将bundle添参加工程,
&&&&下边是对bundle中内用的使用。
&&&&每日一道理
青春,有嬉笑声与哭泣声夹杂的年华,青春的少年是蓝天中翱翔的幼鹰,虽然没有完全长大,有些稚气,有些懵懂,脱不开父母的双手却极力想去找寻属于自己的一片天空,为的是一时的激情,为的是一种独自翱翔的感觉!
&&&&首先须要添加#import&&QuartzCore/QuartzCore.h&头文件
&&NSBundle&*myBundle = [NSBundle&bundleWithPath:[[NSBundle&mainBundle]pathForResource:@"Bundle"&ofType:@"bundle"&]];//获取设定的bundle
& &&NSString&*imageStr = [myBundle&pathForResource:imageName&ofType:@"png"];//在该路径下寻找imageName为名字的图片后边是格式,返回值是图片的绝对路径
& & [_imgView&setImage:[UIImage&imageWithContentsOfFile:imageStr]];//将图片添加到imageView试图。
文章结束给大家分享下程序员的一些笑话语录:
一个程序员骑着一个很漂亮的自行车到了公司,另一个程序员看到了他,问 到,&你是从哪搞到的这么漂亮的车的?&
骑车的那个程序员说, &我刚从那边过来, 有一个漂亮的姑娘骑着这个车过来, 并停在我跟前,把衣服全脱了,然后对我说,&你想要什么都可以&&。
另一个程序员马上说到, &你绝对做了一个正确的选择, 因为那姑娘的衣服你 并不一定穿得了&。
---------------------------------
原创文章 By
图片和优化---------------------------------
阅读(...) 评论()Posted on March 21st, 2014 by lucy &
-(void) updateText WithInt: (int) val {
numValue +=
NSString *numString = [NSString stringWithFormat:@&%i&, numValue];
[textFieldName numString];
Posted on June 12th, 2013 by lucy &
GameBGiPad1.png & & & & &- For iPhone &
GameBGiPad1-hd.png & & & - For iPhone HD
GameBGiPad1-ipad.png & & - For iPad &
GameBGiPad1-ipadhd.png & - For iPad HD
Posted on April 21st, 2013 by lucy &
This is the same as post we made on the cocos forums , but we found we can’t edit the original post after a few hours, so probably better to keep this one up to date, add images and so forth. Hope it helps other people.
Intro/preamble/history
(javascript) are pretty interesting. They promise a free, open-source flash replacement that can publish to html5 and iOS, and via the c++ based cocos2d-x, to just about any other major platform (android and windows being the obvious ones). They’re being developed by Zynga, they made a little game called Farmville, maybe you’ve heard of it?
Cocosbuilder is aiming to be a flash-style authoring environment, with timeline, keyframes, resource navigator, code editor, publishing tool all built in.
Cocos2d-js is a javascript based scripting language that lets you do all your game logic in a runtime language, but all the high performance low-level stuff is pushed to native run-time engines. Not surprisingly, its the scripting language used within Cocosbuilder.
Cocosbuilder has been around for about a year or so, previous versions were only for layout and animation. You’d then take those cocosbuilder assets, load them into your xcode project, and do your game logic in obj-c.
Version 3 alpha 3 came out in March 2013, its big feature being javascript integration, so that you can do all your work in a unified, fast to prototype environment, and publish to other platforms as required. You can test your code in an almost live setting by sendign your game to a browser, or use the bundled cocosplayer app, and test it directly on an iOS device. Its great.
Right now however (April 2013), its still very bleeding edge, and not well documented. Ray Wenderlich has tutorials for , and
(scroll down to the ‘just one more thing’ section), and there’s some , but there’s not much around yet for cocosbuilder v3 AND javascript AND xcode. Getting cocosplayer to work wasn’t too bad, as we explained in , but getting a cocosbuilder game to a complete xcode compiled iOS app was a little trickier, thats what this blog post is about. There’s still some unanswered questions, we’ll get to those at the bottom.
Should note that this is also based on trawling quite a few posts from the cocos forums and stackoverflow, thanks for sharing everyone.
(I’m using v3a3)
(I’m using 2.1rc1)
do the proper initialise as explained in the , to expand all the extra required libs and give you the correct project templates
get the , here we’ll be using the cocosDragonJS game.
Publish Cocosbuilder Files
Similar to the difference between a .fla and a .swf, you need to publish the made-for-editing files (.cbb) into a compressed file format (.cbbi), as well as the rest of the stucture for your images, code, sounds.
open cocosbuilder
open the cocosdragonjs example
file -& publish settings, disable all except iOS, set options to flat file export (you don’t need to do this, but saves a few extra folders being made which you don’t need right now)
file -& publish. this creates a subfolder called ‘published files iOS’ with the compiled cbbi files and graphics in sub-subfolders.
Setup Xcode project
in xcode, file -& new project, ‘cocos2d ios with javascript’, name it, choose a folder
remove ‘main.js’ from the project navigator, you’ll be replacing it with one from cocosbuilder.
Copy Cocosbuilder resources to Xcode
In finder, select everything in the published files iOS folder, copy
Find the resources folder of your xcode project, paste
Select them all in Finder, drag them into the xcode project navigator under the ‘resources’ folder
In the dialog that appears, I enabled ‘copy items into destination folder’ and ‘create groups for any added folders’, and ticked ‘add to targets’.
Modify Xcode project
You need to include the ccb reader headers (easy), and tell xcode to copy the js files, not try and compile them (easy once you know where to look)
edit ‘AppDelegate.h’, and add the include required to load ccbi files:
#include "CCBReader.h"
select the topmost entry of your project navigator, blue icon, should be named the same as your project
in the main panel, swap to ‘build phases’
in the filter entry, type in ‘.js’
you’ll see that xcode has mistakenly put the cocosbuilder .js files into the ‘compile sources’ category. that’s bad. select all the .js files that are in that section, and drag them into the ‘copy bundle resources’ section instead. if you don’t do this, you’ll get lots of ‘foo.js: file not found’ style errors.
That should be it, hit Run and admire your handiwork!
Ok, so there’s some broken things.
It’s in landscape rather than portrait
Graphics are messed up.
Fixing orientation
The xcode cocos template is set to landscape by default. Easily fixed:
Go to the target settings panel (select the top icon in the project navigator, then the summary pane)
Set the app to universal (may as well, the cocosbuilder project is designed to handle iphone, ipad and retina displays)
Set the orientation for iphone to portrait only, scroll down, do the same for ipad
In AppDelegate.mm, search for ‘Landscape’, replace with ‘Portrait’.
Yes its ugly brute force, but it works for now.
Fixing graphic sizes
This is our current hold-up. We get these sort of errors during the build process (interesting bits highlighted)
CopyPNGFile /Users/seamonkey/Library/Developer/Xcode/DerivedData/test_dragon-cpppmvfcbrjfzsaboqlzbunwvano/Build/Products/Debug-iphoneos/test_dragon.app/settings-button-down.png test_dragon/resources-ipadhd/settings-button-down.pngcd /Users/seamonkey/Documents/test_ccbuilder/test_dragonsetenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/copypng -compress "" /Users/seamonkey/Documents/test_ccbuilder/test_dragon/test_dragon/resources-ipadhd/settings-button-down.png /Users/seamonkey/Library/Developer/Xcode/DerivedData/test_dragon-cpppmvfcbrjfzsaboqlzbunwvano/Build/Products/Debug-iphoneos/test_dragon.app/settings-button-down.png
While reading /Users/seamonkey/Documents/test_ccbuilder/test_dragon/test_dragon/resources-ipadhd/settings-button-down.png pngcrush caught libpng error: Read ErCommand /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/copypng emitted errors but did not return a nonzero exit code to indicate failure
Some quick reading shows its an xcode thing rathe xcode by default compresses images when they get bundled into the app. Other people have encountered this error, with 2 suggested causes/actions:
The image doesn’t exist, but xcode thinks it does. Seems to be more common, people have deleted images from their project, but xcode keeps trying to process it anyway. Doing a project clean and manually editing plist files etc seems to fix.
The image is corrupt. Re-saving in photoshop usually fixes.
Clearly we don’t need the first solution. We tried the second solution, that doesn’t work.
Interestingly, each build seems to affect a different image, which leads us to think it might be something else. We’ve noticed that cocosbuilder handles the different iOS image sizes by making a folder for each device type (iphone, iphone retina, ipad, ipad retina), and putting identically named images in each. We’ve found Xcode in the past gets confused by multiple files with the same name, even if they’re in different folders, could it be the same problem here? Still investigating.
*time passes*
Tried again with a clean xcode project, this time we don’t get the errors, but get multiple warnings like this:
Warning: Multiple build commands for output file
/Users/seamonkey/Library/Developer/Xcode/DerivedData/test_dragonaltfolders-bhissnkaolzjlobqrjxstmkiozny/Build/Products/Debug-iphonesimulator/test_dragonaltfolders.app/cloud.png
Which seems more in li xcode is getting confused by the multiple images with the same name. Are we not bringing the resources into xcode correctly perhaps? I’ve tried both as ‘copy everything’ and ‘links’ (aka yellow folders vs blue folders). Linked folders doesn’t find the images at all, copied folders finds the images, but they display incorrectly. Hmm.
Whats amusing/frustrating about this whole thing is that Cocosbuilder -& Cocosplayer does this entire process perfectly, in an instant, with no user intervention. Oh well.
Anyways, that’s where we’re up to, any advice appreciated! Hope this helps others too.
Troubleshooting
These are half-remembered errors as we learned this process, but they might be useful if you get stuck:
main.js not found
(or any js files not found), can be
you’ve not ticked the files to be included in the target. select the js file in the navigator, look on the pa under ‘target membership’ there should be a tick next to the name of your project. if not, that file won’t be exported. you can multi-select files and then enable the toggle, or better remember the next time you drag files into the resources, to tick the ‘add to target’ option.
the files are being compiled, not copied. check in the build phases, they should be under the copy section.
require lines are missing.
it should be in the auto-generated main.js, we tried manually editing main.js to start with, getting all the required names messed us up a few times
cbb files aren’t loading, errors on loadAsScene
make sure you’ve added the #include “CBBReader.h” line.
images not found
check you’ve copied folders (yellow folders), not created a folder reference (blue folders).
testing the html5 version of the games with chrome hangs at a black screen
yes it does *shrug*. try safari instead, works for us.
Tags: , , ,
Posted on March 1st, 2013 by lucy &
Want a nice, easy to read and implement description of blend modes in Cocos2D? Well you won’t get it here on Tokeru, but you will on Nial Giacomelli’s site. Check it out.
Tags: , , ,
Posted on January 30th, 2013 by lucy &
Real quick one, if you are trying to submit your app to iTunes through xcode and you find that the menu item Product->Build For->Build For Archiving is greyed out, then check your build target. It has to be IOS device, not one of the simulators.
Posted on January 29th, 2013 by lucy &
Easy as, here it is for 6. You can change to 5′s if that’s what you need.
-(BOOL) isIOS6 {
& & if([[[UIDevice currentDevice] systemVersion] floatValue] &= 6.0){
& & & & return YES;
& & }else{
& & & & return NO;
Posted on November 20th, 2012 by lucy &
I’ve been expanding the amount of devices I have and returning to old code to try and sort out and update code that doesn’t run on newer IOS’s. While trying to compile Loopy Tunes, I came across the error
from Xcode, “could
not launch app, no such file or directory exists..” So here I found the solution due to one helpful blogger,
Tags: , , , ,
Posted on October 1st, 2012 by admin &
Right had to do a bit of research for this one, here is the fix I found that works from Natalie London
In your APP DELEGATE.m
NSString *reqSysVer = @&6.0&;
NSString *currSysVer = [[UIDevice currentDevice] systemVersion];
if ([currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending){
& & [window setRootViewController:viewController]; // This is for IOS6.....
& & [window addSubview: viewController.view]; //This is for & IOS6....... (the old way)
In your ROOTVIEWCONTROLLER.m //will only be compiled for IOS6
FOR LANDSCAPE USE THIS
- (NSUInteger) supportedInterfaceOrientations {
& & return UIInterfaceOrientationMaskL
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{
& & return UIInterfaceOrientationLandscapeR
- (BOOL) shouldAutorotate {
& & return YES;
FOR PORTRAIT USE THIS
- (NSUInteger) supportedInterfaceOrientations {
& & return
UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideD
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{
& & return UIInterfaceOrientationP
- (BOOL) shouldAutorotate {
& & return YES;
The page I got this from is
/message/618
Tags: , , ,
Posted on July 25th, 2012 by admin &
I could write out how to do this, but I couldn’t do better than this post here.
And in case you need to know how to create your Ad Hoc Distribution Provisioning Profile, look at the Apple notes here
/library/ios/#documentation/ToolsLanguages/Conceptual/DevPortalGuide/CreatingandDownloadingaDistributionProvisioningProfile/CreatingandDownloadingaDistributionProvisioningProfile.html
And if you want to know how to add devices for testing. Get the UDID from the iphone or ipad, and in the the IOS Provisioning Portal go to “devices”. Select “add devices” in the top right corner. Enter the device name and device ID and hit “submit”.
Posted on May 11th, 2012 by admin &
Right so I get this one a lot, especially when I’m coding late at night and tired…which is most of the time. So, my main culprits are objects that I haven’t released in my dealloc method.
Especially look for anything that you created with ALLOC INIT, for example an array
[[NSMutableArray alloc] init]
You must, must, must release it.
Second most common is not removing the class from observing a Notification. So if you have something like
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(classMethod:) name:@&notificationName& object:nil];
Then again in your dealloc method, you must put this
[[NSNotificationCenter defaultCenter] removeObserver:self];
I’m sure there are more things, and I’ll add notes as I discover them.Not&a&PNG&fil&&&Not&a&PNG&filCommand
编译项目时,发现如下错误:
&Not a PNG fil & Not a PNG
filCommand
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/copypng
emitted errors but did not return a nonzero exit code to indicate
遇到这种情况是,编译时我们设置了,在编译项目时,对png文件进行压缩处理。
很可能,我们的图片是已经压缩,或者无法被压缩。
这样的化,就需要重新将编译设置的“Compress PNG Files” 选项设置成NO。
具体操作如下:
Proj&&&TARGETS&&&Build
Settings&&&&Compress PNG
Files&&&&设置为NO。
搞定!!!
希望对你有所帮助!
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。

我要回帖

更多关于 php display errors 的文章

 

随机推荐