报错信息
[2018-12-02 10:40:39 - ad_hello] E:\eclipse-workspace\ad_hello\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name ‘Theme.AppCompat.Light’.
[2018-12-02 10:40:39 - ad_hello]
[2018-12-02 10:40:39 - ad_hello] E:\eclipse-workspace\ad_hello\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name ‘Theme.AppCompat.Light’.
[2018-12-02 10:40:39 - ad_hello]
[2018-12-02 10:40:39 - ad_hello] E:\eclipse-workspace\ad_hello\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name ‘Theme.AppCompat.Light.DarkActionBar’.
[2018-12-02 10:40:39 - ad_hello]
解决方案
经过上网查资料,发现这种是因为SDK版本过低导致。然而我尝试在新建项目时,已经把target sdk和compile with 选项都调成同一个api版本。但是仍出现同样失败。
后来经过尝试发现还要把 minimum require sdk (最低版本)调高。调成和target sdk一样的即可。
个人理解是开发工具需要同时校验和加载目标sdk和最低sdk 2种。所以都要设置。