在Eclipse上的Android应用程序上获取错误

时间:2016-02-23 09:54:23

标签: android eclipse

[2016-02-23 14:52:23 - Driver] E:\android_workspace\Driver\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
[2016-02-23 14:52:23 - Driver] 
[2016-02-23 14:52:23 - Driver] E:\android_workspace\Driver\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
[2016-02-23 14:52:23 - Driver] 
[2016-02-23 14:52:23 - Driver] E:\android_workspace\Driver\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
[2016-02-23 14:52:23 - Driver] 
[2016-02-23 14:52:24 - Driver] E:\android_workspace\Driver\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
[2016-02-23 14:52:24 - Driver] 
[2016-02-23 14:52:24 - Driver] E:\android_workspace\Driver\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
[2016-02-23 14:52:24 - Driver] 
[2016-02-23 14:52:24 - Driver] E:\android_workspace\Driver\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
[2016-02-23 14:52:24 - Driver] 
[2016-02-23 14:52:25 - android-support-v7-appcompat] C:\Android\sdk\extras\android\support\v7\appcompat\res\values-v23\styles_base.xml:20: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
[2016-02-23 14:52:25 - android-support-v7-appcompat] 
[2016-02-23 14:52:25 - android-support-v7-appcompat] C:\Android\sdk\extras\android\support\v7\appcompat\res\values-v23\styles_base_text.xml:19: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
[2016-02-23 14:52:25 - android-support-v7-appcompat] 
[2016-02-23 14:52:26 - google-play-services_lib] C:\Android\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res\values-v11\appinvite_styles.xml:5: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.Holo.Light.DialogWhenLarge.NoActionBar'.
[2016-02-23 14:52:26 - google-play-services_lib] 
[2016-02-23 14:52:26 - google-play-services_lib] C:\Android\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res\values-v21\appinvite_styles.xml:5: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.Material.Light.DialogWhenLarge.NoActionBar'.
[2016-02-23 14:52:26 - google-play-services_lib] 
[2016-02-23 14:52:41 - android-support-v7-appcompat] C:\Android\sdk\extras\android\support\v7\appcompat\res\values-v23\styles_base.xml:20: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
[2016-02-23 14:52:41 - android-support-v7-appcompat] 
[2016-02-23 14:52:41 - android-support-v7-appcompat] C:\Android\sdk\extras\android\support\v7\appcompat\res\values-v23\styles_base_text.xml:19: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
[2016-02-23 14:52:41 - android-support-v7-appcompat] 
[2016-02-23 14:52:42 - google-play-services_lib] C:\Android\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res\values-v11\appinvite_styles.xml:5: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.Holo.Light.DialogWhenLarge.NoActionBar'.
[2016-02-23 14:52:42 - google-play-services_lib] 
[2016-02-23 14:52:42 - google-play-services_lib] C:\Android\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res\values-v21\appinvite_styles.xml:5: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.Material.Light.DialogWhenLarge.NoActionBar'.
[2016-02-23 14:52:42 - google-play-services_lib] 

1 个答案:

答案 0 :(得分:1)

自动创建项目" appcompat_v7"在eclipse中可能会导致此错误

我曾经通过以下两个步骤来解决这类错误:

1.删​​除“appcompat_v7”项目
2.由于删除了“appcompat_v7”项目,需要对所有 style.xml 文件, main.xml main_actvity.java 进行必要的更改

必要的变更:

  1. main_actvity.java 扩展活动&删除默认扩展的内容。除了OnCreate方法之外,删除main_activity类中的所有其他代码。
  2. 在样式标记内的所有style.xml中,更改parent的值。 你会发现" parent = Theme.AppCompat.Light"或者"父母=任何其他东西"
    使它成为" parent = @ android:style / Theme.Black.NoTitleBar.Fullscreen"
    即使你可以使用任何其他值的父母。我只是给了一个随机的主题。

  3. 在main.xml中执行相同的操作。

  4. 最后在运行之前清理项目。