Tuesday, 25 December 2012

PVR image not loading issue (glError: 0x0501) with iPod Touch 4th Generation

Merry Christmas everyone! Hope everyone got you wished for!

Bought a 4th generation iPod Touch for kid, one personal reason for that is, I already have an iPhone 3GS and an iPhone 5, therefore need something in the middle to cover all main iPhone models so that I can test all my apps properly, heh heh heh....

So while no one is paying attention to the iPod Touch (busy reading the new Diary of Wimpy Kid book...), I quickly installed my apps on it for a quick test.

Mespfi works perfectly well, that's a tick, good job!

Strangely, Where Is It - Smart Kids Edition (uses Cocos2d) didn't. Although the splash page shows up ok, As below, none of the images for the main menu (and all pages after that as well) loads properly.


Quickly connect to XCode and tried again - it died too, as below due to this "glError: 0x0501" error. But if it works in all versions of simulators, plus iPhone 3GS, iPhone 5 and iPad 2, why doesn't it work with iPod Touch 4th generation??!!

As I have seen this error before (see this post) I know straight away it's due to the size of the texture .pvr files. After shuffle the images around for the iPhone ones, and removed the following 2 lines from the script that creates the texture files using TexturePack, that fixed the problem.


--max-width 4096 \
--max-height 4096 \


Unfortunately App Store won't be available until 28/12, have to wait a few more days to submit the update.

That worries me a bit, I thought all Apple products should be quite similar and wouldn't need to test your apps in all different versions of physical devices?

Sunday, 9 December 2012

Issue with iOS 6 Game Center landscape app issue fixed

Got my iPhone 5 temporarily working by connecting to WiFi while still waiting for the new SIM. First thing I did was obviously download my 2 games from App Store and have a go, but to my biggest shock, Where Is It Smart Kids Edition crashed after the splash page, how could this be??!!

Tried it in XCode and it crashed too! Error message as below:


2012-12-09 20:53:19.490 Where is it[395:907] *** Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES'
*** First throw call stack:
(0x3978d3e7 0x387e6963 0x3978d307 0x33005857 0x331a9f21 0x33089cdd 0x33088f6b 0x39790ad4 0x396e828f 0x331a70f3 0x352b2e01 0x32575793 0x325755db 0x32578e45 0x397611b1 0x396d423d 0x396d40c9 0x3983033b 0x32ff1291 0xdf2d9 0x4c410)
libc++abi.dylib: terminate called throwing an exception
(lldb) 

Found this link from Stackoverflow.com which describes something similar to what I am experiencing, which only happens to iOS 6 Game Center for Apps only supporting Landscape display.  Delete the app and download from App Store again and test with Game Center logged in, and it works without problem. Problem identified!

Urh, hang on, I thought I fixed the problem in previous release already??!! Further investigation shows I missed something in my last release. And as my 3GS always has Game Center logged in, that's why it wasn't picked up during pre-release testing, damn! Definitely have to add this testing next time.

The fix is easy, before, the setup looks like this:

Just need to click on the 2 "Portrait" and "Upside Down" icons in "Supported Interface Orientations" and that fixed the problem. The setup now looks like this:


Issue fixed. Lucky the App Store still available before 20th December, hope there's not too many apps waiting for review and can still get reviewed before Christmas with the normal 7-8 days waiting time, fingers crossed...
 

Thursday, 29 November 2012

iPhone 5 activated, stuck with new Bluetooth problem

As I mentioned in this post I received my new iPhone 5 a few days ago, but can't use it at all because I haven't receive my new SIM card yet.

Sick of waiting, as a quick workaround, I borrowed colleague's SIM at work today and finally got it activated. Yeah! Issue resolved!

Then tried to pair with my 3GS (running iOS 6.0(10A403)) to share the connection using Bluetooth through Personal Hotspot and it doesn't work!! WTF!!

Searched the net and can see lots of people complaining about Bluetooth problem on discussions.apple.com.....Damn, this is so annoying....

On 2nd thought, I then tried a few different tests:

First, tried to pair my new iPhone 5 to colleague's iPhone 5, both on iOS 6.0 (10A405), but both can't see each other at all. Urh? Why is it like that?

Next, tried to pair my new iPhone 5 to another colleague's iPhone 4s on iOS 5.1.1 (9B206) which was jail-broken.... again, both can't see each other.

Then, tried on my MacBook Pro (OS X 10.7.5), found that I can actually see all 4 devices - old 3GS, my new iPhone 5, colleague's iPhone 5, and the other jail-borken iPhone 4s.

Very strange, does this mean all the iPhones are not suppose to pair/connect with each other, but it's allowed with MacBook Pro??!!

I am confused.

Noticed there's a new iOS 6.0.1 update available, will give that a try on the new iPhone 5 and see if that makes any difference...

[Update 10/Dec/2012]
Upgraded to iOS 6.0.1 doesn't make any difference.
Now that I got my new SIM, found that with Personal Hotspot enabled on iPhone 5, still can't connect from the 3GS using Bluetooth.

However found that in iPhone 5 Personal Hotspot, there's this "Wi-Fi Password" setting for you to connect using Wi-Fi, and found that works ok. So I am now using this to connect my 3GS to iPhone 5, finally got something that's working...

Saturday, 24 November 2012

Multi-level Template display issue in iOS 6 fixed

Thanks to Nick Wilson who pointed out that my Cocos2d Multi-page template doesn't display properly in iOS 6.

As shown below, when loaded in iOS6 it always displays in Portrait mode, and gets quite messy.


Did some research and got it working by making 2 small changes:


1) in "AppDelegate.m", inside "applicationDidFinishLaunching", insert the line highlighted in red as shown below, before "[window makeKeyAndVisible]"

// make the View Controller a child of the main window
[window addSubviewviewController.view];
window.rootViewController = viewController;
    
[window makeKeyAndVisible];

2) then in "RootViewController.m" add a new method anywhere as below:

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskLandscape;
}


That's it. Let me know if this works for you or if you have any other problems.

Cheers.

[Update 25/11/2012]
Nick also pointed out, the other extra thing to change would be to add an iPhone 5 background image.

I have included all these and uploaded V1.02 as below, links in original post also updated. Special thanks to Nick for all the info, let me know if any one else got other excellent ideas to add.

Code: Multi-level template V1.02
Image: Image Files V1.02


// Ver 1.00 - 28/09/2012 First version
// Ver 1.01 - 24/11/2012 Fixed iOS 6 orientation issue
// Ver 1.02 - 25/11/2012 Add background image for iPhone 5 (1136x640), add version number display on Main Menu


Received my new toy

Received my new toy today - white 16GB unlocked iPhone 5, yeah! Really excited and took a few photos:

Haven't receive the SIM card yet, have to wait at least a few more days, at first I thought can just connect to my old 3GS through bluetooth through Personal Hotspot.


I was wrong! Tried both WIFI and iTune, both said I need to insert a SIM card before I can activate the phone. After that, then I can connect to another phone through bluetooth.... What the $#@!#%.... What a torture.... Apple, I hate you!

Thursday, 1 November 2012

You now need to submit 3 sets of screenshot!

Tried to submit an update the other day, and strangely as below, got this "Missing Screenshot" as shown below.
At the details view a slightly more helpful popup message was shown.


It took me a while to find the problem. As shown below, the middle part, we now have a new section for "iPhone 5 and iPod touch (5th ten) Screenshots". The only difference is the new screen size compared to previous version of iPhone/iPod.

Too lazy to design new ones, so I just use Inkscape to increase the width of the existing iPhone/iPod ones a bit, submit the new screenshots, and that fixed the problem. So for those who hasn't or is going to submit new app or updates, make sure you have 3 sets of screenshots ready!

Saturday, 27 October 2012

Lesson learned about reducing PNG file size

Did my first submission attempt the other day after putting some new images and fixes for the iOS6 + new iPhone 5 screen size fix. But received this email saying the binary size exceeds the download limit email as below.

Definitely don't want my users to have this trouble, so I started looking around for ways to shrink/reduce some of the huge background image file size.

At first found a site (ca't find it any more?) which offers free service, just need to upload the image and it will shrink it for you. Tried a few and seems quite good, so I happily processed all the huge .PNG files. But when I tried to build the app, as below it failed with all these "CopyPNGFile" error, WTF??!!

Further research shows that site probably didn't shrink but rather convert it to ".JPG" file format but still keep the same ".PNG" file name??!!

That was very disappointing as it wasted my time!

Later found this site talking about using PhotoShop to "Posterize" the images. This time was a bit more careful, only did a few, confirmed it won't cause any of those "CopyPNGFile" error, then continue with the rest....

It was a pain, but at least I learned the lesson about how "NOT" to reduce your image file size!

Wednesday, 3 October 2012

May be it's not that difficult to get an iPhone 5?

I read quite a few not-so-nice news about iPhone 5 recently (e.g. see here, here, and over heating and battery issue) and was a bit reluctant to order one delivered as it would be hard to argue/explain if it's been delivered and found any problem (plus the hassle of bringing it to a shop to swap), vs opening it from box inside an Apple store. Was also struggling if should wait for "iPhone 5 version 1.01", as first version of most new IT products were always full of bugs (rushed to meet deadline?)...

Walked past the Sydney Apple city store last Friday and was told they are out of stock and need to make a reservation between 7am and 3pm on this special link, and will receive a response before 9pm if stock is available in the shop I selected.

I tried once yesterday around 1pm, of course, nothing received. Then tried again around 8am this morning, and I got this email around 8:54pm! Wow, I thought there was a stock shortage of iPhone 5 and everyone has to wait until end of October or something like that??

Actually I never expect to get it straight away and tomorrow morning I might not even be able to make it due to other commitments at work... I have cancelled my reservation, and my apology to those who reserved today but didn't get it because of my "test" reservation, please try again tomorrow :-)...

So despite all the news and marketing hype, looks like it's not that difficult to get an iPhone 5 - only a few weeks after it's announcement - at least in Sydney?

Still working on changing my 2 games for iOS6 and iPhone 5, seriously, base on all these, I might just wait for iPhone 5 version 1.01...

Thursday, 27 September 2012

An excellent site with loads of tutorials by Tim Roadley

Found this site by Tim Roadley with lots of tutorials and other very helpful information. He even has a game templates containing level selection similar to my Multiple Level Template, and I quite like his way of saving data to XML file for data persistence, might add that to my code soon.

Highly recommended!

Wednesday, 26 September 2012

Another issue with Appirater [with workaround]

Tried Appirater with my other game "Mespfi", which is a pure Cocoa game. Strangely as shown below, all the values stored in Localized.strings wouldn't load properly, only the key name been displayed instead.


First thought was Xcode 4.5 issue or not setup Localization properly after migrated to XCode 4.5, or the Localized.strings file problem. Tried lots of debug logging but still couldn't work out why. Then slowly back-out all the changes one by one, and found that when I disabled Appirater completely (remove the "#import "Appirater.h"" line in AppDelegate.m) then it starts working! What the...

Still not quite sure what's wrong, I then tried moving content from one of the Appirater Localized.strings file to mine and then delete it from Appirater, and it works! Looks like some sort of conflict betweens the new Localized.strings files from Appirater with my existing ones? I deleted all those extra language files which my App doesn't support, and merge the rest into mine, and all works ok after that...

Tuesday, 25 September 2012

Localisation in XCode 4.5 drives me crazy [Fixed]

Don't know why, after upgraded to XCode 4.5, testing localisation becomes a nightmare...

First I was stuck due to can't find the plus/minus buttons, finally found that it's been relocated after XCode 4.4, as I was on Xcode 4.3.3 before the upgrade, so wasn't aware about this.

Then found that if I change the language in simulator to Spanish, when it runs it's still in English. Deleted app from simulator, clean and re-run again, it works, then tried again, back to English again. Similar problem happens with the other languages too... I start wondering is adding multiple language support really worth the effort as I felt getting crazy after all these confusing, almost random test results...

Luckily, I found this work around by "VictorT". Listed below for your reference. I think it's adding extra step to copy the localizable.strings file over and to be honest don't really understand why, but most importantly - this fixed my problem!

  1. Remove application from device
  2. Select root node of project tree to get project's properties
  3. Select "Build Phases" tab
  4. Click "Add build phase" and select "Copy files"
  5. Select "Resources" in "Copy files" view
  6. Add Localizable.strings file
  7. Perform "Clean" for the project
  8. "Build and Run"

Issue with Appirater [With workaround]

I was adding Appirater to my game, however found a problem.

It works perfectly with iPad, as shown below:

However, when it's in iPhone, probably due to it's running in Landscape mode, there wasn't sufficient space to fit in both the title plus the message, therefore the message got cut-off...

I tried shorten the message, but then it would be very confusing. After some research, I found this post by Himanshu Sharma about how to change the font size, which is the most simplest solution for me. There are also others talking about creating fully customised alert view, but I think that's a bit too much for me. I just need a simple workaround to fit in my messages.

After a few adjustments, I shorten the message a bit, adjusted the font size to be smaller, remove the message body (use message as title), and got it sort of working as below. For iPad, I just leave it as it is.


If you look at the screen dump on Appirater site, you will see that it's in Portrait mode, that's why it can display the full message on iPhone.

If your game is in Landscape like mine, hope you find this work-around helpful!

Please let me know if there's any better way to fix this issue, as I really want the whole message title and body to be properly displayed in both iPad and iPhone without any workaround if possible.

Problem with TPG??

Tried to logon to my blog from home ADSL2 network, strangely Safari shows a blank screen and hung for a long time. Tried FireFox and this is what I got:

"Server not found" error for the top half, then a huge blue strip, then part of my last post at the bottom. What the??!!

Tried on my iPhone, and it loads up straight away!? Very strange.

I unplugged the network cable, use my iPhone's personal hotspot and everything works!

Must be problem with my ISP TPG and found all sites related to "xxx.blogspot.com" have the same problem. My iPhone uses Telstra network and has no issue browsing all sites. Looks like have to use my iPhone's "more expensive and slow" connection for tonight until issue resolved...

Lucky I have a backup, otherwise would be stuffed.

Saturday, 22 September 2012

iPhone 3GS ARMv7 issue with XCode 4.5 fixed!

A not-so-happy start
At first I was a bit depressed today, as both my apps failed to compile in Xcode 4.5, plus from yesterday's bad experience - Xcode 4.5 won't generate the ARMv6 code to run on my old 3GS, then found old Xcode 4.3.3 disappeared, only have much older 4.2 left, looks like I might need to keep 2 versions of code !!??

What a mess...

Quickly worked out an action plan - I am going to uninstall Xcode 4.5, install Xcode 4.3 (or 4.4), then install Xcode 4.5 on a different folder - hope that they can co-exist. So that at least I can have the latest 4.3 or 4.4 to test the app on my 3GS, and then test on iOS 6/iPhone 5 (4 inch retina) simulator using Xcode 4.5. That's the best work around I can think of - until I got a replacing device (iPhone 5?) to test with... Hopefully very soon...

New discovery
Then while looking for further details about that ARMv7 error, I saw "PSA: Do not release ARMv7s code until you have tested it" from "Wandering Coder" talking about:

...when ARMv7 was introduced with the iPhone 3GS, ARMv6 kept being the default and there was an added “optimized” setting that built for but ARMv6 and ARMv7 if you wanted it...

Wait, what? ARMv7 was introduced with iPhone 3GS! So it's "iPhone 3G" that doesn't support ARMv7, my iPhone 3GS should be able to run ARMv7 code! But then why did Xcode 4.5 refuse to do it and complaints about ARMv7??

Further investigation...
Have a closer look at the error message again:


ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/qq/Documents/iOS.Dev.Projects/Where is it ?/Buzz.a for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Also read that article the second time, slowly. So it's actually complaining about "ARMv7s", not "ARMv7". And looks like "ARMv7" and "ARMv7s" (in the error message) are actually 2 different things!

Problem fixed
Following the article, I checked the "Architectures" values under "Build Settings", and as below, it says "Standard (armv7, armv7s)".



If I double click to modify the value, as shown below, it changed to "$(ARCHS_STANDARD_32_BIT)", no idea what does that mean...

I captured a screen dump as backup, removed the value and added new one "armv7" without the "s", and it works! Xcode 4.5 can now compile my app and install it on my 3GS successfully, yeah!

Huston, we got another problem...
The app starts up on the phone without problem, the splash page loaded, and then it crashed! WTF ##@$$%^&*(!!!...

Error message as below:


2012-09-21 17:32:07.425 Where is it[747:907] *** Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES'
*** First throw call stack:
(0x359c52a3 0x3a3db97f 0x359c51c5 0x343d9897 0x3457e579 0x3445dd45 0x3445cfcf 0x359c89c4 0x3591ffeb 0x3457b733 0x3a7fbd2d 0x316c211f 0x316c14b7 0x316c2dcb 0x35998f3b 0x3590bebd 0x3590bd49 0x358392eb 0x343c5301 0xc0481 0x2d588)
libc++abi.dylib: terminate called throwing an exception 


Spent a lot of time adding different debug/logging but still couldn't workout what's wrong. Then googled the last line "libc++abi.dylib", also couldn't find anything related....

I almost gave up.... Then tried googling the "UIApplicationInvalidInterfaceOrientation" and found a work around!!

Problem #2 also fixed!
I followed the instructions:
1) enable all orientations in project summary
2) as my project uses Cocos2D, and don't have that "application:supportedInterfaceOrientationsForWindow", so nothing to remove
3) Add the extra code below in the RootViewController.m

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskLandscape;
}

And it works! Yeah!

I guess I still have to switch back to "ARMv7s" and my old 3GS has to be replaced sooner and later any way, but at least I can hang on to it for a little longer while fixing both my apps for iOS6/iPhone 5!!

And I understand that once I switched to "ARMv7s" all the third party libraries has to be in "ARMv7s" too! Don't want to think about that now, already got lots of things to worry about that....

At least one major issue resolved, what a relieve...

[Update 22/Sep/2012]
You can find some other helpful info in Hacking up an armv7s library by Matt Galloway

Thursday, 20 September 2012

First day with XCode 4.5

Upgraded my iPhone 3GS to iOS 6 and quite happy to see the "Personal Hotspot sharing through USB not working" issue fixed.

However, after I downloaded Xcode 4.5 and tried to compile my 2 games, both failed... Still working on resolving the issues at the moment.

First it automatically asked to add this new launch image called "Default-568h@2x.png" - which is a really strange name. And it's an empty, black 640 x 1136 image.


Then there's lots of warnings about Cocos2D 1.0 library - as it still compiles, I just ignore it for now.

When runs in simulator, for "Where is it Smart Kids Edition" which is landscape, it shows 2 ugly black bars on both side.

While for "Mespfi", which is portrait, the ugly bars are now on the top and bottom...

I wasn't too worry about that as this just means some image adjustment plus UI changes.

However when I tried to run both apps on the physical device, both failed with similar error as below, one for Nextpeer and one for Buzzdoes.


ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/xxxxxxxxxxx/Buzz.a for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)

ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/xxxxxxxxxx/Nextpeer.framework/Nextpeer for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)



Thanks to Daniel/Nextpeer, looks like it's because Xcode 4.5 no longer supports the older arm v6 architecture on my old 3GS. I might have to maintain 2 versions of code - one for arm v6 and one for arm v7. But then when I searched through my MacBook Pro, found that the previous version Xcode 4.3.3 no longer existed and can only find Xcode 4.2!  Xcode 4.5 must have overwritten 4.3.3, what the....

Still wondering whether should I get a new iPhone 5, or just get the latest iPod and save the money for an Android phone. As I am a bit unhappy about the way Apple ignoring older devices and upgrading so frequently/quickly, felt a bit unsecured to invest all the effort and get locked into one single platform which changes so quickly... Oops, this reminds me about the Unity thing which I haven't touch for a week or now... I wish I can have more time doing all these development work.

[Update 24/Sep/2012]
Issue with "armv7s" error fixed by changing it to "armv7" and it runs on my iPhone 3GS without problem. For further details, please see this post. Thanks.



Sunday, 16 September 2012

GMail issue with iPhone built-in Mail app fixed

Spent some time testing different GMail settings, even installed this App called "Google Authenticator" to scan a QR Code (which is quite cool) - but this doesn't help at all. In the end it's this thing called "Application Specific Password" that fixed the problem.

Ok, if you provided your mobile number to GMail, you will have this security function called "2-step verification" enabled. Let me know if you got better idea, but so far the only way I can get GMail working with the iPhone built-in Mail app is by "Application Specific Password".

Any way, one annoying issue resolved... Move on to the next one...

Friday, 14 September 2012

Just have to wait a few more days...

iOS 6 and XCode 4.5 would be available soon. Only thing that troubles me is how to change my app to cater for another new resolution (1136 x 640) for the new iPhone 5. Did some research and all I could see is this new file called "Default-568h@2x.png" in mentioned in a few pages.

There's even some sites (eg. this one) which posted a few screens about the new XCode 4.5 with "iPhone (Retina 4-inch)" simulator. Gee, I thought you are not suppose to do that??!!

Don't have the time to play with the GM build, so would have to wait for it's official release then... Hope it  won't be that difficult.... fingers crossed...

Seriously GoDaddy, you call that an apology email?

Received an email with the subject line saying "Please accept our apology and your enclosed offer" from GoDaddy and before reading it I thought they will be waiving some fee for 12 months or something like that to compensate all the trouble they have caused. Instead, as shown below, they ridiculously asking for more business, only offer 30% discount? and it's only available for the next 7 days??!! You got to be kidding me...


Thursday, 13 September 2012

Never save sensitive information to NSUserDefaults

Just read something important from this "Basic Security in iOS 5" article on Ray Wenderlich's site that:

never save sensitive information to NSUserDefaults – these values are stored in PLAIN TEXT (i.e. just like this blog post) for all to see (and is also saved inside of your application bundle). Be mindful of what you put in there.

Which is quite interesting as I never know it's stored in plain text and also saved inside application bundle.

Applications are expected to have a root view controller at the end of application launch

Was testing the example game that comes with Nextpeer, and found this line in the log:


2012-09-11 23:24:19.571 ExampleGame[9101:15b03] cocos2d: Frame interval: 1
2012-09-11 23:24:19.573 ExampleGame[9101:15b03] Using Nextpeer version (1.2.10). https://api.nextpeer.com/v2/sdk
2012-09-11 23:24:19.857 ExampleGame[9101:15b03] Applications are expected to have a root view controller at the end of application launch
2012-09-11 23:24:19.857 ExampleGame[9101:15b03] cocos2d: surface size: 320x480
2012-09-11 23:24:22.441 ExampleGame[9101:15b03] cocos2d: Frame interval: 15
2012-09-11 23:24:29.960 ExampleGame[9101:15b03] cocos2d: Frame interval: 1


As I never seen this before, asked Daniel/Nextpeer and he confirmed it's not related to Nextpeer, but rather "has to do with how Cocos2D manages the UIWindow and root view controller objects for game. Nothing too serious :)"

Just not sure is Cocos2D trying to tell us something is not right? Compared to my other code, it seems it's because there's no RootViewController been used in the AppDelegate that's causing this to happen. As the app still works perfectly - which proves that Cocos2D can run without a RootViewController, so we probably can ignore that.

OpenGL error 0x0506 in -[EAGLView swapBuffers]

While integrating buzzdoes to my "Where is it Smart Kid edition" game, I found that if I trigger buzzdoes using the popup (when the app first loaded, not the button on the main menu), it will hung when I exit buzzdoes and return to game. Can see tones of error as below:


2012-09-12 23:53:24.717 Where is it[21084:707] failed to call context
2012-09-12 23:53:24.723 Where is it[21084:707] cocos2d: surface size: 480x320
2012-09-12 23:53:24.726 Where is it[21084:707] Failed to make complete framebuffer object 8cdd
OpenGL error 0x0506 in -[EAGLView swapBuffers]
OpenGL error 0x0506 in -[EAGLView swapBuffers]
OpenGL error 0x0506 in -[EAGLView swapBuffers]
OpenGL error 0x0506 in -[EAGLView swapBuffers]
OpenGL error 0x0506 in -[EAGLView swapBuffers]
OpenGL error 0x0506 in -[EAGLView swapBuffers]
OpenGL error 0x0506 in -[EAGLView swapBuffers]
OpenGL error 0x0506 in -[EAGLView swapBuffers]
OpenGL error 0x0506 in -[EAGLView swapBuffers]
OpenGL error 0x0506 in -[EAGLView swapBuffers]
OpenGL error 0x0506 in -[EAGLView swapBuffers]
.......


The strange thing is, it works without problem in simulator. It only hung and show this error message in the log when I test on the iPhone 3GS (iOS5.1.1) device. Found quite a few people on the net also had the same issue.

If I test it on the iPad 2 (iOS5.0.1) device, it also hung, but didn't show anything in the log...

Sent all these info to Arthur/buzzdoes, see if they can work out what's wrong...

The Cocos2D version I am using is 1.0.1 as shown below from "cocos2d.h"

// 0x00 HI ME LO
// 00   01 00 01


#define COCOS2D_VERSION 0x00010001


According to this old page, "0x0506 means: INVALID_FRAMEBUFFER_OPERATION_EXT" Urh.....What is that?

Continue researching....

[Update 16/Sep/2012]
Thanks to help rfom Arthur and Elad from buzzdoes, they released a fix and after a few test, the issue has been resolved. Though still don't know much about that OpenGL error, at least the whole thing is working ok now.

I could have submitted the current version to App Store as Arthur suggested, but I really want to wait 1-2 more weeks to get the app working and tested for iOS 6 and iPhone 5, at least in the simulator, as I am still waiting for the local telcos to release plans for iPhone 5.

Will do another few more days of testing, if all goes well, I might even integrate buzzdoes to my second game Mespfi too!

Wednesday, 12 September 2012

No Apple allowed?

Everyone must  be anxiously waiting for the new iPhone announcement like me. Was thinking of staying up for the news, but a quick Google shows 10 am Wednesday in San Francisco will be around 3 am Thursday Sydney time - still have to go to work tomorrow, so probably have to wait until tomorrow morning then....:-(

Ok, what's this "No Apple allowed?" thing I mentioned in the title, you might ask. Well, it's just that I recall seeing this sign a few weeks back:

If you compare it to the old Apple logo shown below, I think it's around 95% similar if you remove the circle and line. Don't you agree?


So, a sign saying "No Apple products allowed?" Well, technically, there's no clear explanation about what it is banning, but if I show you the whole thing you will get the idea. It's like this:

Yes, I guess it probably means "no food allowed" as it's next to the more-easy-to-understand "no smoking" sign. But why do they use the Apple logo??!! 

Where is this place? It's the Hyde Park Barracks Museum in Sydney...

View Larger Map

Hope this gives you a small laugh while waiting for the new iPhone announcement.... And hope Apple won't sue the museum and ask them to change the sign!!??!!

Monday, 10 September 2012

Adding buzzdoes to my app

I tried adding buzzdoes to my Where is it - Smart Kids Edition today, it was quite easy and straight forward. To be honest, I actually spent more time on fixing the icon then the actual integration work...

First, you create an account and logon to their developer site, then click the "Add new iOS application" icon. You then have to download the SDK, and follow the instruction to setup your app.

The screen below shows the Apps screen, the 3 floating buttons were quite fancy. Please note that this is after I finished adding and configured my app, the "Application Name" will be different at the beginning before you configure it. You have to click on it, do some configuration (shown later) before it reads the settings and correctly shows your application name and icon.


Found 1st problem - not sure if it's because I am using the lowest "free" account, noticed I can't add another/second iOS/Android application after 1st one done? Nothing happened when I tried to click on those 3 icons.

[Update 11/Sep/2012]
The problem mentioned above seems to have been fixed somehow. I found a few problems during testing today (currently waiting for response from buzzdoes) and while doing other tests, found the button works now. As below, I just added another new iOS app, the name is "Test app for iOS", and a new App Key was provided automatically.


The configuration steps are quite straight forward too, just 3 steps as shown below. I got stuck at the first one for a while, as at first I thought it's asking for the "Bundle identifier", it's actually the "App ID" which is a long number. Adding a simple user-friendly help message (or example) would be helpful.



In fact, I didn't do these 3 steps configuration until I got all the code changes done and tested ok. Probably only need to do this if your app already published in the App Store.

For the actual integration part, as I mentioned above, most of time is playing around with the button image. As shown below, they only provide 2 sizes: 40x40 and 80x80, plus a vector file in ".ps" format which my Inkscape couldn't recognise. None of these meets my size (mine for iPhone: 96x96, for iPad 168x168), so have to manually increase the size. Plus, to create the effect of "been clicked", Cocos2D allows 2 images - normal and clicked for each button, so I have to add a semi-transparent, semi-cricle shape image on top to make it look consistent to existing ones.

The coding part is easy, just add the files and following the instruction. Except the provided info is for pure Cocoa code, as in Cocos2D the start up function is different (in applicationDidFinishLaunching of AppDelegate). But shouldn't be too difficult for you to work that out. And I am just replacing the email button, so there's not too much code change required for my app.

The screen below shows the only 4 files you need to add to your project. I created a group/folder to avoid confusion.


You then add 2 lines of code: 1st one to activate it at load time, 2nd one when you need it to popup. As below, when the app starts, it shows this nice looking screen encouraging your users to spread the word and get reward, quite nice!


Screen below shows what it looks like before and after the change on iPhone. Only if they can provide icons with different background colours.

The following from iPad 2, tested when internet connection is not available. A better looking graphic/image popup would be lovely.


This is the screen when it first started, I quite like the design.


As usual, you have to approve the terms of use first as the app will be reading your address book, Facebook contact, import gmail contact, ...etc. Urh... where is the "Yes" button? Should be "Accept"... Sorry, this is quite minor, I am just fussy...



 A few other screens shown below, you can login to either facebook or Gmail from here too and it will import all the contacts, quite cool!





I only tested the Gmail part, after you selected those people you like to spam, sorry I mean "Spread", it will create an email. I then noticed there are 3 recipients even though I only selected 2 contacts. Oh, found the reason why, it added an extra one call "spreads@buzzdoes.com".

As my mail app on iPhone doesn't work (see my other post for details), I tried it on my iPad, received the email and it works quite well.

The overall experience with buzzdoes integration is quite clean and quick, I think you should have a try in your app too!

Now that I got my apps updated, ready for submission to App Store! Let's see if this can double, triple or quad-triple my download rate... fingers crossed...

[Update 10/Sep/2012]
Found another issue, I was testing the display of different languages and noticed the buzzdoes screen didn't pop up at all, strange? Then noticed the following message in the log:

2012-09-10 16:57:41.547 Where is it[746:27007] buzzdoes is blocked for the chosen locale. Locales other than english are not available in the free plan.

So looks like if your app supports multiple languages, you have to either upgrade from the free plan, or disable it if it's not English!

[Update 12/Sep/2012]
Found another slight issue with buzzdoes on iPhone (doesn't happen in iPad), when the buzzdoes screen get triggered, it occupies the whole screen, and it rotates automatically if users rotate/tilt the phone to the side - which is not quite suitable for games mainly in specific mode (mine is Landscape). According to Arther/buzzdoes, you can manually set the orientation as below.

To set manually the orientation please use the following code:
[BuzzDoes BuzzSharedInstance].supportsPortraitOrientation=NO;

The optional properties are:
supportsLandscapeLeftOrientation
supportsLandscapeRightOrientation
supportsPortraitOrientation
supportsPortraitUpsideDownOrientation
Default value is YES.


 

Problem after added mobile to my GMail account

Can't remember when it started, when accessed from browser, Gmail keep popping up this extra screen asking me to add my mobile number for security reason after logged on. And even if you tried to skip it, it then shows you another annoying confirmation. What the %#$%^$&%^^$#$#.......


Until recently, I finally gave in and added my mobile. Seems ok at the beginning, just that if I logged in to a different machine, it will send me an SMS with verification code and I have to entered the received code to login. Well, it's for security, so can't complaint too much.

Then I found a major issue, yes, big one.

I have been using the iPhone buit-in Mail app to access my GMail from ages ago since I first got my phone. Yes, 3GS is very old now, hey, everyone is holding off their upgrade waiting for the latest iPhone 5 right?? Me too!

Any way, I found that since I added mobile number to GMail, my Mail app stopped working! It keeps telling me "The user name of password for Gmail in incorrect". I know my password and user name are correct as I can successfully logon from safari on the same iPhone!

You might say, well, just use safari or install Gmail app to read your mail then. Well, that only fixes part of the problem. Don't forget that the built-in Mail app is the default mail client on iPhone. If you are in an app with mail capability (e.g. Safari, ...etc) and want to send something to someone, the mail client that pops up is the Mail app - which is now no longer working! Or, please let me know if anyone knows how to change the "default" mail client on iPhone to "Gmail" app.....

Also, as shown below, when I first logon to the Gmail app, it also asked me to enter verification code sent by SMS.

So I start wondering, is it because after I logged on to the Mail app, it doesn't have the capability of processing that verification code thing and therefore failed the login process??!!

Mystery.... Any one got better idea or know how to fix it, please let me know! Thanks!

[Update 16/Sep/2012]
The official name of this security feature is called "2-step verification". And I fixed it, please see this post for further information.