该文件是无效:ERROR让'机器人:name属性:属性不是一个字符串值 [英] The file is invalid: ERROR getting 'android:name' attribute: attribute is not a string value

查看:158
本文介绍了该文件是无效:ERROR让'机器人:name属性:属性不是一个字符串值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我发疯。我想上传一个APK草案应用程序商店,我是Windows开发者,这是我的第一个Android应用程序,所以我真的没有一个参照系,从工作。我出口签署的APK,并从开发者控制台我浏览到APK,选择它,并尝试上传。我收到的消息:
该文件是无效:ERROR让'机器人:name属性:属性不是一个字符串值。
我已上载该apk到网上,可以顺利下载,安装和运行的市场之外的应用程序。我自签名的APK,并已验证正确完成。
任何建议将是AP preciated。

AndroidManifest.xml中:

 <?XML版本=1.0编码=UTF-8&GT?;
<清单的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
      包=com.My.PackageName
      安卓版code =1机器人:=的versionName1.0.0>
    <应用机器人:图标=@绘制/图标机器人:标签=@字符串/ APP_NAME>
        <活动机器人:家的名字=机器人:configChanges =方向
                机器人:标签=@字符串/ APP_NAME机器人:launchMode =标准的机器人:图标=@绘制/图标>
              &所述;意图滤光器>
                    <作用机器人:名字=android.intent.action.MAIN/>
                    <类机器人:名字=android.intent.category.LAUNCHER/>
              &所述; /意图滤光器>
        < /活性GT;
        <活动机器人:preferencesNAME =机器人:标签=@字符串/ SET_ preferences> < /活性GT;
        <活动机器人:名字=com.admob.android.ads.AdMobActivity
              机器人:主题=@安卓风格/ Theme.NoTitleBar.Fullscreen
              机器人:configChanges =方向|键盘| keyboardHidden
        />
        <元数据的android:值=myvalue的机器人:名字=ADMOB_PUBLISHER_ID/>
        <元数据的android:值=真正的机器人:名字=ADMOB_ALLOW_LOCATION_FOR_ADS/>
    < /用途>
    <采用-SDK安卓的minSdkVersion =4/>
    <使用许可权的android:NAME =android.permission.INTERNET对/>
< /舱单及GT;`


解决方案

在一个活动的声明,如果丢失一个标签的属性不会成为AAPT调试徽章失败的原因!你可以让他们从你的活动宣言没有问题。

这些失败的常见原因是同时在非缺翻译是在翻译的资源之一声明字符串资源,主要资源文件夹中。

 水库
  值
    的strings.xml< - 在这里宣告失踪
  值,它
    的strings.xml< - 在这里声明,在清单用作标签字符串

运行/路径AAPT命令/到/ SDK /编译工具文件夹中找到有关此错误的详细信息:

  AAPT调试徽章/路径/要/ APK

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://schemas.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

这篇关于该文件是无效:ERROR让'机器人:name属性:属性不是一个字符串值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆