Я не знаю, что происходит с моей Android Studio, у меня нет ни одного компонента Google Material

Мой проект работал отлично, без ошибок, все в порядке. Но теперь я не знаю, что будет на следующий день, Android Studio помечает меня тегом "@string/appbar_scrolling_view_behavior" как несуществующий, который ранее не выдавал мне вообще никакой ошибки. Теперь, когда я пытаюсь протестировать свое приложение, оно не позволяет мне его открыть.

Теперь попробуйте удалить Android-студию и удалить все свои папки, попробуйте делаю новый проект, попробуйте поставить Google Material Buttons, и когда вы снова откроете его, я получаю ту же ошибку. Может ли кто-нибудь помочь мне? Я не хочу потерять весь свой проект из-за Android Studio.

Проблема, которую я получаю, заключается в следующем. Я также прилагаю то, как устроены мои файлы styles.xml и мой файл build.gradle, а также пример структуры, которую имеют все кнопки в целом. Я знаю, что Я могу создать свою основную тему MaterialComponents, но моя проблема в том, что если я это сделаю, многие из моих зависимостей, их стили перестают работать правильно.

Ошибка в логкат:

2019-04-20 14:43:56.820 17207-17207/com.raven.okami E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.raven.okami, PID: 17207
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.raven.okami/com.raven.okami.RavenNetwork}: android.view.InflateException: Binary XML file line #23: Binary XML file line #11: Error inflating class com.google.android.material.button.MaterialButton
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2946)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3081)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:201)
        at android.app.ActivityThread.main(ActivityThread.java:6810)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
     Caused by: android.view.InflateException: Binary XML file line #23: Binary XML file line #11: Error inflating class com.google.android.material.button.MaterialButton
     Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class com.google.android.material.button.MaterialButton
     Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Constructor.newInstance0(Native Method)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
        at android.view.LayoutInflater.createView(LayoutInflater.java:651)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:794)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:734)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:867)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)
        at android.view.LayoutInflater.parseInclude(LayoutInflater.java:999)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:519)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:427)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
        at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
        at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
        at com.raven.okami.RavenNetwork.onCreate(RavenNetwork.java:20)
        at android.app.Activity.performCreate(Activity.java:7224)
        at android.app.Activity.performCreate(Activity.java:7213)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2926)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3081)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:201)
        at android.app.ActivityThread.main(ActivityThread.java:6810)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
     Caused by: java.lang.IllegalArgumentException: This component requires that you specify a valid TextAppearance attribute. Update your app theme to inherit from Theme.MaterialComponents (or a descendant).
2019-04-20 14:43:56.821 17207-17207/com.raven.okami E/AndroidRuntime:     at com.google.android.material.internal.ThemeEnforcement.checkTextAppearance(ThemeEnforcement.java:170)
        at com.google.android.material.internal.ThemeEnforcement.obtainStyledAttributes(ThemeEnforcement.java:75)
        at com.google.android.material.button.MaterialButton.<init>(MaterialButton.java:140)
        at com.google.android.material.button.MaterialButton.<init>(MaterialButton.java:133)
            ... 31 more

Файл стили.xml:

<resources>

    <style name = "AppTheme" parent = "Theme.AppCompat.Light.DarkActionBar">
        <item name = "colorPrimary">@color/colorPrimary</item>
        <item name = "colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name = "colorAccent">@color/colorAccent</item>
        <item name = "android:windowAnimationStyle">@style/RavenAnimations</item>
        <item name = "android:windowBackground">@drawable/raven_loading_screen</item>
        <item name = "material_drawer_background">@color/colorPrimary</item>
        <item name = "material_drawer_primary_text">@color/colorText</item>
        <item name = "material_drawer_selected">@color/colorAccent</item>
        <item name = "material_drawer_selected_text">@color/colorTextDark</item>
        <item name = "material_drawer_divider">@color/colorBackground</item>
    </style>

    <style name = "AppTheme.NoActionBar">
        <item name = "windowActionBar">false</item>
        <item name = "windowNoTitle">true</item>
    </style>

    <style name = "AppTheme.AppBarOverlay" parent = "ThemeOverlay.AppCompat.Dark.ActionBar" />

    <style name = "AppTheme.PopupOverlay" parent = "ThemeOverlay.AppCompat.Light" />

    <style name = "TextAppearance.App.TextInputLayout" parent = "@android:style/TextAppearance">
        <item name = "android:textColor">@color/colorText</item>
        <item name = "android:textSize">13sp</item>
    </style>

    <style name = "CheckBox" parent = "Widget.AppCompat.CompoundButton.CheckBox">
        <item name = "android:colorControlNormal">@color/colorAccent</item>
        <item name = "android:colorControlActivated">@color/colorAccent</item>
        <item name = "android:textSize">14sp</item>
    </style>

    <style name = "FullScreenDialogToolbar">
        <item name = "android:background">@color/colorBackground</item>
        <item name = "android:theme">@style/ThemeOverlay.AppCompat.Dark</item>
    </style>

    <style name = "RavenAnimations" parent = "@android:style/Animation.Activity">
        <item name = "android:activityOpenEnterAnimation">@anim/slide_in_right</item>
        <item name = "android:activityOpenExitAnimation">@anim/slide_out_left</item>
        <item name = "android:activityCloseEnterAnimation">@anim/slide_in_left</item>
        <item name = "android:activityCloseExitAnimation">@anim/slide_out_right</item>
    </style>

</resources>

Кнопка по умолчанию:

                <com.google.android.material.button.MaterialButton
                    android:id = "@+id/my_profile_account_buy_ticket_package_1"
                    android:layout_width = "wrap_content"
                    android:layout_height = "wrap_content"
                    android:layout_alignParentEnd = "true"
                    android:padding = "10dp"
                    android:text = "@string/raven_default_btn_buy"
                    android:textColor = "@color/colorTextDark"
                    android:textAppearance = "@style/TextAppearance.MaterialComponents.Button"
                    style = "@style/Widget.MaterialComponents.Button"
                    tools:ignore = "RelativeOverlap" />

Отредактируйте файл Gradle:

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.raven.okami"
        minSdkVersion 23
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    lintOptions {
        abortOnError false
        ignoreWarnings true
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'com.google.firebase:firebase-auth:16.2.1'
    implementation 'com.google.firebase:firebase-core:16.0.8'
    implementation 'com.google.firebase:firebase-firestore:18.2.0'
    implementation 'com.google.firebase:firebase-storage:16.1.0'
    implementation 'com.firebaseui:firebase-ui-firestore:4.3.2'
    implementation 'com.github.matecode:snacky:1.1.4'
    implementation 'com.github.marcoscgdev:DialogSheet:2.0.4-pre1'
    implementation 'com.kaopiz:kprogresshud:1.2.0'
    implementation 'com.github.franmontiel:FullScreenDialog:1.0.1'
    implementation 'org.sufficientlysecure:html-textview:3.6'
    implementation 'com.github.mikepenz:materialdrawer:v7.0.0-alpha2'
    implementation 'com.github.kaushikthedeveloper:double-back-press:0.0.1'
    implementation 'com.aurelhubert:ahbottomnavigation:2.3.3'
    //noinspection GradleDependency
    implementation 'com.squareup.okhttp3:okhttp:3.12.1'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.github.rahimlis:badgedtablayout:v1.2'
    implementation 'com.github.florent37:android-slidr:1.0.3'
    implementation 'de.hdodenhof:circleimageview:3.0.0'
    implementation 'com.makeramen:roundedimageview:2.3.0'
    implementation 'id.zelory:compressor:2.1.0'
    implementation 'com.github.yalantis:ucrop:2.2.3-native'
    implementation 'com.an.deviceinfo:deviceinfo:0.1.5'
    implementation 'android.arch.paging:runtime:1.0.1'
    implementation "com.leinardi.android:speed-dial:2.0.1"
    implementation 'com.mikepenz:actionitembadge:3.3.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

Пожалуйста, поделитесь файлом gradle

Nero 20.04.2019 23:19

Готов друг, я отредактировал свой вопрос.

kaname-png 20.04.2019 23:23
Пользовательский скаляр GraphQL
Пользовательский скаляр GraphQL
Листовые узлы системы типов GraphQL называются скалярами. Достигнув скалярного типа, невозможно спуститься дальше по иерархии типов. Скалярный тип...
Как вычислять биты и понимать побитовые операторы в Java - объяснение с примерами
Как вычислять биты и понимать побитовые операторы в Java - объяснение с примерами
В компьютерном программировании биты играют важнейшую роль в представлении и манипулировании данными на двоичном уровне. Побитовые операции...
Поднятие тревоги для долго выполняющихся методов в Spring Boot
Поднятие тревоги для долго выполняющихся методов в Spring Boot
Приходилось ли вам сталкиваться с требованиями, в которых вас могли попросить поднять тревогу или выдать ошибку, когда метод Java занимает больше...
Полный курс Java для разработчиков веб-сайтов и приложений
Полный курс Java для разработчиков веб-сайтов и приложений
Получите сертификат Java Web и Application Developer, используя наш курс.
4
2
1 383
1
Перейти к ответу Данный вопрос помечен как решенный

Ответы 1

Ответ принят как подходящий

Родитель вашего AppTheme должен быть Theme.MaterialComponents.Light.DarkActionBar не Theme.AppCompat.Light.DarkActionBar

Спасибо. Это работает.

kaname-png 22.04.2019 20:01

Другие вопросы по теме