The file is invalid: ERROR getting 'android:name' attribute: attribute is not a string value
This is driving me nuts. I'm trying to upload a draft apk to the app store, I'm a windows developer, and this is my first android app, so I don't really have a frame of reference to work from. I export the signed apk, and from the developer console I browse to the apk, select it, and attempt to upload. I receive the message: The file is invalid: ERROR getting 'android:name' attribute: attribute is not a string value. I have uploaded this apk to the web, and can successfully download, install, and run the app outside of the market. I've self-signed the apk, and have verified that is done correctly. Any suggestions would be appreciated.
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://sch开发者_运维问答emas.android.com/apk/res/android"
package="com.My.PackageName"
android:versionCode="1" android:versionName="1.0.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".Home" android:configChanges="orientation"
android:label="@string/app_name" android:launchMode="standard" android:icon="@drawable/icon">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Preferences" android:label="@string/set_preferences"> </activity>
<activity android:name="com.admob.android.ads.AdMobActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="orientation|keyboard|keyboardHidden"
/>
<meta-data android:value="myValue" android:name="ADMOB_PUBLISHER_ID" />
<meta-data android:value="true" android:name="ADMOB_ALLOW_LOCATION_FOR_ADS" />
</application>
<uses-sdk android:minSdkVersion="4" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>`
A missing label attribute on an Activity declaration will not be the reason for aapt debug badging to fail! You can leave them out of your Activity declaration without issues.
A common cause for these failures is a string resource that is declared in one of the translated resources while missing in the non translated, main resource folder.
res
values
strings.xml <-- missing declaration here
values-it
strings.xml <-- of a string declared here and used in manifest as a label
run the aapt command from the /path/to/sdk/build-tools folder to find more information about this error:
aapt debug badging /path/to/apk
Looks like you forgot to set the name attribute or gave an invalid one in the AndroidManifest.xml
I just had the same issue. Found the problem - I'd missed the label from one of my activity declarations. In your case, looks like the 3rd activity.
精彩评论