错误没有发现与给定名称theme.AppCompat.light.darkactionbar匹配的资源.Android



d: documents Learn testing myApplication app build intermediates res res merged debug debug values values.xml

错误:(7)错误检索项目的错误:找不到资源 匹配给定名称'theme.appcompat.light.darkactionbar'。

我安装了Android Studio 2.1,并试图学习Mockito。

但是,它没有创建模拟对象,因为它没有识别@mock注释(编译错误)。

所以我安装了Android支持库33.0。现在我得到错误:找不到与给定名称theme.appcompat.light.darkactionbar

匹配的资源

我将Android Studio更新为2.1.2,但没有区别。

任何帮助。

Information:Gradle tasks [:app:generateDebugSources, :app:prepareDebugUnitTestDependencies, :app:mockableAndroidJar,
 :app:compileDebugUnitTestSources]

 :app:preBuild UP-TO-DATE
 :app:preDebugBuild UP-TO-DATE
 :app:checkDebugManifest
 :app:prepareDebugDependencies
 :app:compileDebugAidl UP-TO-DATE
 :app:compileDebugRenderscript UP-TO-DATE
 :app:generateDebugBuildConfig UP-TO-DATE
 :app:mergeDebugShaders UP-TO-DATE
 :app:compileDebugShaders UP-TO-DATE
 :app:generateDebugAssets UP-TO-DATE
 :app:mergeDebugAssets UP-TO-DATE
 :app:generateDebugResValues UP-TO-DATE
 :app:generateDebugResources UP-TO-DATE
 :app:mergeDebugResources UP-TO-DATE
 :app:processDebugManifest UP-TO-DATE
 :app:processDebugResources
 D:DocumentsLearnTestingMyApplicationappbuildintermediatesresmergeddebugvaluesvalues.xml
 Error:(7) Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
 D:DocumentsLearnTestingMyApplicationappsrcmainresvaluesstyles.xml
 Error:(4, 5) No resource found that matches the given name: attr 'colorAccent'.
 Error:(4, 5) No resource found that matches the given name: attr 'colorPrimary'.
 Error:(4, 5) No resource found that matches the given name: attr 'colorPrimaryDark'.
 Error:Execution failed for task ':app:processDebugResources'.
 > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 
 'D:Androidbuild-tools23.0.3aapt.exe'' finished with non-zero exit value 1
 Information:BUILD FAILED
 Information:Total time: 6.239 secs
 Information:5 errors
 Information:0 warnings
 Information:See complete output in console

我的gradle文件在这里:

apply plugin: 'com.android.application'
android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"
    defaultConfig {
        applicationId "me.com.myapplication"
        minSdkVersion 22
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile 'com.android.support.test:runner:0.4'
    testCompile 'junit:junit:4.12'
    testCompile 'org.mockito:mockito-core:1.10.19'
}

我找到了这篇文章

并将清单中的主题更改为

<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
</style>

修复了它!

相关内容

  • 没有找到相关文章

最新更新