我正在手动编译一个apk。但在使用aapt时,打包时出现错误。
在Android Studio中创建一个简单的项目。然后用aapt打包他的资源。命令如下所示:
aapt package -f -m -J build -S res -M AndroidManifest.xml
-I /SDK/platforms/android-28/android.jar错误输出如下:
error: resource style/Theme.AppCompat.Light.NoActionBar (aka com.jz.myapplication:style/Theme.AppCompat.Light.NoActionBar) not found.
./res/values/styles.xml:6: error: style attribute 'attr/colorPrimary (aka com.jz.myapplication:attr/colorPrimary)' not found.
./res/values/styles.xml:7: error: style attribute 'attr/colorPrimaryDark (aka com.jz.myapplication:attr/colorPrimaryDark)' not found.
./res/values/styles.xml:8: error: style attribute 'attr/colorAccent (aka com.jz.myapplication:attr/colorAccent)' not found.
error: failed linking references.发布于 2019-04-08 23:34:28
你缺少app compat库中的资源。
如果要使用某些库中的资源,则需要使用-S标志包括这些库中的所有资源及其传递依赖项。您还需要注意这些输入的顺序,因为它们将影响运行时的资源覆盖。
如果你使用Android Gradle插件,所有这些都会自动为你完成。
https://stackoverflow.com/questions/55547762
复制相似问题