R.stamp Error 1
16lz
2021-01-23
(skipping hidden file 'packages/apps/Launcher/res/drawable-hdpi/.directory')
Warning: AndroidManifest.xml already defines versionCode (in http://schemas.android.com/apk/res/android); using existing value in manifest.
Warning: AndroidManifest.xml already defines versionName (in http://schemas.android.com/apk/res/android); using existing value in manifest.
Warning: AndroidManifest.xml already defines minSdkVersion (in http://schemas.android.com/apk/res/android); using existing value in manifest.
Warning: AndroidManifest.xml already defines versionCode (in http://schemas.android.com/apk/res/android); using existing value in manifest.
Warning: AndroidManifest.xml already defines versionName (in http://schemas.android.com/apk/res/android); using existing value in manifest.
Warning: AndroidManifest.xml already defines minSdkVersion (in http://schemas.android.com/apk/res/android); using existing value in manifest.
packages/apps/Launcher/res/layout-port/launcher.xml:72: error: Error: This attribute must be localized. (at 'text' with value 'HelloWorld').
在launcher.xml中增加以下代码:
<TextView android:id="@+id/mEnableText"android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true"android:textColor="#3fb2a0"android:text="HelloWorld"android:textSize="30px"/>
在修改系统Launcher代码的layout-port下的launcher.xml时出现了这个问题,编译不过去,很奇怪,前面的都是warning,我还以为是编译服务器不稳定导致的,后来又出现了这个问题,仔细看了一下发现有个error:This attribute must be localized. (at 'text' with value 'HelloWorld').,原来为了适应多国语言切换要求所有的字符串都是需要从strings.xml中读取,把HelloWorld放入strings.xml然后在这边使用@string/helloworld的方式引用就可以了~~
更多相关文章
- [置顶] Android实用代码集
- Android ViewPager和PagerAdapter简单代码写法
- Android新手入门实例之Android漂亮时钟的源代码
- 如何实现Android重启应用程序代码 ?
- android 复制字符串到剪贴板
- android常用的代码片段
- Android Camera代码位置
- Android Studio设置类代码模板
- Android获取高清app图标代码分享