以下我的styles.xml中以“ android:”开头的每个属性都给我一个“无法解析符号”错误。好像已经有一段时间了,所以我不确定它从哪里开始以及是什么原因引起的。删除“ android:”会在构建日志中显示“资源链接失败”错误。
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:windowContentOverlay">@null</item>
</style>
<style name="TheoTheme" parent="AppTheme">
<item name="colorAccent">@color/Accent</item>
<item name="android:colorBackground">@color/lightBackground</item>
</style>
<style name="TheoTheme.ActionBarReverse" parent="TheoTheme">
<item name="android:textColorPrimary">@color/text_color_primary</item>
</style>
<style name="PurpleTheme" parent="TheoTheme">
<item name="colorAccent">@color/Accent2</item>
</style>
<style name="ChatRoomTheme" parent="TheoTheme">
<item name="colorAccent">@color/Accent</item>
</style>
<style name="LoginTheme" parent="TheoTheme" >
<item name="android:colorBackground">@color/colorPrimary</item>
</style>
<style name="RegisterTheme" parent="TheoTheme">
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="FirebaseUI.AuthMethodPicker.Logo">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="gravity">center</item>
</style>
<style name="GenericProgressBackground" parent="android:Theme">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">fill_parent</item>
<item name="android:background">@color/colorPrimaryDark</item>
<item name="android:gravity">center</item>
</style>
<style name="GenericProgressIndicator" parent="@android:style/Widget.ProgressBar">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:indeterminate">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="DMTheme.AppTheme" parent="ChatRoomTheme" />
build.gradle文件:
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
signingConfigs {
ReleaseKey {
file('X:\\Documents\\All\\Creative\\Programming\\Projects\\KeyStore\\TheoKeyStore.jks')
}
}
compileSdkVersion 28
defaultConfig {
applicationId "app.meettheo.theo"
minSdkVersion 19
targetSdkVersion 28
versionCode 5
versionName "0.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.ReleaseKey
}
debug {
signingConfig signingConfigs.ReleaseKey
}
}
lintOptions {
checkReleaseBuilds false
}
}
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v13:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'android.arch.paging:runtime:1.0.1'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'org.jetbrains:annotations:16.0.2'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'com.google.android.gms:play-services-ads:17.0.0'
implementation 'com.google.android.gms:play-services-places:16.0.0'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.facebook.android:facebook-android-sdk:4.38.1'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.firebaseui:firebase-ui-auth:4.2.0'
implementation 'com.google.firebase:firebase-firestore:17.1.3'
implementation 'com.firebaseui:firebase-ui-firestore:4.1.0'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-ads:17.0.0'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.6@aar') {
transitive = true
}
}
apply plugin: 'com.google.gms.google-services'
无效/清理/重建无效。为了实现这一目标,我做了什么?
答案 0 :(得分:1)
我认为您可以尝试以下解决方案:
对于某些人来说,只需要从.idea文件夹中删除所有库并重新同步Gradle即可。
如果这些都不起作用,您总是可以重新安装整个Studio,这取决于您的网络速度,花费的时间不会太长。
答案 1 :(得分:0)
转到gradle,注释掉您正在使用的支持库,同步项目,您将得到错误。然后取消注释库并再次同步。现在,该项目将成功构建,并且有可能解决您的问题。我不确定这是怎么造成的,但是当缓存/清理/重建失败时,上述解决方案过去对我有用。
编辑:还取决于您可能想要添加app:而不是android的属性:
答案 2 :(得分:0)