打包后报错:
Error:(4, 5) No resource found that matches the given name: attr 'colorAccent'.
Error:(4, 5) No resource found that matches the given name: attr 'colorPrimary'.
Error:(4, 5) No resource found that matches the given name: attr 'colorPrimaryDark'.
Error:Execution failed for task ':processDebugResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'D:\ADT\sdk\build-tools\26.0.0\aapt.exe'' finished with non-zero exit value 1
之前修改了style标签的parent,还是不行。原代码:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
丢改后:
你先看下你的color文件里面是否有这些颜色属性
lintOptions {
abortOnError false
checkReleaseBuilds false
}
在app.gradle里加上这段代码。就可以编译了。但是可能会出错,因为google尾android7.0出了另一种编译方式v2。如果选择v2的话 在7.0下的手机中会出错,你直接选v1就行