【发布时间】:2016-07-23 13:05:12
【问题描述】:
我在 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 解决此错误
清单.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>
【问题讨论】:
-
在遇到 multidex 达到 65K 方法限制的问题之前,请阅读此内容。 developers.google.com/android/guides/setup#split