Theme.AppCompat.Light.NoActionBar
顯示爲紅色且未被識別。這是我做了什麼:使用SDK經理如何使用Intellij導入appcompat-v7
下載支持庫
推門進去,項目結構中添加一個新的圖書館,選擇的程序兼容性-v7-23.4.0-javadoc.jar和程序兼容性,v7- appcompat-7的23.4.0文件夾中的23.4.0-sources.jar文件。
選擇OK後,將appcompat-v7-23.4.0-sources添加到我的庫中。
然後我去了Modules - > Dependencies以確保appcompat-v7-23.4.0-sources被選中並點擊OK。
它沒有工作......?該行仍然無法識別,圖書館甚至沒有出現在我的libs文件夾中。我嘗試了另一種方式來複制.jar文件,將它們粘貼到我的libs文件夾中,然後右鍵單擊以從此處添加到庫,但同樣的事情發生。我怎樣才能使這個工作?我的分鐘設置爲7,目標21和清單中最多23個。 styles.xml中的錯誤是「無法解析符號」。
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="AppTheme.Base"></style>
<!-- Base theme applied no matter what API -->
<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
我試圖重建我的項目,只有這樣,我得到了以下錯誤:
Information:5/26/16, 12:29 PM - Compilation completed with 4 errors and 0 warnings in 4s 99ms
/Users/accudeveloper/Android-App-2.0/android2.0/res/values/styles.xml
Error:(5, -1) android-apt-compiler: [android2.0] /Users/accudeveloper/Android-App-2.0/android2.0/res/values/styles.xml:5: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.NoActionBar'.
Error:(8, -1) android-apt-compiler: [android2.0] /Users/accudeveloper/Android-App-2.0/android2.0/res/values/styles.xml:8: error: Error: No resource found that matches the given name: attr 'colorAccent'.
Error:(6, -1) android-apt-compiler: [android2.0] /Users/accudeveloper/Android-App-2.0/android2.0/res/values/styles.xml:6: error: Error: No resource found that matches the given name: attr 'colorPrimary'.
Error:(7, -1) android-apt-compiler: [android2.0] /Users/accudeveloper/Android-App-2.0/android2.0/res/values/styles.xml:7: error: Error: No resource found that matches the given name: attr 'colorPrimaryDark'.
這是我找到的.jar文件。這條道路看起來是否正確?基於此網站上的相關問題的答案
Android的SDK /演員/安卓/ m2repository/COM /安卓/支持/程序兼容性-V7
應該有一個程序兼容性/ RES /值目錄以及但我沒有看到。
爲什麼不使用FREE-ANDROID STUDIO,這是在GOOGLE支持下的類固醇上的intelliJ-Idea? –
我遵循的一些教程使用了IntelliJ,所以我就堅持使用它。但所有這些都讓我頭痛。我最終可能會試用Android Studio。 – terratunaz
再次,Android Studio使用相同的內核,相同的快捷方式,相同的界面。並且無需卸載IDEA,您可以安裝少量Android Studios實例。 –