Error:In <declare-styleable> SherlockSpinner, unable to find attribute android:popupPromptView

Error:In <declare-styleable> SherlockSpinner, unable to find attribute android:popupPromptView

我的项目包含 "ActionBar Sherlock Pull to refresh" 并在 API 级别 21 和更早版本中编译和运行良好,但是当我尝试使用 API 22 编译它时,出现此错误:

Error:In <declare-styleable> SherlockSpinner, unable to find attribute android:popupPromptView
Error:Execution failed for task ':app:processDebugResources'.

com.android.ide.common.internal.LoggedErrorException: Failed to run command: /Users/m./Android_SDK/build-tools/21.1.2/aapt package -f --no-crunch -I /Users/m./Android_SDK/platforms/android-22/android.jar -M /Users/m./AndroidStudioProjects/-android/android/build/intermediates/manifests/full/debug/AndroidManifest.xml -S /Users/m./AndroidStudioProjects/-android/android/build/intermediates/res/debug -A /Users/m./AndroidStudioProjects/-android/android/build/intermediates/assets/debug -m -J /Users/m./AndroidStudioProjects/-android/android/build/generated/source/r/debug -F /Users/m./AndroidStudioProjects/-android/android/build/intermediates/res/resources-debug.ap_ --debug-mode --custom-package ir.fax.android -0 apk --output-text-symbols /Users/m./AndroidStudioProjects/-android/android/build/intermediates/symbols/debug Error Code: 1 Output: warning: string 'dashboard_account_type_click_msg_1' has no default translation. warning: string 'dashboard_number_click_msg_1' has no default translation. warning: string 'dashboard_number_click_msg_2' has no default translation. warning: string 'dashboard_number_click_msg_3' has no default translation. warning: string 'days_after' has no default translation. warning: string 'days_before' has no default translation. warning: string 'extra_cred_response' has no default translation. warning: string 'free_pages_remaining_server_response' has no default translation. warning: string 'hours_after' has no default translation. warning: string 'hours_before' has no default translation. warning: string 'invalid' has no default translation. warning: string 'invit1' has no default translation. warning: string 'invit2' has no default translation. warning: string 'invit25' has no default translation. warning: string 'invit3' has no default translation. warning: string 'minutes_after' has no default translation. warning: string 'minutes_before' has no default translation. warning: string 'seconds_after' has no default translation. warning: string 'seconds_before' has no default translation. warning: string 'total_page_remaining_response' has no default translation. ERROR: In SherlockSpinner, unable to find attribute android:popupPromptView

如果您使用 gradle 解决方案:

android {
  compileSdkVersion 22
  buildToolsVersion '22.0.1'
[...]
}

如果您在 Eclipse 中使用 android 项目:在 SDK 管理器中将构建工具版本升级到 22.0.1。

问题原因:

/Users/m./Android_SDK/build-tools/21.1.2 应该匹配 /Users/m./Android_SDK/platforms/android-22

我下载了android SDK platform 22后遇到了同样的问题。将构建工具升级到22.0.1修复了它。