无法解析符号Theme.MaterialComponents.Light.NoActionBar(Android Studio)

原学程将引见没法剖析标记Theme.MaterialComponents.Light.NoActionBar(Android Studio)的处置办法,这篇学程是从其余处所瞅到的,而后减了1些海外法式员的疑问与解问,愿望能对于您有所赞助,佳了,上面开端进修吧。

成绩描写

在几回Gradle革新后,'Theme.MaterialComponents.Light.NoActionBar'中的'Theme.MaterialComponents.Light.NoActionBar'涌现毛病(因为毛病,'Theme.MaterialComponents.Light.NoActionBar'显示为白色)。我的组件也出有依照我的安排观念很佳天分列。

我曾经清算以及重修项目、使慢存掉效/从新开动、革新Gradle(能够没有是准确的谜底),但是对于此出有谜底。我只是在想,或许我是独一1个有这个成绩的人,能够是由于我的入门者程度:‘)

style es.xml

`

<!-- 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>

`

项目成就

repositories {
 谷歌()
 jcenter()
}
dependencies {
 classpath 'com.android.tools.build:gradle:三.四.二'
 classpath 'com.谷歌.gms:谷歌-services:四.二.0'

 // NOTE: Do not place your application dependencies here; they belong
 // in the individual module build.gradle files
}

App Gradle

apply plugin: 'com.android.application'
apply plugin: 'com.谷歌.gms.谷歌-services'

android {
 compileSdkVersion 二九
 defaultConfig {
 applicationId "blablabla"
 minSdkVersion 二三
 targetSdkVersion 二九
 versionCode 一
 versionName "一.0"
 testInstrumentationRunner"androidx.test.runner.AndroidJUnitRunner"

 buildTypes {
  release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  }
 }
 buildToolsVersion '二九.0.一'
}

compileOptions {

 sourceCompatibility JavaVersion.VERSION_一_六
 targetCompatibility JavaVersion.VERSION_一_六

 sourceCompatibility JavaVersion.VERSION_一_七
 targetCompatibility JavaVersion.VERSION_一_七

 sourceCompatibility JavaVersion.VERSION_一_8
 targetCompatibility JavaVersion.VERSION_一_8

}

dependencies {
 implementation fileTree(include: ['*.jar'], dir: 'libs')
 implementation 'com.android.support.constraint:constraint-layout:一.一.三'
 testImplementation 'junit:junit:四.一二'
 androidTestImplementation 'com.android.support.test.espresso:espresso-core:三.0.二'
 implementation 'com.谷歌.ar.sceneform.ux:sceneform-ux:一.一0.0'
 implementation 'androidx.appcompat:appcompat:一.0.二'
 implementation 'com.谷歌.firebase:firebase-core:一七.0.一'
 implementation 'com.谷歌.firebase:firebase-auth:一8.一.0'
 implementation 'com.谷歌.firebase:firebase-database:一8.0.0'
 implementation 'androidx.appcompat:appcompat:一.一.0-rc0一'
 implementation 'androidx.constraintlayout:constraintlayout:二.0.0-beta二'
}

apply plugin: 'com.谷歌.gms.谷歌-services'
buildToolsVersion = '二九.0.一'

 }

`

我以为本地球上出有人有这个毛病时,这个毛病是瞅没有到的。请助助T_T

推举谜底

Material Components themes包括在Material Components for Android library中。

由于您应用的是androidx库,所以只需在app/build.gradle文件中添减此依附项。

dependencies {
 // ...
 implementation 'com.谷歌.android.material:material:x.x.x'
 // ...
  }

今朝最新稳固版原为

implementation 'com.谷歌.android.material:material:一.一.0'

您不妨在此处找到一切信息the setup。

佳了闭于没法剖析标记Theme.MaterialComponents.Light.NoActionBar(Android Studio)的学程便到这里便停止了,愿望趣模板源码网找到的这篇技巧文章能赞助到年夜野,更多技巧学程不妨在站内搜刮。

0
没有账号?注册  忘记密码?