Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve Error: This attribute must be localized. (at 'text' with value 'TOP_LEFT')

Tags:

android

I am compiling android source using following Android.mk file :

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional

LOCAL_STATIC_JAVA_LIBRARIES := libarity

LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_PACKAGE_NAME := TouchPanelTest

include $(BUILD_PACKAGE)
##################################################
include $(CLEAR_VARS)


# Use the folloing include to make our test apk.
include $(call all-makefiles-under,$(LOCAL_PATH))

but it will give error :

main.xml:19: error: Error: This attribute must be localized. (at 'text' with value 'TOP_LEFT').

mail.xml is as follows :

<RelativeLayout
    android:id="@+id/top_left"
    android:layout_width="30dp"
    android:layout_height="30dp"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    android:background="#000"
    android:orientation="vertical" >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="TOP_LEFT" />
</RelativeLayout>

<RelativeLayout
    android:id="@+id/top_right"
    android:layout_width="30dp"
    android:layout_height="30dp"
    android:layout_alignParentRight="true"
    android:layout_alignParentTop="true"
    android:background="#000"
    android:orientation="vertical" >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="TOP_RIGHT" />
</RelativeLayout>

<RelativeLayout
    android:id="@+id/bottom_left"
    android:layout_width="30dp"
    android:layout_height="30dp"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    android:background="#000"
    android:orientation="vertical" >

    <TextView 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="BOTTOM_LEFT" />
</RelativeLayout>
like image 462
ssamar Avatar asked Dec 09 '11 13:12

ssamar


1 Answers

You can use

LOCAL_MODULE_TAGS := tests

in the Android.mk to omits the localization check.

Another way is to disable localization check in build system. Comment the line 81 in build/core/package.mk

#LOCAL_AAPT_FLAGS := $(LOCAL_AAPT_FLAGS) -z
like image 117
duleorlovic Avatar answered Sep 28 '22 17:09

duleorlovic