2015-10-09 30 views
1

我下載了新的Android Studio 1.4。Android Studio 1.4使用比API 23更低的API進行編譯(示例API 22)

我想編寫和編譯與API 22,而不是23 API代碼,即使我在搖籃改變targetSdkVersion 22和compileSdkVersion 22(當然其同步的)我得到這個錯誤:

Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.

Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.

Error:Execution failed for task ':app:processDebugResources'.

com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException: Process 'command '/Users/sedkol /Code/adt-bundle-mac-x86_64-20140702/sdk/build-tools/23.0.1/aapt'' finished with non-zero exit value 1

此外,當我改變compileSdkVersiontargetSdkVersion至22

compile 'com.android.support:appcompat-v7:23.0.1' 
compile 'com.android.support:design:23.0.1' 

都強調,當我在它懸停說:

此支持庫不應使用與compileSdkVersion (22)不同的版本(23)。有一些庫或工具和庫的組合不兼容或可能導致錯誤。這樣一個不兼容的一個版本是不是最新版本的Android支持庫的編譯(或特別版本低於您targetSdkVersion

回答

0

更改程序兼容性的版本相同,您的目標SDK:

com.android.support:appcompat-v7:22.0.0'

,如果需要,還從Android SDK中下載新的急需物品

+0

錯誤:(12,21)找不到與給定名稱相匹配的資源:attr'windowNoTitle'。 – user4938227

+0

錯誤:(4,21)找不到與給定名稱相匹配的資源:attr'windowNoTitle'。 – user4938227

+0

錯誤:執行任務':app:processDebugResources'失敗。 > com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:Process'command'/ Users/sedkol/Code/adt-bundle-mac-x86_64-20140702/sdk/build-tools /23.0.1/aapt''以非零退出值結束1 – user4938227

0

您必須更改程序兼容性版本到與您的targetSdkVersioncompileSdkVersion

你的情況,這將是:

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

更改後的程序兼容性版本,則必須使用同步的gradle文件的項目。

相關問題