2017-04-09 52 views
0

Android Studio中强调了 Theme.AppCompat.Light.DarkActionBar 无法解析符号Theme.AppCompat.Light.DarkActionBar不能解析符号

我的Android Studio版本是2.2和摇篮的版本是3.3我有最新的Android支持存储库(47.0.0)已安装。我正在使用的app-compat-v7:25.3.1库可在SDK文件夹中找到。

请帮忙解决这个问题。

我build.grade文件是: 应用插件: 'com.android.application'

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.2" 
    defaultConfig { 
     applicationId "com.example.app" 
     minSdkVersion 15 
     targetSdkVersion 25 
     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 'com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1' 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    compile 'com.android.support:appcompat-v7:25.3.1' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    compile 'com.android.support:design:25.3.1' 
    testCompile 'junit:junit:4.12' 
} 

我styles.xml是:

<resources> 

    <!-- Base application theme. --> 
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> 
     <!-- Customize your theme here. --> 
     <item name="colorPrimary">@color/colorPrimary</item> 
     <item name="colorPrimaryDark">@color/colorPrimaryDark</item> 
     <item name="colorAccent">@color/colorAccent</item> 

    </style> 
    <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /> 

    <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /> 
</resources> 
+0

尝试更改您的'minSdkVersion表格15至16' ... – rafsanahmad007

+0

如果您遇到类似错误,则需要显示堆栈跟踪。 –

+0

只是更新一切! (android studio和SDK和支持库) –

回答

0

我不得不运行科特林当同样的问题我试图在我的风格上使用ThemeOverlay.AppCompat.Dark.ActionBar。只有当我将minSdkVersion表格15更改为17时,我才能修复它。没有这个改变,Gradle会无限循环。谢谢。

我一起工作: 的Android 3.0.1工作室构建 #AI-171.4443003,建于2017年11月9日 JRE:1.8.0_152释放-915-B01 AMD64 JVM:OpenJDK的64位服务器VM通过JetBrains sro Windows 10 10.0