gpt4 book ai didi

java - Material 设计向后兼容android :colorAccent requires API level 21 when using appcompat7

转载 作者:IT老高 更新时间:2023-10-28 21:13:27 24 4
gpt4 key购买 nike

我在 eclipse 中有一个 maven android 项目,即使我已将项目配置为使用兼容性库,它仍然在我的 styles.xml 中给出以下错误:

android:colorAccent requires API level 21 (current min is 15)    
android:colorPrimary requires API level 21 (current min is 15)
android:colorPrimaryDark requires API level 21 (current min is 15)

style.xml

<style name="AppBaseTheme" parent="Theme.AppCompat"></style>
<style name="AppTheme" parent="AppBaseTheme">

<item name="android:colorPrimary">@color/primary</item>
<item name="android:colorPrimaryDark">@color/primary_dark</item>
<item name="android:colorAccent">@color/accent</item>

</style>

AndroidManifest.xml

package="com.app"
android:versionCode="1"
android:versionName="0.0.1-SNAPSHOT" >

<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.INTERNET"/>

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity android:name="com.app.activity.MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

pom.xml

<build>
<finalName>${project.artifactId}</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>${android.plugin.version}</version>
<extensions>true</extensions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<configuration>
<sdk>
<platform>21</platform>
</sdk>
</configuration>
</plugin>

</plugins>

</build>

我希望我的应用程序 Material 设计功能具有向后兼容性支持。我怎样才能解决这个问题?

最佳答案

关于java - Material 设计向后兼容android :colorAccent requires API level 21 when using appcompat7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26947276/

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