Kew*_*hah 2 xml android-theme android-studio
我的项目构建和运行顺利,但是在styles.xml中,"Theme"以红色突出显示,每次我将项目提交给Git时都会注意到这个错误:
Error:(4, 36) Cannot resolve symbol 'Theme'
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>
Run Code Online (Sandbox Code Playgroud)
请注意,我已尝试将我的项目与gradle文件同步,并确保google()在我的buildscript块中存在,build.gradle如下面这些问题的答案中所述:
2] 无法在styles.xml(Android Studio)中解析符号'Theme'
这些问题中接受/最高投票的答案并没有解决我的问题,请帮忙
要解决此问题,请从build.gradle中删除这些库
com.android.support:appcompat-v7:27.1.1
com.android.support:design:27.1.1
同步和撤消删除并再次同步