问题
I am running Flash Builder 4.6 and just added Apache flex sdk 4.9.1 (build 1447119) to my mac book pro running Moutain Lion and when i tried to do a quick 'hello world' and add a few elements to the stage using design mode i got following error:
The design mode is disabled as the project uses an incompatible version of the flex sdk
My question is if i go beyond the default sdk that shipped with fb 4.6 do I therefore loose the ability to use design mode and have to do everything in source mode?
Also, if i am using windows the error is quite similar when i mouseover on Design
tab
Design mode not supported - incompatible SDK version - Apache Flex
Thanks
回答1:
There is a hack you can do to get it working (I've done this myself and it works perfectly so far) that involves editing an XML file in the 4.9.1 SDK to trick Flash Builder into thinking it is using Flex 4.6. You'll need to edit the 'flex-sdk-description.xml'
Version tag and change it from 4.9.1 to 4.6 and that should take care of it. Location of the file is in the SDK folder in 4.9.1 folder, here is the path in Windows 7:
C:\Program Files (x86)\Adobe\Adobe Flash Builder 4.6\sdks\4.9.1
回答2:
I confirm the say by wakqasahmed
I changed it at Apache Flex 4.10
<?xml version="1.0"?>
<flex-sdk-description>
<name>Apache Flex 4.10.0 FP 11.8 AIR 3.8 en_US</name>
<!--version>4.10.0</version-->
<version>4.6.0</version>
<build>20130801</build>
</flex-sdk-description>
And the Design mode is enable again!, Thanks
回答3:
I have a better trick which doesn't involve cheating Flash Builder about the Flex SDK you are using. It is about patching a single bit in one compiled class. After that, the designer will open no matter the version of Flex you are using. You can read a bit more about it in my article at:
Latest Flex SDK in Adobe Flash Builder 4.6
(I've just dared to open a blog, after almost 40 years in the area!),
However, here you have the solution in a nutshell:
You have to patch the class:
com\adobe\flexbuilder\mxml\editor\MXMLEditor.class
which is inside:
eclipse\plugins\com.adobe.flexbuilder.mxml.editor_4.6.1.335153\mxml.jar
With an hexadecimal editor, open the file MXMLEditor.class and change the byte:3D (61 dec.) at address 0x9D04
to:AC (172 dec.)
After that, you will be able to use the Flash Builder designer with any version of Flex SDK. But be cautious and take the appropriate precautions first:
- Do a backup of the .jar file before changing anything.
- Check that the version of your mxml.jar is the same as the above.
- Revise your software license and check that it's ok for you to do the patch.
来源:https://stackoverflow.com/questions/15665980/can-i-use-design-mode-in-fb-4-6-if-i-add-apache-flex-sdk-4-9-1-as-my-compiler