2014-10-02 151 views
0

我想修改構建在IntelliJ上的現有Android項目。 我已經搜索並嘗試了很多東西,但仍然是我的錯誤不走:\編譯時出錯:Android Studio

Error:(5, -1) android-apt-compiler: [main] D:\android\tinynote\app\src\main\res\values\theme.xml:5:  
error: Error retrieving parent for item: No resource found that matches the given name 
'@style/Theme.AppCompat'. 

我能做些什麼?提前致謝。

具體來說,誤差在theme.xml

<?xml version="1.0" encoding="utf-8"?> 

<resources> 

<style name="Theme.Bootstrap.Dark" parent="@style/Theme.AppCompat"> 
    <item name="android:windowBackground">@color/pager_background</item> 
    <item name="actionBarStyle">@style/Widget.Styled.ActionBar</item> 
    <item name="android:actionBarStyle">@style/Widget.Styled.ActionBar</item> 
</style> 

<style name="Widget.Styled.ActionBar" parent="@style/Widget.AppCompat.ActionBar.Solid"> 
    <item name="background">@drawable/actionbar_background</item> 
    <item name="android:background">@drawable/actionbar_background</item> 
</style> 

+0

好像你沒有程序兼容性配置得當 – 2014-10-02 13:06:52

+0

@Manish你能否詳細說明一下?我不知道該怎麼做。 – 2014-10-02 13:11:58

+0

@Damian Walczak我已經嘗試了很多東西。沒有工作。您能否詳細說明我需要做些什麼來消除這個錯誤。現在已經有3-4個小時了。 – 2014-10-02 13:26:59

回答

0

嘗試增加

dependencies { 
compile 'com.android.support:appcompat-v7:20.+' 
} 

build.gradle文件

+0

仍然存在相同的錯誤。 – 2014-10-02 13:10:31

+0

我在build.gradle中添加了這個,但仍然收到相同的錯誤。 – 2014-10-02 13:28:02

+0

你運行過同步gradle嗎? – 2014-10-02 13:37:22