Android 回编译First type is not attr和No resource identifier found for attribute 'usesCleartextTraffi问题

1.First type is not attr!

出现这个问题的原因是重打包的apk的resource.arsc里面第一个不是attr,在google的aapt工具里面对resource.arsc里面第一个类型必须得是attr有强校验,否则就会报“First type is not attr!”的错误。

Android 回编译First type is not attr和No resource identifier found for attribute 'usesCleartextTraffi问题

aapt1源码里面对位置为0的type做了强校验,如果不为attr则编译报错

解决办法:升级apktool 和aapt

2.No resource identifier found for attribute 'xxxxxxxxxxxxx' in package 'android'

Android.jar的版本太低了不存在这个属性,

解决办法:1.要么直接删除,

                  2.升级Android.jar包,删除C:\Users\Administrator\AppData\Local\apktool\framework目录下的1.apk