Reg*_*ult 28 android intellij-idea android-appcompat android-studio
我将从我想要实现的目标开始:构建此处提供的googlecast-manager示例:https://github.com/googlecast/GameManagerSamples 我按照以下说明操作:https://developers.google.com/cast/docs/ android_sender
首先我从github下载了该项目,然后使用Android SDK Manager下载了Android支持库和Google Play服务.然后在我的项目中,我转到"打开模块设置 - >添加",然后转到"Android SDK\extras\android\support\v7\appcompat"并添加它.
然后第一步确保它的工作是构建它.所以我右键单击appcompat - >"Compile Module Appcompat"但它失败并出现2个错误:
错误:(20,-1)android-apt-compiler:[appcompat] D:\ Android SDK\extras\android\support\v7\appcompat\res\values-v23\styles_base.xml:20:错误:检索父级时出错for item:找不到匹配给定名称'android:Widget.Material.Button.Colored'的资源.
错误:(19,-1)android-apt-compiler:[appcompat] D:\ Android SDK\extras\android\support\v7\appcompat\res\values-v23\styles_base_text.xml:19:错误:检索父项时出错for item:找不到与给定名称'android:TextAppearance.Material.Widget.Button.Inverse'匹配的资源.
对Google Play执行相同操作就像魅力一样.
我试图找到视频/其他类似问题,但它太复杂或不是我的问题.
这是appcompat的AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.support.v7.appcompat">
<uses-sdk android:minSdkVersion="9"
android:targetSdkVersion="19"/>
<application />
Run Code Online (Sandbox Code Playgroud)
Inz*_* IT 56
我也遇到了同样的问题,现在已经修好了.你刚刚要做的是
compileSdkVersion和support libraries下面dependencies应该与下面的代码描述相同.build.gradle module:app并执行相同的操作.注:下载并安装适当的最新API这是现在API 23.
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "com.example.inzi.app"
minSdkVersion 9
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
}
Run Code Online (Sandbox Code Playgroud)
nat*_*rio 13
我相信你应该升级你的compileSdkVersion.检查你的build.grade文件,应该是这样的:
android {
compileSdkVersion 23 // <- here
buildToolsVersion "23.0.0" // <- here
defaultConfig {
applicationId "your.id"
minSdkVersion 11
targetSdkVersion 23 // <- and maybe here
versionCode 1
versionName "1.0"
}
buildTypes {
....
}
}
Run Code Online (Sandbox Code Playgroud)
当然,您需要从SDK Manager下载最新的Android SDK和构建工具(以及您需要的任何其他内容).
如果您在Eclipse中工作,请执行以下操作:
AndroidManifest.xml文件中更改android:targetSdkVersion为23ALT+ Enter在Project Explorer中聚焦)Android选项卡和Project Build Target部分标记Android 6.0注意:执行此操作时请注意,Android操作系统会将您的应用视为设计为在Android M上运行.因此,例如,如果您使用某些危险权限,则应添加例程以便在运行时进行检查.