I am including Default.png, Default-Landscape.png and Default-LanscapeRight.png
When I launch my application ( which only runs in landscape mode ) .. the correct splash screen shows for a split second .. then it switches to show it stretched and portrait.
What is causing this ?
I double checked my files to make sure, and what you said isn't quite right. For a landscape only app you would need Default.png, 320x480, the landscape design on its side, 640x960, same again only twice the size. So far that's what you said, but the actual Default-Landscape.png for the iPad would be 1024x768, the landscape design the correct way up.
I'm using Default-Landscape 1024x768 and Flash Professional CS5.5 for publishing. I publishec couple of apps before and never had those problems it appeared lately (maybe I messed something up with AIR sdk?). It also works fine on another PC with exactly the same project files - so I believe it's not about Default-Landscape.png size or orientation.
Ok I investigated it a bit more and it looks like the problem is in adobe AIR SDK 3.1.
I downloaded 3.0 version from here:
http://airdownload.adobe.com/air/win/download/3.0/AdobeAIRSDK.zip
and 3.1 from here:
http://airdownload.adobe.com/air/win/download/3.1/AdobeAIRSDK.zip
and used adt from version 3.1 and 3.0 to publish app using commands:
SDK31/bin/adt -package -target ipa-test-interpreter -storetype pkcs12 -keystore YOUR_CERT.p12 -provisioning-profile YOUR_DEV_PROVISIONING.mobileprovision APPNAME.ipa APPNAME-app.xml APPNAME.swf Default-Landscape.png
SDK30/bin/adt -package -target ipa-test-interpreter -storetype pkcs12 -keystore YOUR_CERT.p12 -provisioning-profile YOUR_DEV_PROVISIONING.mobileprovision APPNAME.ipa APPNAME-app.xml APPNAME.swf Default-Landscape.png
version published using 3.0 works just fine, and the one using 3.1 makes splash screen rotates for a split second.
Maybe it's a problem just when publishing to debug I'm not sure but it looks like AIR 3.1 SDK bug.
I investigated it a bit more because I had to use AIR 3.1
if you're usig AIR SDK 3.1 you can set "Aspect ratio" in AIR for iOS settings panel to "Auto" (instead of for example landscape) then you have to attach both default images for landscape and portrait mode.
this walkaround worked for me, but I hope Adobe will fix it in AIR 3.2
I have exactly the same problem with AIR 3.1. I have a game that I need to lock in landscape view, but the splash screen flicker to portrait/stretched is a showstopper experience issue. I am using a couple native extensions. Here's my app.xml, with some names changed and comments removed...
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<application xmlns="http://ns.adobe.com/air/application/3.1">
<id>com.jdconley.mygame</id>
<filename>MyGame</filename>
<name>MyGame</name>
<versionNumber>1.0.0</versionNumber>
<initialWindow>
<content>[This value will be overwritten by Flash Builder in the output app.xml]</content>
<title>My Game</title>
<systemChrome>none</systemChrome>
<transparent>false</transparent>
<visible>true</visible>
<minimizable>false</minimizable>
<maximizable>false</maximizable>
<resizable>false</resizable>
<aspectRatio>landscape</aspectRatio>
<autoOrients>false</autoOrients>
<fullScreen>true</fullScreen>
<renderMode>cpu</renderMode>
<softKeyboardBehavior>pan</softKeyboardBehavior>
</initialWindow>
<icon>
<image29x29>29x29_Icon_2.png</image29x29>
<image48x48>48x48_Icon_2.png</image48x48>
<image57x57>57x57_Icon_2.png</image57x57>
<image72x72>72x72_Icon_2.png</image72x72>
<image114x114>114x114_Icon_2.png</image114x114>
</icon>
<iPhone>
<InfoAdditions><![CDATA[
<key>UIDeviceFamily</key>
<array>
<string>1</string>
<string>2</string>
</array>
<key>UIApplicationExitsOnSuspend</key>
<true/>
<key>UIRequiresPersistentWiFi</key>
<true/>
<key>SBUsesNetwork</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>wifi</string>
</array>
]]></InfoAdditions>
<requestedDisplayResolution>high</requestedDisplayResolution>
</iPhone>
<extensions>
<extensionID>com.adobe.appPurchase</extensionID>
<extensionID>com.jdconley.myextensions</extensionID>
</extensions>
</application>
The autoOrients=false setting was for experimentation. I was changing everything that looked like it might have an effect. Regardless of the setting for autoOrients it flashes to a distorted portrait view for a moment before calling the constructor on our Application if you have the initial aspectRatio set to landscape in the XML and start the device physically in either right or left landscape orientation.
This is a universal build. I have:
Default.png
Default@2x.png
Default-Portrait.png
Default-Landscape.png
I figured out how to work around the problem by leaving out the initial aspectRatio setting in the xml and using stage.setOrientation from code. The two iPhone png's and the Default-Portrait.png are graphically rotated right to simulate landscape mode. I manually call setOrientation to right at launch if the orientation is default or upside down. This causes the orientation change animation, but it's much less ugly than the distorted portrait view image. Further, I prevent the portrait orientations from happening through the typical means of using the StageOrientationEvent.ORIENTATION_CHANGING event and a preventDefault() call.
I woud love to see a configuration for an OR'd list of allowed orientations, and have AIR deal with all this stuff.
I get good clean launches by using autoorients, setting the aspect ratio to landscape, but only include three of those files. The one that I think messes you up is the Default-Portrait one. iOS is picking up on that, and given that you're telling it to be landscape anyway, it doesn't need the portrait one, but it does use it because physically the device may be more portrait at the time. The Default.png is needed, for iPhone and iPod Touch, and the Default@2.png is used by iPhone 4.
I just tried deleting Default-Portrait.png and it had the same bad behavior as before. Are you using the latest AIR 3.1 SDK Colin? As others have mentioned, this problem does not occur in AIR 3.0. I can also assure you that the device is physically in landscape orientation and not moving, as I have a stand that holds it in landscape orientation. It also starts to launch with the correct splash image, then seems to rotate and stretch that image into a portrait view. It looks like it is taking the Default-Landscape.png and stretching it to fit in the portrait dimensions, in DEFAULT orientation. Again, this does NOT happen if I remove the default aspectRatio from the AIR config.
I wish I could set this stuff in the InfoAdditions like a native app... http://help.adobe.com/en_US/air/build/WSfffb011ac560372f7e64a7f12cd2dd 1867-8000.html#WS901d38e593cd1bac6c9d409a12e26b451be-8000
I've used various versions. If it's CS5.5 I'm using, then it would be AIR 3.1.
There's one thing you mentioned that could give a clue. If you did use Default-Portrait on a landscape app, just so that someone holding it in portrait would be encouraged to turn the device, then the image would be 768x1024, and would be your landscape splash screen rotated 90 degrees clockwise. The Default-Landscape image isn't the same, it wants to be the splash screen looking the right way up, and 1024x768.
Yeah, that's a good guess. But the resolutions of the images are correct.
I have narrowed it down to the fact that I'm including the in app purchase native extension. I haven't tried a blank native extension, but I know the in app purchase one doesn't do anything UI related. It must have something to do with the package/init process when there is a native extension packaged with the build.
Here is its ObjC source: http://code.google.com/p/in-app-purchase-air-ios/source/browse/#svn%2F branches%2Fv1%2FNative%2FiOS%2FAppPurchase
And I have posted a Flash Builder 4.6 sample project here that shows how I set it up: https://github.com/jdconley/air-ios-splashdemo
I have been having the exact same problem since I upgraded to AIR 3.1. I've been building using Flash CS5.5 and recently overlayed AIR 3.1. I am NOT using an ANE. I've gone through all the steps wackiejd has.
Interesting! Can you maybe fork my little github project and see if you can get it to reproduce without the ANE? I know that'll help Adobe narrow it down. The only way I could get it to happen was to include the ANE in the iOS build...
Hi Guys ,
This launch image rotation by 90 deg is a known issue and has been fixed for the next release . However , this issue is known only when iOS 5 sdk is used for packaging . This can be used by the following 2 methods :
1) By using -platformsdk switch in the adt packaging command .
2) If Flash Builder is set to use iOS 5 sdk . This can be set in Flash Buider 4.6 by following steps :
Right-click the project
Goto properties -> Under Flex Build Packaging side bar select Apple iOS
In the Native Extensions tag you have an entry for a Apple iOS SDK where you can set the path to the iOS 5 SDK
Are you guys using iOS 5 sdk while packaging by any of the above 2 methods??
2) If Flash Builder is set to use iOS 5 sdk . This can be set in Flash Buider 4.6 by following steps :
Right-click the project
Goto properties -> Under Flex Build Packaging side bar select Apple iOS
In the Native Extensions tag you have an entry for a Apple iOS SDK where you can set the path to the iOS 5 SDK
Are you guys using iOS 5 sdk while packaging by any of the above 2 methods??
Yes, I'm doing this. Is the fix in one of the beta releases?
for me setting aspectRatio to auto and attaching portrait and landscape default image works just fine.
I'm using Flash Professional 5.5, to set aspectRatio to auto in xml you have to remove <aspectRatio>portrait</aspectRatio> or <aspectRatio>landscape</aspectRatio> node from <initialWindow/>.
The other thing is if you want your splash screen to be landscape (like I do) you have to prepare Default-Portrait.png so it's the same image that Default-Landscape.png but rotated 90 deg CCW.
works fine for me.
I hope it helps you
I have the same issue. An app we've been developing for almost a year now has been fine in all previous versions of ADT, and suddenly with 3.1 we get the rotated splash screen issue. We only use a single landscape default image. No ANE files included. Using Flash Pro 5 to compile the swf, but not using the -platformsdk switch for ADT.
@Abhayit Any idea when the next release is due out?
I use FB4.6 with AIR3.1 and I haven't ever experienced this issue. I also was exporting from Flash CS5.5 (before buying FB just to make using ANEs easier) and never experienced this issue.
I've also never had adt compile something entirely correctly for me, which is why I just relegate to FB.
My XML looks as follows, which is very similar, and launches landscape perfectly (AS-only project):
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<application xmlns="http://ns.adobe.com/air/application/3.1">
<id>com.somecompany.SomeApp</id> -->
<filename>SomeApp</filename>
<name>
<text xml:lang="en">Some App</text>
</name>
<versionNumber>1.0.0</versionNumber>
<description>
<text xml:lang="en">My apps description.</text>
</description>
<copyright>Copyright 2012, ME</copyright>
<initialWindow>
<content>[This value will be overwritten by Flash Builder in the output app.xml]</content>
<systemChrome>standard</systemChrome>
<transparent>false</transparent>
<visible>true</visible>
<fullScreen>true</fullScreen>
<aspectRatio>landscape</aspectRatio>
<renderMode>gpu</renderMode>
<autoOrients>true</autoOrients>
</initialWindow>
<icon>
<image29x29>AppIconsForPublish/t29.png</image29x29>
<image57x57>AppIconsForPublish/t57.png</image57x57>
<image114x114>AppIconsForPublish/t114.png</image114x114>
<image512x512>AppIconsForPublish/t512.png</image512x512>
<image48x48>AppIconsForPublish/t48.png</image48x48>
<image72x72>AppIconsForPublish/t72.png</image72x72>
</icon>
<customUpdateUI>false</customUpdateUI>
<allowBrowserInvocation>false</allowBrowserInvocation>
<iPhone>
<InfoAdditions>
<![CDATA[<key>UIFileSharingEnabled</key><true/><key>UIDeviceFamily</key><array><string>2</string></array>]]>
</InfoAdditions>
<requestedDisplayResolution>standard</requestedDisplayResolution>
</iPhone>
<extensions>
<extensionID>ie.jampot.MobileBackup</extensionID>
</extensions>
</application>
All I included was Default-Landscape.png and Default-LandscapeRight.png.
I also included the same image immediately in my class (from a library element) to the screen.
Thanks Abhayjit, this is my XML:
<?xml version="1.0" encoding="utf-8" ?>
<application xmlns="http://ns.adobe.com/air/application/3.1">
<id>[App ID]</id>
<versionNumber>1.2.5</versionNumber>
<filename>[App filename]</filename>
<name><text xml:lang="en">[App name]</text></name>
<description><text xml:lang="en">[App description]</text></description>
<copyright>Pixelthis Limited</copyright>
<initialWindow>
<title>[App name]</title>
<content>[App swf]</content>
<autoOrients>false</autoOrients>
<renderMode>gpu</renderMode>
<fullScreen>true</fullScreen>
<aspectRatio>landscape</aspectRatio>
</initialWindow>
<supportedProfiles>mobileDevice desktop</supportedProfiles>
<iPhone>
<InfoAdditions><![CDATA[
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleBlackOpaque</string>
<key>UIRequiresPersistentWiFi</key>
<false/>
<key>UIApplicationExitsOnSuspend</key>
<true/>
<key>UIPrerenderedIcon</key>
<false/>
<key>UIDeviceFamily</key>
<array>
<string>2</string>
</array>
]]></InfoAdditions>
<requestedDisplayResolution>standard</requestedDisplayResolution>
</iPhone>
<icon>
<image29x29>icons/icon29x29.png</image29x29>
<image48x48>icons/icon48x48.png</image48x48>
<image57x57>icons/icon57x57.png</image57x57>
<image72x72>icons/icon72x72.png</image72x72>
<image114x114>icons/icon114x114.png</image114x114>
<image512x512>icons/icon512x512.png</image512x512>
</icon>
</application>
And this is my ADT command:
adt -package -target ipa-test -storetype pkcs12 -keystore "[path/to/keystore.p12]" -storepass [password] -provisioning-profile "[path/to/.mobileprovision]" app_name.ipa app_name-app.xml app_name.swf icons Default-Landscape~ipad.png
It is mandatory to support DefaultRight landscape. There's a quick snippit to allow you to rotate the device to Landscape or Upside Down Landscape. Without it you'll get punted.
e.g.
import flash.display.StageAlign;
import flash.display.StageOrientation;
import flash.display.StageScaleMode;
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
startOrientation = stage.orientation;
if (startOrientation == StageOrientation.DEFAULT || startOrientation == StageOrientation.UPSIDE_DOWN)
{
stage.setOrientation(StageOrientation.ROTATED_RIGHT);
}
else
{
stage.setOrientation(startOrientation);
}
stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGING, _orientationChangeHandler);
function _orientationChangeHandler(e:StageOrientationEvent):void
{
if (e.afterOrientation == StageOrientation.DEFAULT || e.afterOrientation == StageOrientation.UPSIDE_DOWN)
{
e.preventDefault();
}
}
North America
Europe, Middle East and Africa
Asia Pacific