天天看點

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