BUG Review:关于getting 'android:xxx' attribute: attribute is not a string value的问题及解决方法
2016-08-18 16:47
543 查看
我们在使用Android Studio开发完应用程序后,都要将打好的apk安装包上传到各大应用市场,但是有时候上传时应用市场会出现提交的安装包不能通过应用市场的aapt解析而被打回的情况。
他们使用aapt解析我们的apk文件的过程中会报错,出现类似于
getting 'android:xxx' attribute: attribute is not a string value
这种错误,xxx可能是Label,也可能是name。这是什么原因呢?
出现这种错误的大部分原因是,我们在声明Label或者name的时候使用的@string来进行字符串的引用,但是在aapt.exe这个Google官方的解析小程序中,@string这种引用有时候是不能被识别的。
如果再AndroidManifest.xml文件中的属性声明后使用了@string这种引用,在使用aapt.exe解析安装文件时就会报错,如果应用市场解析你的apk文件时报错,它就不能获得你apk完全的信息,就不会允许你上传新的apk安装包。
这种情况怎么解决呢,建议的也是大多数人的解决方法是将清单文件中的@string引用全部换成引用的本身的字符串,就可以解决这个问题。也有些博文中(国内或者国外的)说可以将AndroidManifest.xml文件中的所有@string
都以硬编码的方式写在文件里,其实没有必要这么做,因为只要aapt不报这个错误,就证明你的清单文件是可以被解析识别的。
之后我会将每一个遇见的这种问题都记录下来,以免下回再碰到的时候忘记。
他们使用aapt解析我们的apk文件的过程中会报错,出现类似于
getting 'android:xxx' attribute: attribute is not a string value
这种错误,xxx可能是Label,也可能是name。这是什么原因呢?
出现这种错误的大部分原因是,我们在声明Label或者name的时候使用的@string来进行字符串的引用,但是在aapt.exe这个Google官方的解析小程序中,@string这种引用有时候是不能被识别的。
如果再AndroidManifest.xml文件中的属性声明后使用了@string这种引用,在使用aapt.exe解析安装文件时就会报错,如果应用市场解析你的apk文件时报错,它就不能获得你apk完全的信息,就不会允许你上传新的apk安装包。
这种情况怎么解决呢,建议的也是大多数人的解决方法是将清单文件中的@string引用全部换成引用的本身的字符串,就可以解决这个问题。也有些博文中(国内或者国外的)说可以将AndroidManifest.xml文件中的所有@string
都以硬编码的方式写在文件里,其实没有必要这么做,因为只要aapt不报这个错误,就证明你的清单文件是可以被解析识别的。
之后我会将每一个遇见的这种问题都记录下来,以免下回再碰到的时候忘记。
相关文章推荐
- 关于getting 'android:label' attribute: attribute is not a string value 错误的解决方法
- 关于GooglePlay上传错误:android:icon attribute attribute is not a string value
- spring boot could not resolve placeholder in string value 问题解决方法
- 关于Error:JAVA_HOME is not set and could not be found问题的解决方法
- Android Error:main cannot be resolved or is not a field 问题解决方法
- 关于Servlet报错:405 HTTP method GET is not supported by this URL问题解决方法
- ERROR getting 'android:label' attribute: attribute is not a string value
- aERROR getting 'android:icon' attribute: attribute is not a string value
- this class is not key value coding-compliant for the key XXX错误的解决方法
- 关于 Android中googleMaps的Geocoder, “the service is not available”解决办法
- 关于图片资源在android2.1/2.2/2.3下无法显示的问题以及解决方法
- the target processor (armv4i) is not installed,问题解决方法
- 关于Public key for *.rpm is not installed 的解决方法
- 关于Files' name is invalid or does not exist的解决方法
- Hibernate继承映射的“Could not format discriminator value to SQL string”错误解决方法
- 问题解决: Attribute value request.getParameter("id") is quoted with " which must be escaped when used wi
- the target processor (armv4i) is not installed,问题解决方法
- windbg中"Your debugger is not using the correct symbols"问题解决方法
- "this class is not key value coding-compliant for the key ..."问题的解决
- 关于Tomcat: The value for the useBean class attribute is invalid 问题的另类解释