FlexBuilder 不为 AIR 项目创建 .swf 文件
这似乎是 Flex Builder 中的一个错误,但是构建器不再为任何项目创建 .swf 文件(我正在构建 AIR 应用程序)。 但之前确实如此,由于某种原因,它会出错并显示消息“未找到初始内容”(指的是在 bin-debug 中查找 swf,但无法找到它)。
有许多建议的解决方案,例如将应用程序描述符中的版本从 1.0 更改为 1.5,但这些都不起作用。 我什至将其导入到新项目中,但未生成 swf 文件。
有没有办法强制 Flex Builder 生成 swf 文件?
谢谢。
This seems like a bug in Flex Builder, however the builder no longer creates the .swf file for any projects (I'm building an AIR app). It did previously however, for some reason it errors out with the message "Initial content not found" (referring to looking for the swf in bin-debug, and not being able to find it).
There are many proposed solutions, such as change the version in the application descriptor from 1.0 to 1.5, however none of these work. I've even imported it into a new project and the swf file is not generated.
Is there anyway to force Flex Builder to generate the swf file?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
当我将输出文件夹设置为“空”(期望 SWF 最终位于项目根目录中)时,就发生了这种情况。
当我更改输出目录时(属性/Flex 构建路径/输出文件夹,最后一个框)
项目能够构建并运行的东西(在我的例子中是“bin”)。
(我的代码中没有其他错误)。
This happened to me when I set the output folder as "empty" (expecting the SWF to end up in the project root directory).
When I changed the output directory (Properties/Flex Build Path/Output Folder, last box)
to something ("bin" in my case) the project was able to build and run.
(I had no other errors in the code).
我实际上发现这更多的是一个 UI 问题,代码有问题并不明显。
如果“问题”窗口中出现错误(红色叉号而不是感叹号),它将运行旧版本,而不是新版本...因此,虽然看起来它正在编译并运行新版本,但它并不是't。 或者,如发现的那样,它将拒绝重建 swf 文件。
检查问题窗口(我认为 View > Problems in flex builder)并查看是否有任何错误。 我还以为是缓存,但找到问题窗口解决了我的问题。
I actually found this was more of a UI problem, where it is not obvious that there is a problem with the code.
If there are errors in the 'Problems' window (red crosses as opposed to exclamation marks), it will run the old version, not the new version... So while it appears that it is compiling and running the new version, it isn't. Alternatively, as found, it will refuse to rebuild the swf file.
Check the problems window (I think View > Problems in flex builder) and see if there are any errors. I also thought it was caching, but finding the problems window solved my issues.
我遇到了同样的问题,根据 Ian 的说法,我已经搜索了错误。 什么也没发现,我给自己创建了一个错误,然后删除了这个错误。 我的项目正在编译并运行! 我认为 Flash Builder 与它所显示的内容不同步。 希望这能有所帮助。
I had the same issue and according to Ian, I've searched for an error. Finding nothing, I've created myself an error and then removed this error. My project was compiling and running ! I think Flash Builder was just not synchronized with what it was displaying. Hope this can help.
我有同样的问题...
grtz
更新:刚刚创建了一个新项目并将源代码复制到新文件中 --> 同样的问题
I have the same issue...
grtz
UPDATE: just created a new project and copied the source in the new file --> same problem
是的,刚刚发现类似的问题。 就我而言,我发现修复代码错误解决了问题。 最好先进行回溯,消除所有代码错误,直到再次获得工作版本,然后从工作版本进行备份,直到识别并处理最初导致问题的代码片段。 在我的例子中,我从 android 复制到 IOS 的 http 服务调用也是罪魁祸首。 当尝试将项目从 IOS 复制到 Android 时,我发现最好从 IOS 中的新版本构建它们。
Yes, just found similar problem. In my case I found fixing code errors solved the problem. Best to work back stripping out any code errors until you get a working version going again then build back up from working version until you identify and deal with the piece of code that caused the problem in the first place. Also in my case http service calls I was copying over from android to IOS were the culprit. I found best to build them from new in IOS when trying to duplicate a project over from IOS to Android.
您可以用 *.php 替换 *.html 文件,并将随机参数添加到 *.swf 路径
my.swf?random_value
如果没有帮助,则可能会出现最后一个问题:
有时Flex 将目标输出文件夹中的所有文件复制回项目 html-template
文件夹,当您操作输出文件夹或构建设置时。
由于 html-template 文件夹内容用于复制到目标输出文件夹,因此反向复制的旧 swf 文件将替换新文件。
Flex 会执行以下操作:
因此,如果您遇到 swf 更新问题且不是缓存问题,则检查 html-template 文件夹并删除 my.swf ( my 这里是你编译的 swf 文件的名称)。
有时,一系列运行和调试命令会有所帮助,但这又是由于替换了 html-template 文件夹中的 swf 文件。
You can replace *.html file with *.php and add random arguments to *.swf path
my.swf?random_value
If it does not help then the last problem may occur:
Sometimes Flex copies all files from target output folder BACK into project html-template
folder when you manipulate with your output folder or build settings.
Because html-template folder content is used to be copied to target output folder, the old swf file that was back-copied replaces the new one.
Flex does something like this:
So, if you have problems with swf update and it's not a cache problem then check html-template folder and remove my.swf (my here is the name of your compiled swf file).
Sometimes a sequence of Run and Debug commands help, but it is again due to the replacement of swf file in html-template folder.
就我而言,我修改了应用程序的 XML 文件的initialWindow.content 元素,以指向我的 ant 构建的 swf。 将其重置为空白以使其正常工作。
In my case I had modified the app's XML file's initialWindow.content element to point to my swf for ant build. Reset it to blank to make it work.