2011-09-28 30 views
9

Tôi có lỗi này "L ERI nhận 'android: label' thuộc tính: thuộc tính không phải là giá trị chuỗi" khi cố gắng xuất bản ứng dụng của tôi lên thị trường Android. Một thời gian trước, ứng dụng này đã được xuất bản thành công trên thị trường, nhưng khi tôi áp dụng các thay đổi nhỏ trong AndroidManifest.xml (thay đổi versionCode và versionName), tôi nhận được lỗi này liên tục.ERROR nhận thuộc tính 'android: label': thuộc tính không phải là giá trị chuỗi

Tôi nhìn cho tất cả các chủ đề tương tự ở đây, chẳng hạn như:

Android Market Publishing Issues

"ERROR getting 'android:icon' attribute: attribute is not a string value" when trying to upload to the Android Market

The file is invalid: ERROR getting 'android:name' attribute: attribute is not a string value

nhưng không ai trong số những giải pháp giúp tôi. Bạn có biết bất kỳ lý do nào khác của lỗi như vậy không? Đây là AndroidManifest.xml của tôi:

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.samsung.att.deskhome" android:versionCode="12" android:versionName="2.3"> 
<uses-permission android:name="android.permission.READ_CALENDAR" /> 
<uses-permission android:name="android.permission.WAKE_LOCK" /> 
<uses-permission android:name="android.permission.INTERNET" /> 
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 
<uses-permission android:name="android.permission.SET_WALLPAPER" /> 
<uses-permission android:name="android.permission.SET_WALLPAPER_HINTS" /> 
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" /> 
<application android:icon="@drawable/mainmenu_icon_homemount" android:label="@string/app_name"> 
<activity android:name=".CradleMain" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar" android:launchMode="singleTask" > 
<meta-data android:name="android.dock_home" android:value="true" /> 
<intent-filter> 
<action android:name="android.intent.action.MAIN" /> 
<category android:name="android.intent.category.DEFAULT" /> 
<category android:name="android.intent.category.LAUNCHER" /> 
<category android:name="android.intent.category.DESK_DOCK" /> 
</intent-filter> 
</activity>  
<activity android:name=".CradleHomeSettings" android:label="@string/cradle_home_settings" android:launchMode="singleTask" android:configChanges="orientation"> 
<intent-filter> 
<action android:name="android.intent.action.MAIN" /> 
<category android:name="android.intent.category.DESK_DOCK" /> 
</intent-filter> 
</activity> 
<activity android:name=".CradleWeatherSettings" android:label="@string/cradle_weather_settings" android:launchMode="singleTask" android:configChanges="orientation"> 
<intent-filter> 
<action android:name="android.intent.action.MAIN" /> 
<category android:name="android.intent.category.DESK_DOCK" /> 
</intent-filter> 
</activity> 
<activity android:name=".CradleWallpaperChooser" android:label="@string/pick_wallpaper" android:screenOrientation="nosensor" android:finishOnCloseSystemDialogs="true" android:configChanges="locale"> 
<intent-filter> 
<action android:name="android.intent.action.MAIN" /> 
<category android:name="android.intent.category.DESK_DOCK" /> 
</intent-filter> 
</activity> 
</application> 
<uses-sdk android:minSdkVersion="8" /> 
<uses-sdk android:maxSdkVersion="10" /> 
</manifest> 
+6

Lý do của vấn đề là các giá trị/strings.xml không chứa một trong các thuộc tính "android: label", mặc dù nó nằm trong các tệp strings.xml được bản địa hoá khác. – amilien

Trả lời

10

Bất cứ khi nào bạn nhận được một lỗi từ Cửa hàng Play khi tải đảm bảo để thực hiện cùng một lệnh tại địa phương để có được đầu ra thích hợp. Đầu ra được lấy từ bảng điều khiển trực tuyến là gây hiểu nhầm.

Một ví dụ từ mã của riêng tôi, đây là những gì tôi nhận được trên giao diện điều khiển trực tuyến:

Failed to run aapt dump badging: 
W/ResourceType(4560): Failure getting entry for 0x7f0601c6 (t=5 e=454) in package 0 (error -75) 
ERROR getting 'android:label' attribute: attribute is not a string value 

Và một hoạt động địa phương cho cùng một công cụ (tìm thấy ở xây dựng các công cụ trong sdk dir)

aapt dump badging /path/to/your/apk 

tiết lộ thông tin hữu ích như các vị trí mà việc kiểm tra thất bại:

package: name='X' versionCode='X' versionName='X' 
sdkVersion:'7' 
targetSdkVersion:'17' 
uses-permission:'android.permission.INTERNET' 
... 
uses-permission:'android.permission.WRITE_EXTERNAL_STORAGE' 
uses-feature-not-required:'android.hardware.camera' 
uses-feature-not-required:'android.hardware.camera.autofocus' 
application-label:'Photo Tools' 
application-label-zh:'摄影工具' 
application-label-nl:'Photo Tools' 
application-label-fr:'Photo Tools' 
application-label-es:'Photo Tools' 
application-label-it:'Photo Tools' 
application-label-ru:'Photo Tools' 
application-icon-160:'res/drawable/phototools_icon.png' 
application-icon-240:'res/drawable/phototools_icon.png' 
application-icon-320:'res/drawable/phototools_icon.png' 
application-icon-480:'res/drawable/phototools_icon.png' 
application: label='Photo Tools' icon='res/drawable/phototools_icon.png' 
launchable-activity: name='be.hcpl.android.phototools.PhotoToolsActivity' label='Photo Tools' icon='' 
W/ResourceType(30945): Failure getting entry for 0x7f0601c6 (t=5 e=454) in package 0 (error -84) 
ERROR getting 'android:label' attribute: attribute is not a string value 
+1

Tôi nhận được cùng một lỗi, câu trả lời của bạn thiếu giải pháp, bạn đã làm gì sau khi bạn nhận được kết xuất này – meda

+2

@meda cho tôi một giá trị chuỗi bị thiếu trên tệp strings.xml mặc định trong khi dịch sang tệp strings.xml khác – hcpl

1

Tổ chức điều tra, tôi theo thứ e phương pháp sau đây:

  1. comment hiện các hoạt động từng người một
  2. xây dựng phát hành ký
  3. chạy aapt bãi badging/path/to/your/apk
  4. thấy lỗi và lặp lại

Điều này cho phép tôi thu hẹp xuống thư mục gốc của vấn đề của tôi. Chỉ cần một chuỗi không có tài nguyên thay vì nhãn không được sử dụng trong ứng dụng. Tôi đã xóa thuộc tính nhãn làm bản sửa lỗi.

1

đọc câu trả lời @hcpl, nếu bạn không thể tìm lỗi, hãy tìm hoạt động tiếp theo được liệt kê trong tệp kê khai. trong bài viết của mình:

launchable-activity: name='be.hcpl.android.phototools.PhotoToolsActivity' label='Photo Tools' icon='' 
W/ResourceType(30945): Failure getting entry for 0x7f0601c6 (t=5 e=454) in package 0 (error -84) 
ERROR getting 'android:label' attribute: attribute is not a string value 

Bạn có thể nghĩ rằng vấn đề có liên quan đến PhotoToolsActivity nhưng nó là về hoạt động tiếp theo mà không được đăng nhập bởi vì nó aapt treo

0

Kiểm tra các giá trị/strings.xml và values- xx/strings.xml Bạn phải chắc chắn rằng mọi từ trong giá trị/strings.xml phải có từ tương ứng dưới giá trị-xx/strings.xml.

0

Trong trường hợp của tôi, tệp string.xml mặc định bị thiếu, vô tình bị xóa khỏi dự án.

tôi sử dụng:

disable 'ExtraTranslation' 
disable 'MissingTranslation' 

trong gradle, vì vậy tôi đã không có bằng chứng của file string.xml mất tích.

Các vấn đề liên quan