嘗試使用this庫編譯項目。 IntelliJ IDEA 12在themes.xml中的非標準元素上顯示錯誤,並且不編譯。IntelliJ IDEA 12和themes.xml中的非標準項目
項目:
<style name="SampleTheme" parent="android:Theme.Holo">
<item name="numberPickerUpButtonStyle">@style/NPWidget.Holo.ImageButton.NumberPickerUpButton</item>
<item name="numberPickerDownButtonStyle">@style/NPWidget.Holo.ImageButton.NumberPickerDownButton</item>
<item name="numberPickerInputTextStyle">@style/NPWidget.Holo.EditText.NumberPickerInputText</item>
<item name="numberPickerStyle">@style/NPWidget.Holo.NumberPicker</item>
</style>
錯誤:
android-apt-compiler: [samples] /Users/max/work/libs/android-numberpicker/samples/res/values/themes.xml:5: error: Error: No resource found that matches the given name: attr 'numberPickerDownButtonStyle'.
android-apt-compiler: [samples] /Users/max/work/libs/android-numberpicker/samples/res/values/themes.xml:6: error: Error: No resource found that matches the given name: attr 'numberPickerInputTextStyle'.
android-apt-compiler: [samples] /Users/max/work/libs/android-numberpicker/samples/res/values/themes.xml:7: error: Error: No resource found that matches the given name: attr 'numberPickerStyle'.
android-apt-compiler: [samples] /Users/max/work/libs/android-numberpicker/samples/res/values/themes.xml:4: error: Error: No resource found that matches the given name: attr 'numberPickerUpButtonStyle'.
如果你使用和其他圖書館也會出現此問題。
如何解決這個問題?
,我仍然面臨着這個問題。 –
@IgorGanapolsky:請分享一個在命令行中構建的示例項目,但在IDEA中失敗。 – CrazyCoder
該問題的主要原因是attrs.xml需要具有上述樣式引用。此外,包含這些樣式引用的項目需要在Idea中設置爲庫項目。一旦完成,該項目建好。這不是SDK版本造成的。 –