I do not know what is happening with my Android Studio, I do not have any component of Google Material

itzThiefz.exe :

My project worked perfectly, no mistake, all right. But now I do not know what happens the next day, Android Studio marks me the tag "@string/appbar_scrolling_view_behavior" as non-existent, which previously did not throw me at all no error. Now when I try to test my application does not let me open it.

Now try to uninstall Android Studio and delete all your folders, try doing a new project, try to put the Google Material Buttons and when you open it again I got the same error. Could someone be kind to help me? I do not want to lose my whole project because of Android Studio.

The problem I get is the following. I also attach how my styles.xml file and my build.gradle file are structured, as well as an example of the structure that all the buttons have in general. I know that I can instantiate my main theme of MaterialComponents but my problem is that if I do, many of my dependencies, their styles stop working correctly.

Error in Logcat:

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

File styles.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>

Btn Default:

                <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" />

Edit Gradle File:

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'
}
Cameron Ketcham :

The parent of your AppTheme should be Theme.MaterialComponents.Light.DarkActionBar not Theme.AppCompat.Light.DarkActionBar

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=91141&siteId=1