Copy link to clipboard
Copied
Hello.
I'm using Flash Builder 4.5 to experiment with building a mobile app for my Android Nexus One. In order to keep the app in landscape mode, regardless of the orientation of the device, I've read that I need to set the following in the "AppName-app.xml" file:
<aspectRatio>landscape</aspectRatio>
<autoOrients>false</autoOrients>
And this does work fine in the debugger, however when I attempt to test it on my connected device it throws this error:
Error occurred while packaging the application:
D:\Projects\FlexMobile\AppName\bin-debug\AppName-app.xml(108): error 103: application.initialWindow.autoOrients is an unexpected element/attribute
I know that I'm able to build and test apps on my device, as I've been through the Flex Test Drive for Mobile tutorial (http://www.adobe.com/devnet/flex/testdrivemobile.html) and was able to build and run that app with no issues and this app I'm currently working on does run on the device if I do not attempt to restrict the auto orientation.
Thank you.
I have the same problem with FB 4.5. App builds and runs fine, but if I have the <autoOrients> tag it does not build.
Something is broken, or else the tag got migrated in AIR 2.6?
Is there a way to set this at runtime instead?
edit: yes there is: Stage.autoOrients and Stage.deviceOrientation
edit 2: which did not work for me (yet) with Flex 4.
final update: <autoOrients>false</autoOrients> works just fine! The problem was that I had it twice in my -app.xml file.
Copy link to clipboard
Copied
I have the same problem with FB 4.5. App builds and runs fine, but if I have the <autoOrients> tag it does not build.
Something is broken, or else the tag got migrated in AIR 2.6?
Is there a way to set this at runtime instead?
edit: yes there is: Stage.autoOrients and Stage.deviceOrientation
edit 2: which did not work for me (yet) with Flex 4.
final update: <autoOrients>false</autoOrients> works just fine! The problem was that I had it twice in my -app.xml file.
Copy link to clipboard
Copied
Ah, I see!
The <autoOrients> node (along with several others) occours twice in the generated -app.xml file. Do not un-comment the first instance, instead edit the parameters set in the second already un-commented autoOrients node.
This fixed the error in my application as well.
Thank you rblaa.