【发布时间】:2017-01-25 07:58:20
【问题描述】:
我正在尝试使用 apktool (apktool-2.1.1) 重建 apk。
遇到错误
i) 未找到与给定名称“@android:style/Animation.OptionsPanel”匹配的资源
ii)未找到与给定名称“@android:style/Animation.LockScreen”匹配的资源
错误信息:
I: Using Apktool 2.1.1
I: Copying /home/workspace/debug/app-demo-release classes.dex file...
I: Building resources...
W: /home/workspace/debug/app-demo-release/res/values-v24/styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Animation.OptionsPanel'.
W:
W: /home/workspace/debug/app-demo-release/res/values-v24/styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Animation.LockScreen'.
W:
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_1478810839657812213.tmp, p, --forced-package-id, 127, --min-sdk-version, 15, --target-sdk-version, 22, --version-code, 6, --version-name, 1.0.5-debug, -F, /tmp/APKTOOL7363633357993529625.tmp, -0, arsc, -0, woff2, -0, assets/io/michaelrocks/libphonenumber/android/data/PhoneNumberAlternateFormatsProto_66, -0, arsc, -I, /home/workspace/debug/apktool/framework/1.apk, -S, /home/workspace/debug/app-demo-release/res, -M, /home/workspace/debug/app-demo-release/AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:437)
at brut.androlib.Androlib.buildResources(Androlib.java:371)
at brut.androlib.Androlib.build(Androlib.java:281)
at brut.androlib.Androlib.build(Androlib.java:254)
at brut.apktool.Main.cmdBuild(Main.java:224)
at brut.apktool.Main.main(Main.java:84)
styles.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="TextAppearance.AppCompat.Notification.Info.Media" parent="@style/TextAppearance.AppCompat.Notification.Info" />
<style name="TextAppearance.AppCompat.Notification.Media" parent="@style/TextAppearance.AppCompat.Notification" />
<style name="TextAppearance.AppCompat.Notification.Time.Media" parent="@style/TextAppearance.AppCompat.Notification.Time" />
<style name="TextAppearance.AppCompat.Notification.Title.Media" parent="@style/TextAppearance.AppCompat.Notification.Title" />
<style name="Base.TextAppearance.AppCompat.Widget.Button.Borderless.Colored" parent="@android:style/Animation.OptionsPanel" />
<style name="Base.TextAppearance.AppCompat.Widget.Button.Colored" parent="@android:style/Animation.LockScreen" />
</resources>
【问题讨论】: