Ошибка компиляции приложения Android с Материальными компонентами и androidX - PullRequest
0 голосов
/ 07 ноября 2018

Android-приложение неожиданно отказывается от сборки, возвращает эту ошибку:

Не удалось связать ресурс Android ошибка: стиль ресурса / Theme.MaterialComponents.Light.NoActionBar (он же it.duemilanet.icircle: стиль / Theme.MaterialComponents.Light.NoActionBar) не найден.

D: \ GitLab \ iCircleAndroidRMA \ App \ сборка \ промежуточные \ инкрементный \ mergeDebugResources \ merged.dir \ значений \ values.xml: 1440: ошибка: атрибут стиля 'attr / colorSecondary (он же it.duemilanet.icircle: attr / colorSecondary) 'не найден. ошибка: ресурсный стиль / Widget.Design.BottomSheet.Modal (он же it.duemilanet.icircle: style / Widget.Design.BottomSheet.Modal) нет найденный. ошибка: стиль ресурса / Theme.Design.Light.BottomSheetDialog (он же it.duemilanet.icircle: style / Theme.Design.Light.BottomSheetDialog) нет найденный. D: \ GitLab \ iCircleAndroidRMA \ приложение \ построить \ интермедиатов \ инкрементный \ mergeDebugResources \ merged.dir \ значений \ values.xml: 3296: ошибка: атрибут стиля 'attr / bottomSheetStyle (он же it.duemilanet.icircle: attr / bottomSheetStyle) 'не найден. ошибка: не удалось связать ссылки.

Раньше он просто компилировался, я перешел на androidX и тему компонентов материала несколько недель назад и без проблем включил jetifier

build.gradle:

buildscript {

    repositories {

        google()
        jcenter()

        maven {
            url 'https://maven.fabric.io/public'
        }

    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0-alpha09'
        classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2'
        classpath 'com.google.gms:google-services:4.0.2'
        classpath 'io.fabric.tools:gradle:1.25.4'
    }

}

allprojects {

    repositories {

        google()
        jcenter()

        maven {
            url 'https://maven.google.com/'
        }

    }

}

task clean(type: Delete) {
    delete rootProject.buildDir
}

приложение build.gradle:

apply plugin: 'com.android.application'
apply plugin: 'org.greenrobot.greendao'
apply plugin: 'io.fabric'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "it.duemilanet.icircle"
        minSdkVersion 23
        targetSdkVersion 28
        versionCode 3334
        versionName "3.3.3.4"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dataBinding {
        enabled true
    }
}

greendao {
    schemaVersion 1
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'com.squareup.retrofit2:converter-scalars:2.4.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
    implementation 'com.squareup.okhttp3:okhttp:3.10.0'
    implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.6.0'
    implementation 'io.sentry:sentry-android:1.7.5'
    implementation 'org.simpleframework:simple-xml:2.7.1'
    implementation 'org.greenrobot:greendao:3.2.2'
    implementation 'com.synnapps:carouselview:0.1.5'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.bskim:maxheightscrollview:1.0.0@aar'
    implementation 'com.google.firebase:firebase-core:16.0.5'
    implementation 'com.google.firebase:firebase-messaging:17.3.4'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
    implementation 'com.pspdfkit:pspdfkit:4.8.1'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.0.0'
    implementation 'org.apache.commons:commons-compress:1.18'
    implementation 'androidx.databinding:databinding-runtime:3.3.0-alpha12'
    implementation 'com.jakewharton:butterknife:9.0.0-rc1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
}

repositories {
    mavenCentral()
    maven {
        url "https://oss.sonatype.org/content/repositories/snapshots"
    }
    maven {
        url 'https://customers.pspdfkit.com/maven/'
        credentials {
            username 'pspdfkit'
            password 'PASSWORD'
        }
    }
}

apply plugin: 'com.google.gms.google-services'
  • Я пытался отключить мгновенный запуск и вернуться к предыдущим версиям библиотеки материалов, но не смог исправить ошибку.

1 Ответ

0 голосов
/ 07 ноября 2018

Попробуйте Invalidate Cashes / Restart из Android Studio File меню.

...