Некоторые атрибуты Android не разрешены в файле styles.xml - PullRequest
0 голосов
/ 07 декабря 2018

Каждый атрибут с предваряющим значением «android:» в моем файле styles.xml ниже выдает ошибку «не удается разрешить символ».Это было какое-то время, поэтому я не уверен, где это началось и чем это вызвано.Удаление «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 file:

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'

Аннулирование / очистка / восстановление не работает.Что я сломал, чтобы это произошло?

Ответы [ 3 ]

0 голосов
/ 12 декабря 2018

У меня была эта проблема в течение некоторого времени, и это также разозлило меня.

Угадайте, каково решение?Это так же просто, как повторный импорт проекта через File -> Open:

enter image description here

После этого все ресурсы были правильно разрешены.

0 голосов
/ 17 декабря 2018

Я думаю, что вы можете попробовать следующее решение:

  • Резервное копирование проекта
  • Удалите папку .idea и файлы .iml
  • Перезапустите Android Studio и перезапустите-импортировать проект.

Для некоторых людей будет достаточно просто удалить все библиотеки из папки .idea и повторно синхронизировать Gradle.

Если ни одна из них не работает, вы всегдаможет переустановить всю студию, что, в зависимости от скорости вашей сети, не займет много времени.

0 голосов
/ 07 декабря 2018

зайдите в свой учебник, закомментируйте используемые вами библиотеки поддержки, синхронизируйте ваш проект, и вы получите ошибки.Затем раскомментируйте библиотеки и выполните синхронизацию снова.Теперь проект будет успешно построен, и, скорее всего, ваша проблема будет решена.Я не уверен, как это вызвано, во-первых, но вышеупомянутое решение работало для меня в прошлом, когда caches / clean / rebuilt потерпел бы неудачу.

Редактировать: Также в зависимости от свойства, которое вы могли бы хотетьдобавить приложение: вместо android:

...