Update: Troubleshooting “AIR validation failed” message. See below.
Update 3: RIM has announced BlackBerry Tablet OS 1.0.6 with AIR 2.7. The workaround mentioned below is no longer required.
As you might already know, the BlackBerry PlayBook from RIM will initially be shipping with AIR 2.5, not AIR 2.6 (this is to come later in an update to the device). Flex 4.5 SDK requires AIR 2.6 as the minimum supported runtime – this is because of specific feature support (such as soft keyboard) as well as bug fixes/performance improvements. We know however that a lot of you are eager to develop Flex 4.5 applications for BlackBerry Tablet OS, so I’d like to share an unsupported workaround that you can use in the meantime.
I’ve created a playbook_overrides.swc that monkey patches the release build of the Flex 4.5 SDK to remove all AIR 2.6 dependencies. This allows you to publish a Flex 4.5 application that targets AIR 2.5. Here are some instructions to get you started. Again, keep in mind that this is an unsupported hack until (1) AIR 2.6 is available on the PlayBook and (2) Flex and Flash Builder update to 4.5.x in June 2011.
- Flash Builder 4.5
- BlackBerry Tablet SDK and Plugin 1.0.1
- playbook_overrides.zip (Contains playbook_overrides.fxpl, playbook_overrides.swc and TwitterTrendsFinal.fxp example project)
- Create a new Flex Mobile project with BlackBerry Tablet OS as a target platform
- Add playbook_overrides to the library path. This SWC patches SDK and Mobile Theme classes to remove soft keyboard dependencies. Download: playbook_overrides.zip
- Open Project Properties > Flex Compiler
- Add “-swf-version=10″ in “Additional compiler arguments”
- Open Project Properties > Flex Build Packaging > BlackBerry Tablet OS > Advanced tab.
- Add “-forceAirVersion 2.5″
- Run/Debug to device or emulator
- Crash on launch (application briefly appears in launcher, then closes).
Make sure -swf-version=10 is set in additional compiler arguments.
- Blank or stuck on splash screen on launch
Usually indicates a runtime error. Could indicate an AIR 2.6 dependency VerifyError.
- Error dialog when packaging: “error 102: invalid namespace http://ns.adobe.com/air/application/2.6.0 Error: AIR validation failed”
Change the namespace in your /project/src/project-app.xml from “2.6.0” to “2.6”
- Refactor your project into 2 projects to target Android with AIR 2.6 support and BlackBerry Tablet OS with AIR 2.5 support simultaneously
- Use the BlackBerry Tablet SDK for native controls in your Flex Mobile project
- Try the TwitterTrendsFinal.fxp in the playbook_overrides.zip. This FXP already links playbook_overrides.swc and is ready to deploy. All it needs is an update to blackberry-tablet.xml to add the <author> and <authorId> of your debug token to deploy to a PlayBook.