This attribute must be localized

引用:http://blog.csdn.net/qinyun188/article/details/7466973

“This attribute must be localized”,这种问题一般情况是因为在res/layout下的文件中出现了没有多语言话的文本例如

<Button
android:id="@+id/btnLED1On"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="on"
android:layout_x="8px"
android:layout_y="42px"
>
</Button>

解决办法:

res/values/strings.xml中定义字符串
<string name="led1on">on</string>

然后再把res/layout/main.xml相应内容改成

<Button
android:id="@+id/btnLED1On"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@sring/led1on"
android:layout_x="8px"
android:layout_y="42px"
>
</Button>

这是android强制实行多语言话,是为了方便应用多言版本的扩充。

原文地址:https://www.cnblogs.com/sode/p/2617421.html