无法解析@ style / Theme.AppCompat.Light.NoActionBar

时间:2017-07-04 21:54:04

标签: android android-studio android-support-library android-appcompat android-theme

我有一个AppCompatActivity,我想要运行我的代码。我在活动开始时收到此错误:

  

您需要将Theme.AppCompat主题(或后代)与此活动一起使用

如果我使用Theme.AppCompat,因为它建议我,但我得到了这个:

  

无法解析@ style / Theme.AppCompat.Light.NoActionBar

在AndroidManifest.xml中,也不在我可以使用的样式文件中。

我正在使用这些依赖项:

compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:design:25.3.1'
compile 'com.google.firebase:firebase-database:10.2.0'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.parse:parse-android:1.15.8'
compile 'com.google.firebase:firebase-auth:10.2.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile "com.android.support:support-core-utils:25.4.0"
compile 'com.android.support:appcompat-v7:25.4.0'
compile 'com.android.support:support-v4:25.4.0'

3 个答案:

答案 0 :(得分:0)

清洁&重建你的项目!

答案 1 :(得分:0)

我认为你应该使用Activity而不是AppCompatActivity

检查这个答案: https://stackoverflow.com/a/21815015/8239508

答案 2 :(得分:0)

您在依赖项中混合了android支持库版本。确保所有com.android.support:*具有相同的版本号。

相关问题