QMUI Android框架升级到1.1.6后,编译报not found的错误,原来是要加入appcompat兼容包。

一段时间没关注,QMUI Android框架从1.1.3升级到了1.1.6,欣喜的在gradle中将版本号升级到1.1.6,然后点击同步。

结果报错了!

这是最不愿意看到的情况,而且还是错误一大堆。都是not found的错误。

error: style attribute 'attr/colorPrimaryDark (aka net.dalu2048.wechatgenius:attr/colorPrimaryDark)' not found.

error: style attribute 'attr/colorPrimary (aka net.dalu2048.wechatgenius:attr/colorPrimary)' not found.  

error: style attribute 'attr/colorAccent (aka net.dalu2048.wechatgenius:attr/colorAccent)' not found.    

error: style attribute 'attr/colorControlNormal (aka net.dalu2048.wechatgenius:attr/colorControlNormal)' not found.    

 

 

 

郁闷和搞了好久,最后终于找到原因。原来是新版本需要依赖兼容包。

在gradle中添加appcompat的引用即可。添加下面这行:

implementation 'com.android.support:appcompat-v7:28.0.0-rc01'

再编译,问题解决。