微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

android – 构建应用程序时出现“找不到资源”错误

我想将 Eclipse项目迁移到 Android Studio.我曾经使用minSdkVersion = 8构建项目,但我想添加需要minSdkVersion 10的新功能.

我正在运行Android Studio 1.1.0.导入Eclipse项目(主AS屏幕上的“导入项目”)后,进入“项目结构”窗口,选择“Flavors”选项卡,并为min sdk和target sdk指定API 10(Gingerbread).当我重建项目时,我在控制台中收到100多个错误,如下所示:

information:Gradle tasks [clean,:jellyWatch:compileDebugSources]
:jellyWatch:clean
:jellyWatch:preBuild UP-TO-DATE
:jellyWatch:preDebugBuild UP-TO-DATE
:jellyWatch:checkDebugManifest
:jellyWatch:preReleaseBuild UP-TO-DATE
:jellyWatch:prepareComAndroidSupportAppcompatV72200Library
:jellyWatch:prepareComAndroidSupportMediarouterV72200Library
:jellyWatch:prepareComAndroidSupportSupportV42200Library
:jellyWatch:prepareComGoogleAndroidGmsPlayServices750Library
:jellyWatch:prepareComGoogleAndroidGmsPlayServicesAds750Library
:jellyWatch:prepareComGoogleAndroidGmsPlayServicesAnalytics750Library
:jellyWatch:prepareComGoogleAndroidGmsPlayServicesAppindexing750Library
:jellyWatch:prepareComGoogleAndroidGmsPlayServicesAppinvite750Library
:jellyWatch:prepareComGoogleAndroidGmsPlayServicesAppstate750Library
:jellyWatch:prepareComGoogleAndroidGmsPlayServicesBase750Library
:jellyWatch:prepareComGoogleAndroidGmsPlayServicesCast750Library
:jellyWatch:prepareComGoogleAndroidGmsPlayServicesDrive750Library
:jellyWatch:prepareComGoogleAndroidGmsPlayServicesfitness750Library
:jellyWatch:prepareComGoogleAndroidGmsPlayServicesGames750Library
:jellyWatch:prepareComGoogleAndroidGmsPlayServicesGcm750Library
:jellyWatch:prepareComGoogleAndroidGmsPlayServicesIdentity750Library
:jellyWatch:prepareComGoogleAndroidGmsPlayServicesLocation750Library
:jellyWatch:prepareComGoogleAndroidGmsPlayServicesMaps750Library
:jellyWatch:prepareComGoogleAndroidGmsPlayServicesNearby750Library
:jellyWatch:prepareComGoogleAndroidGmsPlayServicesPanorama750Library
:jellyWatch:prepareComGoogleAndroidGmsPlayServicesPlus750Library
:jellyWatch:prepareComGoogleAndroidGmsPlayServicesSafetynet750Library
:jellyWatch:prepareComGoogleAndroidGmsPlayServicesWallet750Library
:jellyWatch:prepareComGoogleAndroidGmsPlayServicesWearable750Library
:jellyWatch:prepareDebugDependencies
:jellyWatch:compileDebugAidl
:jellyWatch:compileDebugRenderscript
:jellyWatch:generateDebugBuildConfig
:jellyWatch:generateDebugAssets UP-TO-DATE
:jellyWatch:mergeDebugAssets
:jellyWatch:generateDebugResValues UP-TO-DATE
:jellyWatch:generateDebugResources
:jellyWatch:mergeDebugResources
/Users/oreilly/Documents/workspace/JellyWatch1/jellyWatch/src/main/res/drawable/creative_commons.png: libpng warning: iCCP: Not recognizing kNown sRGB profile that has been edited
/Users/oreilly/Documents/workspace/JellyWatch1/jellyWatch/src/main/res/drawable/mapmarker.png: libpng warning: iCCP: Not recognizing kNown sRGB profile that has been edited
/Users/oreilly/Documents/workspace/JellyWatch1/jellyWatch/src/main/res/drawable/other_29.png: libpng warning: iCCP: Not recognizing kNown sRGB profile that has been edited
/Users/oreilly/Documents/workspace/JellyWatch1/jellyWatch/src/main/res/drawable/license_label.png: libpng warning: iCCP: Not recognizing kNown sRGB profile that has been edited
/Users/oreilly/Documents/workspace/JellyWatch1/jellyWatch/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.0.0/res/drawable-hdpi-v4/abc_spinner_mtrl_am_alpha.9.png: libpng warning: iCCP: Not recognizing kNown sRGB profile that has been edited
/Users/oreilly/Documents/workspace/JellyWatch1/jellyWatch/src/main/res/drawable/mapmarker_large.png: libpng warning: iCCP: Not recognizing kNown sRGB profile that has been edited
:jellyWatch:processDebugManifest
:jellyWatch:processDebugResources
/Users/oreilly/Documents/workspace/JellyWatch1/jellyWatch/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.0.0/res/values-v11/values.xml
Error:(47,21) No resource found that matches the given name: attr ‘android:actionModeShareDrawable’.
Error:(47,21) No resource found that matches the given name: attr ‘android:actionModeShareDrawable’.
/Users/oreilly/Documents/workspace/JellyWatch1/jellyWatch/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.0.0/res/values-v14/values.xml
Error:(17,21) No resource found that matches the given name: attr ‘android:actionModeShareDrawable’.
Error:(17,21) No resource found that matches the given name: attr ‘android:actionModeShareDrawable’.
/Users/oreilly/Documents/workspace/JellyWatch1/jellyWatch/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.0.0/res/values-v17/values.xml
Error:(7,21) No resource found that matches the given name: attr ‘android:paddingEnd’.
Error:(11,21) No resource found that matches the given name: attr ‘android:layout_marginEnd’.
Error:(10,21) No resource found that matches the given name: attr ‘android:paddingStart’.
Error:(7,21) No resource found that matches the given name: attr ‘android:paddingEnd’.
Error:(10,21) No resource found that matches the given name: attr ‘android:paddingEnd’.
Error:(21,21) No resource found that matches the given name: attr ‘android:layout_marginStart’.
Error:(24,21) No resource found that matches the given name: attr ‘android:layout_alignParentStart’.
Error:(25,21) No resource found that matches the given name: attr ‘android:textAlignment’.
Error:(7,21) No resource found that matches the given name: attr ‘android:paddingStart’.
Error:(24,21) No resource found that matches the given name: attr ‘android:layout_alignParentStart’.
Error:(35,21) No resource found that matches the given name: attr ‘android:layout_toStartOf’.
Error:(38,21) No resource found that matches the given name: attr ‘android:layout_alignParentEnd’.
Error:(42,21) No resource found that matches the given name: attr ‘android:layout_toEndOf’.
Error:(35,21) No resource found that matches the given name: attr ‘android:layout_toStartOf’.
Error:(21,21) No resource found that matches the given name: attr ‘android:layout_marginStart’.
/Users/oreilly/Documents/workspace/JellyWatch1/jellyWatch/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.0.0/res/values-v21/values.xml
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Body1’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Body2’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Button’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Caption’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.display1’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.display2’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.display3’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.display4’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Headline’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Inverse’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Large’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Large.Inverse’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Widget.PopupMenu.Large’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Widget.PopupMenu.Small’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Medium’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Medium.Inverse’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Menu’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.SearchResult.Subtitle’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.SearchResult.Title’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Small’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Small.Inverse’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Subhead’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Title’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Widget.ActionBar.Menu’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Widget.ActionBar.Subtitle’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Widget.ActionBar.Subtitle.Inverse’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Widget.ActionBar.Title’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Widget.ActionBar.Title.Inverse’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Widget.ActionMode.Subtitle’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Widget.ActionMode.Title’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Widget.PopupMenu.Large’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Widget.PopupMenu.Small’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Button’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Widget.TextView.SpinnerItem’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Widget.ActionBar.Subtitle’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Widget.ActionBar.Title’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:ThemeOverlay.Material’.
Error:(79,21) No resource found that matches the given name: attr ‘android:colorControlHighlight’.
Error:(78,21) No resource found that matches the given name: attr ‘android:colorControlnormal’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:ThemeOverlay.Material.ActionBar’.
Error:(79,21) No resource found that matches the given name: attr ‘android:colorControlnormal’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:ThemeOverlay.Material.Dark’.
Error:(79,21) No resource found that matches the given name: attr ‘android:colorControlnormal’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:ThemeOverlay.Material.Dark.ActionBar’.
Error:(79,21) No resource found that matches the given name: attr ‘android:colorControlnormal’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:ThemeOverlay.Material.Light’.
Error:(79,21) No resource found that matches the given name: attr ‘android:colorControlnormal’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Widget.Material.ActionBar.TabText’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Widget.Material.ActionBar.TabView’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Widget.Material.ActionButton’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Widget.Material.ActionButton.CloseMode’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Widget.Material.ActionButton.Overflow’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Widget.Material.AutoCompleteTextView’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Widget.Material.Button’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Widget.Material.Button.Small’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Widget.Material.DropDownItem.Spinner’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Widget.Material.Light.ActionBar.TabText’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Widget.Material.Light.ActionBar.TabText’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Widget.Material.Light.ActionBar.TabView’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Widget.Material.Light.PopupMenu’.
Error:(285,21) No resource found that matches the given name: attr ‘android:overlapAnchor’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Widget.Material.ListPopupWindow’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Widget.Material.ListView.DropDown’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Widget.Material.ListView’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Widget.Material.PopupMenu’.
Error:(285,21) No resource found that matches the given name: attr ‘android:overlapAnchor’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Widget.Material.ProgressBar’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Widget.Material.ProgressBar.Horizontal’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Widget.Material.ratingBar’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Widget.Material.Spinner’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Widget.Material.Spinner’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Widget.Material.Spinner.Underlined’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Widget.Material.TextView.SpinnerItem’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Widget.Material.Toolbar.Button.Navigation’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Theme.Material’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Theme.Material.Dialog’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Theme.Material.Light’.
Error:(1) Error retrieving parent for item: No resource found that matches the given name ‘android:Theme.Material.Light.Dialog’.
Error:(146,21) No resource found that matches the given name: attr ‘android:colorAccent’.
Error:(148,21) No resource found that matches the given name: attr ‘android:colorControlActivated’.
Error:(79,21) No resource found that matches the given name: attr ‘android:colorControlnormal’.
Error:(144,21) No resource found that matches the given name: attr ‘android:colorPrimary’.
Error:(145,21) No resource found that matches the given name: attr ‘android:colorPrimaryDark’.
Error:(146,21) No resource found that matches the given name: attr ‘android:colorPrimaryDark’.
Error:Execution Failed for task ‘:jellyWatch:processDebugResources’.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘/Users/oreilly/android-sdk-macosx/build-tools/21.1.2/aapt” finished with non-zero exit value 1
Blockquote

有什么想法我得到这些错误?如何解决这个问题?

谢谢!
汤姆

解决方法

问题的原因和解决方案是由于我指定的minSdkVersion和app-compat库之间不兼容,如 here所述.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐