在创建一个hello android时,使用的最新的SDK,结果发现创建完后就有错误,对于一个新手来说真是一种痛苦,还没开始,就已纠结。
错误:
[2015-05-25 03:26:56 - android-support-v7-appcompat] C:\workspace\MobileProjects\android-sdk-windows\extras\android\support\v7\appcompat\res\values-v21\themes_base.xml:134: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'. [2015-05-25 03:26:56 - android-support-v7-appcompat] [2015-05-25 03:26:56 - android-support-v7-appcompat] C:\workspace\MobileProjects\android-sdk-windows\extras\android\support\v7\appcompat\res\values-v21\themes_base.xml:135: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'. [2015-05-25 03:26:56 - android-support-v7-appcompat] [2015-05-25 03:26:56 - android-support-v7-appcompat] C:\workspace\MobileProjects\android-sdk-windows\extras\android\support\v7\appcompat\res\values-v21\themes_base.xml:144: error: Error: No resource found that matches the given name: attr 'android:windowElevation'. [2015-05-25 03:26:56 - android-support-v7-appcompat] [2015-05-25 03:26:56 - android-support-v7-appcompat] C:\workspace\MobileProjects\android-sdk-windows\extras\android\support\v7\appcompat\res\values-v21\themes_base.xml:148: error: Error: No resource found that matches the given name: attr 'android:windowElevation'.
有人说只要修改下Support library里的project.properties. 将19设为21,然后build clean一下即可。试试看。