Android之编译提示error: Apostrophe not preceded by

1 问题

as编译提示错误如下

error: Apostrophe not preceded by 

 

2 原因

字符串资源文件里面value包含一个单引号

    <string name="key">Don 't ....</string>

 

2 解决办法

1) 加双引号 

    <string name="key">"Don 't ...."</string>

2) 加斜杠

    <string name="key">Don \'t ....</string>
发布了1063 篇原创文章 · 获赞 655 · 访问量 297万+

猜你喜欢

转载自blog.csdn.net/u011068702/article/details/104803195