我有一个错误'Theme.MaterialComponents.Light.NoActionBar'的styles.xml(在'Theme.MaterialComponents.Light.NoActionBar'经过多次gradle这个更新是因为错误的红色)。我的组件也没有按照我的设计思路很好地排列。
我已经清理并重建项目,使缓存无效/重新启动,更新 gradle(可能不是正确答案)并且没有答案。我只是想也许我是唯一一个遇到这个问题的人,也许是因为我的初级问题:')
样式文件
`
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/hitam</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
Run Code Online (Sandbox Code Playgroud)
`
项目梯度
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Run Code Online (Sandbox Code Playgroud)
'
应用程序渐变
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
defaultConfig {
applicationId "blablabla" …Run Code Online (Sandbox Code Playgroud) java android material-components material-components-android androidx