簡體   English   中英

我不希望Android Studio繼續使用sdk 23

[英]Android Studio keeps using sdk 23 while I don't want it to

我的應用程式有一點問題。 這是我幾個月前建立的應用程式,運作正常。

昨天,我做了一個更改,做了它,試圖編譯它。

D:\android\MyApp\app\build\intermediates\res\merged\debug\values-v23\values-v23.xml
Error:(4) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Error:(34) 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 'C:\Users\xxxx\AppData\Local\Android\Sdk\build-tools\21.1.2\aapt.exe'' finished with non-zero exit value 1

我的build.gradle包含以下內容:android {compileSdkVersion 21 buildToolsVersion '21 .1.2'

    defaultConfig {
        applicationId "xxxx"
        minSdkVersion 9
        targetSdkVersion 21
        versionCode 21
        versionName "2.5"
    }
}

我不想升級到SDK 23(在類似線程中最常見的答案),我想了解這里出了什么問題,以及為什么在我從不使用該死的sdk時出現此錯誤。

有什么線索嗎?

我認為原因是Android Studio自動更新。 如果您已從Sdk管理器下載了Build-tools rev.23,請嘗試將其刪除,然后清理並重建項目。 確保compileSdkVersionbuildToolsVersiontargetSdkVersioncom.android.support:appcompat匹配相同的版本。

更新:指的是更新的build.gradle,問題出在使用動態依賴項( +符號),這將迫使gradle獲取最新的庫版本。 根據文件

(...)使用動態依賴項(例如,palette-v7:23.0。+)可能會導致意外的版本更新和回歸不兼容。 我們建議您顯式指定一個庫版本(例如,palette-v7:24.2.0)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM