PhoneGap 2.7发布,官方弃用1.9版本
2013-09-05 16:35 张智清 阅读(463) 评论(0) 收藏 举报2013年5月21日Adobe发布PhoneGap 2.7,同时宣布不再支持PhoneGap 2.0之前的版本,其中包括发布还不到一年的1.9版本。Ryan Willoughby曾于4月底解释过其理由:
从1.x版本开始,随着PhoneGap的演进,通过一系列的改进和重新设计,我们去掉了Cordova架构。停止对1.9及更早版本的支持,使我们可以简化基础架构并改进PhoneGap Build的性能。
在iOS上的变化
除了常规的bug修复,2.7版本还对文件的上传和下载提供了更好的支持。
在Android上的变化
Android上的版本引入了一些与之前版本不兼容的修改。为支持CordovaPlugin,Plugin.java已经弃用。移除了device.name。但最大的问题是WebSQL。Joe Bowser解释说:
这项变化是开发者最为恼火的,也是我们目前正在解决的。很多人在其应用中使用WebSQL。WebSQL这一W3C规范已经弃用,而且不是所有的平台都支持它。在Android 3.x及更高版本之上,Android团队已不再支持WebSQL,这样就无法通过URI打开数据库了。早期Cordova使用了一种变通方案来解决此问题,但是存在很多设计上的问题,而且无法保证与WebSQL以相同方式运行。目前之所以建议大家使用WebStorage API来代替WebSQL,就是这个原因。WebStorage支持跨平台,变化的可能性较小。而且就算WebStorage出了问题,我们也可以修复WebStorage,哪怕这意味着要破坏WebSQL。
备注:
在后来发布的PhoneGap V2.8版开始,创建的项目中的www目录下的Cordova脚本文件直接更名为cordova.js(即没有带-版本号后缀了)。
(之前在V2.3版开始,就将配置文件Cordova.plist转换为新的config.xml来替代了,当时在升级项目时是通过运行bin/cordova_plist_to_config_xml脚本来实现的。)
且配置文件config.xml中不支持<plugin>标签元素了,统一使用<feature>标签设置。
咱们又要折腾了
反安装CordovaLib、Cordova.framework和Xcode Templates模板
注:对于PhoneGap 2.x来说,其Xcode Templates已经被删除了。因此如果确定不会使用到旧版的Cordova,则首先要反安装掉它。
1. 运行终端命令,打开窗口
2. 定位到存放有Makefile文件的目录下
3. 命令指示符下输入"make uninstall",回车运行反安装程序。
或者执行以下脚本
打开AppleScript编辑器
复制粘贴以下内容,然后运行。
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
set question to display dialog "Uninstall Cordova?" buttons {"Yes", "No"} default button 2 with icon caution
set answer to button returned of question
if answer is equal to "Yes" then
tell application "Finder" to set home_path to home as text
tell application "Finder" to set startup_hd to startup disk as string
-- delete Xcode 3 Template
set source to (home_path & "Library:Application Support:Developer:Shared:Xcode:Project Templates:Cordova")
tell application "Finder"
if exists folder source then
delete source
end if
end tell
-- delete Xcode 4 Template
set source to (home_path & "Library:Developer:Xcode:Templates:Project Templates:Application:Cordova-based Application.xctemplate")
tell application "Finder"
if exists folder source then
delete source
end if
end tell
-- delete CordovaLib (used by Xcode 3 Template, and generating Cordova.framework if need be)
set source to (home_path & "Documents:CordovaLib")
tell application "Finder"
if exists folder source then
delete source
end if
end tell
-- delete Cordova.framework (used by Xcode 4 Template) and its parent directories
set source to (startup_hd & "Users:Shared:Cordova")
tell application "Finder"
if exists folder source then
delete source
end if
end tell
-- delete symlink to Cordova.framework
set source to (home_path & "Library:Frameworks:Cordova.framework")
tell application "Finder"
if exists file source then
delete source
end if
end tell
-- end
display dialog "Cordova uninstalled." buttons {"Goodbye ☹"} with icon note
else
display dialog "Phew!" buttons {"That was close ☺"} with icon note
end if
浙公网安备 33010602011771号