gpt4 book ai didi

android - 无法将 android-support-v7-appcompat 连接到我的项目

转载 作者:太空宇宙 更新时间:2023-11-03 10:19:26 28 4
gpt4 key购买 nike

我从 developer.android.com 下载了一个示例

IntellijIDEA 中导入并全部导入。接下来,我想将库 android-support-v7-appcompat 连接到我的项目。我按照说明做了:

还有很多其他的。在所有情况下,我都有同样的错误。当你编译项目时 IntellijIDEA 说没有资源:

错误屏幕 http://www.fayloobmennik.net/4303361

Error:android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v2
Error:android-apt-compiler: [android-support-v7-appcompat] 1\themes_base.xml:41: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Light.Dialog'.
Error:android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\va
Error:android-apt-compiler: [android-support-v7-appcompat] lues-v21\themes_base.xml:153: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'.
C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml
Error:(75, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:75: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton'.
Error:(79, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:79: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton.CloseMode'.
Error:(83, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:83: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton.Overflow'.
Error:(25, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:25: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionBar.TabView'.
Error:(29, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:29: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabView'.
Error:(33, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:33: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionBar.TabText'.
Error:(37, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:37: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabText'.
Error:(41, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:41: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabText'.
Error:(65, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:65: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Title'.
Error:(69, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:69: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Subtitle'.
Error:(45, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:45: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Menu'.
Error:(49, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:49: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title'.
Error:(53, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:53: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle'.
Error:(57, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:57: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title.Inverse'.
Error:(61, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:61: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle.Inverse'.
Error:(178, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:178: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ProgressBar.Horizontal'.
Error:(182, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:182: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ProgressBar'.
Error:(113, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:113: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner'.
Error:(115, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:115: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner'.
Error:(110, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:110: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.DropDownItem.Spinner'.
Error:(107, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:107: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListView.DropDown'.
Error:(121, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:121: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListView'.
Error:(126, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:126: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListPopupWindow'.
Error:(138, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:138: error: Error: No resource found that matches the given name: attr 'android:overlapAnchor'.
Error:(143, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:143: error: Error: No resource found that matches the given name: attr 'android:overlapAnchor'.
Error:(129, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:129: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.PopupMenu'.
Error:(132, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:132: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.PopupMenu'.
Error:(146, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:146: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Large'.
Error:(150, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:150: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Small'.
Error:(154, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:154: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Large'.
Error:(158, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:158: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Small'.
Error:(164, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:164: error: Error retrieving parent for item: No resource found that matches the given name '@android:TextAppearance.Material.SearchResult.Title'.
Error:(168, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:168: error: Error retrieving parent for item: No resource found that matches the given name '@android:TextAppearance.Material.SearchResult.Subtitle'.
Error:(172, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:172: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.AutoCompleteTextView'.
Error:(174, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:174: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.AutoCompleteTextView'.
Error:(93, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:93: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Toolbar.Button.Navigation'.
Error:(97, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:97: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title'.
Error:(101, -1) android-apt-compiler: [android-support-v7-appcompat] C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base.xml:101: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle'.
C:\Users\Pavel\Desktop\appcompat\res\values-v21\styles_base_text.xml
C:\Users\Pavel\Desktop\appcompat\res\values-v17\styles_rtl.xml
C:\Users\Pavel\Desktop\appcompat\res\values-v21\themes_base.xml
C:\Users\Pavel\Desktop\appcompat\res\values-v11\themes_base.xml
C:\Users\Pavel\Desktop\appcompat\res\values-v14\themes_base.xml

list

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.navigationdrawerexample"
android:versionCode="1"
android:versionName="1.0">

<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="17" />

<application
android:label="@string/app_name"
android:icon="@drawable/ic_launcher"
android:theme="@style/Theme.AppCompat.Light">

<activity
android:name=".MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

</application>

</manifest>

最佳答案

在您的项目中,将 Android Build Target 更改为 5.0

要支持 values-v21,您的构建目标应该是 5.0


转到 文件 -> “项目结构”

Platform Settings -> SDKs 下,您可以看到 android sdk 路径、类路径和构建目标。

首先使用 sdk 管理器使用最新的构建目标更新您的 sdk。

如果您的 sdk 不是最新的,那么在类路径中您可以看到低于 21 的 android 版本。

如果你有最新的,那么你可以看到,类路径选择到\android-21\android.jar。

在您的模块设置中,您可以看到“构建工具版本”。

Android Studio (IntelliJ IDEA) 将采用最新的构建版本。所以首先将您的 sdk 管理器更新到最新版本。

关于android - 无法将 android-support-v7-appcompat 连接到我的项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26836386/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com