应用程序不会针对此错误运行:无法执行aapt

时间:2017-09-07 20:09:41

标签: android

我下载了一个源代码,只是在我的android工作室中导入。现在我的项目显示了这个错误。

Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies]
/home/td/Downloads/link/app/build/intermediates/res/merged/debug/values-v24/values-v24.xml
Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
Error:(4) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
Error:(4) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

问题表明此文件

..../link/app/build/intermediates/res/merged/debug/values-v24/values-v24.xml

我怎样摆脱这个。我搜索了几件事。他们中的一些人正在讲述改变minSDKversion,但这不起作用。

这是我的gradle文件

apply plugin: 'com.android.application'

android {     compileSdkVersion 23     buildToolsVersion '25 .0.0'

defaultConfig {
    applicationId "com.creativedroids.link"
    minSdkVersion 14
    targetSdkVersion 23
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}
}
dependencies {
compile 'com.android.support:support-v4:23.4.0'
compile 'com.google.android.gms:play-services:+'
compile files('libs/dagger-1.2.2.jar')
compile files('libs/javax.inject-1.jar')
compile files('libs/nineoldandroids-2.4.0.jar')
compile files('libs/tapjoyconnectlibrary.jar')
compile files('libs/tween-engine-api-sources.jar')
compile files('libs/tween-engine-api.jar')
compile files('libs/vungle-publisher-adaptive-id-3.3.2.jar')
}

4 个答案:

答案 0 :(得分:1)

  

您的编译SDK版本必须与支持库的主要版本匹配   版本

您可以在下面问题中提到的gradle文件中执行此操作

Error retrieving parent for item: No resource found that matches the given name after upgrading to AppCompat v23

答案 1 :(得分:0)

如果您正在使用最新的播放服务,那么您必须使用新的sdk进行编译 - 至少26个。

  

将应用程序的Play服务依赖项升级到11.2.0或更高版本时,还必须更新应用程序的build.gradle,以指定至少为26(Android O)的compileSdkVersion。

https://developers.google.com/android/guides/releases

答案 2 :(得分:0)

我认为您只需将compileSdkVersion更新为25。

就我而言,这就是它的工作原理:

compileSdkVersion 26
buildToolsVersion '26.0.2'

显然我在API 26上。

答案 3 :(得分:0)

这意味着您的compileSdkVersion应该与支持lib v24相匹配

compileSdkVersion更改为24