1.错误log
E:\Learn\apidemo\ApiDemos\testsource\build\intermediates\res\merged\debug\values-v23\values-v23.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
E:\Learn\apidemo\ApiDemos\testsource\build\intermediates\res\merged\debug\values-v23\values-v23.xml:34: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
E:\Learn\apidemo\ApiDemos\testsource\build\intermediates\res\merged\debug\values-v24\values-v24.xml:3: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
E:\Learn\apidemo\ApiDemos\testsource\build\intermediates\res\merged\debug\values-v24\values-v24.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
E:\Learn\apidemo\ApiDemos\testsource\build\intermediates\res\merged\debug\values-v23\values-v23.xml:34: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
E:\Learn\apidemo\ApiDemos\testsource\build\intermediates\res\merged\debug\values-v24\values-v24.xml:3: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
E:\Learn\apidemo\ApiDemos\testsource\build\intermediates\res\merged\debug\values-v24\values-v24.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
2.看看我的gradle文件
3.分析解决
可以看到compileSdkVersion 21而使用v7的版本25.2.0很显然使用高版本的v7到sdk21里面当然找不到相关资源
解决方法1:升高sdk版本如修改为
compileSdkVersion 25即可
解决方法2:降低v7版本可你使用的sdk版本保持一致
虽然两个方法都可以但是还是最好使用方法1,这样可以使用一些新的特性。而方法2却无法使用一些新的特性