现在的位置: 首页 > 综合 > 正文

Apostrophe not preceded by \ (in CREATE TABLE tb_cammonitor_configs (

2015年03月21日 ⁄ 综合 ⁄ 共 433字 ⁄ 字号 评论关闭

当我们用Eclipse环境开发Android项目,如果编译时控制台报出“error: Apostrophe not preceded by \ (”这种错误,那么多半是因为我们项目中的一个strings.xml文件里有一个string标签中的字符串含有’,我们只要在’之前加\进行转义就可以解决这个错误,比如把Can’t修改为Can\’t就可以了。


<string name="table_sql">
CREATE TABLE tb_cammonitor_configs (
_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
name VARCHAR(30) NULL,
ip VARCHAR(64) NULL,
port NUMERIC NULL,
username VARCHAR(64) NULL,
password VARCHAR(64) NULL,
client_dir TEXT NULL,
connect_type NUMERIC DEFAULT \'1\' NULL
);
</string>

抱歉!评论已关闭.