我在values-v23.xml中收到这些错误:
错误:(3)检索项目的父项时出错:找不到与给定名称“android:TextAppearance.Material.Widget.Button.Inverse”匹配的资源。 错误:(18)检索项目的父项时出错:找不到与给定名称“android:Widget.Material.Button.Colored”匹配的资源。
我的build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "example.transportmanagement"
minSdkVersion 17
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.google.android.gms:play-services:8.4.0'
}
我想在API 21编译。我读了很多问题,但是被告知要将sdkversion更改为23.如何使用API 21解决此错误
的Manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.transportmanagement"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="@drawable/im4"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity
android:name="example.transportmanagement.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>
<activity
android:name="example.transportmanagement.SignUp"
android:label="@string/app_name">
<intent-filter>
<action android:name="com.example.transportmanagement.SignUp" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="example.transportmanagement.Login"
android:label="@string/app_name">
<intent-filter>
<action android:name="com.example.transportmanagement.Login" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="example.transportmanagement.SelectAddress"
android:label="@string/app_name">
<intent-filter>
<action android:name="com.example.transportmanagement.SelectAddress" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="example.transportmanagement.Driver"
android:label="@string/app_name">
<intent-filter>
<action android:name="com.example.transportmanagement.Driver" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="example.transportmanagement.FindBus"
android:label="@string/app_name">
<intent-filter>
<action android:name="com.example.transportmanagement.FindBus" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="example.transportmanagement.MapsActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="com.example.transportmanagement.MapsActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="example.transportmanagement.DriverMaps"
android:label="@string/app_name">
<intent-filter>
<action android:name="com.example.transportmanagement.DriverMaps" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />
</application>
</manifest>
答案 0 :(得分:0)
如果要编译API 21,为什么项目中的文件值为v23?
如果你使用Valuev 23 android studio了解你想要一个API 23应用程序。
因此,请尝试删除此文件或使用v21重命名该文件。它应该工作
答案 1 :(得分:0)
您可以使用SDK和Build工具23进行编译,并且仍然可以在API 17..21
上定位和运行代码