Updating appcompat-v7 and design libraries to v24.2.0 cause bugs
NickName:Androider Ask DateTime:2016-09-03T19:12:45

Updating appcompat-v7 and design libraries to v24.2.0 cause bugs

I used appcompat-v7 and design libraries with v24.1.1 and the project works as expected without any problem or bug. But when I update these two libraries to v24.2.0, some bugs appears.

1. The first bug with the appcompat-v7 library, after I update this library, the Toolbar and FAB goes away in the design screen. Also, when I run the project, my Android app stops (Force Close) after launching the app immediately. The Log:

09-03 14:02:56.543 14932-14932/com.twitter.i_droidi.notah E/AndroidRuntime: FATAL EXCEPTION: main
                                                                            Process: com.twitter.i_droidi.notah, PID: 14932
                                                                            java.lang.RuntimeException: Unable to start activity ComponentInfo{com.twitter.i_droidi.notah/net.alhazmy13.catcho.library.CatchoReportActivity}: android.view.InflateException: Binary XML file line #100: Binary XML file line #100: Error inflating class android.support.design.widget.FloatingActionButton
                                                                                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
                                                                                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
                                                                                at android.app.ActivityThread.-wrap11(ActivityThread.java)
                                                                                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
                                                                                at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                at android.os.Looper.loop(Looper.java:148)
                                                                                at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                                at java.lang.reflect.Method.invoke(Native Method)
                                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
                                                                             Caused by: android.view.InflateException: Binary XML file line #100: Binary XML file line #100: Error inflating class android.support.design.widget.FloatingActionButton
                                                                                at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
                                                                                at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
                                                                                at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
                                                                                at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284)
                                                                                at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
                                                                                at net.alhazmy13.catcho.library.CatchoReportActivity.onCreate(CatchoReportActivity.java:32)
                                                                                at android.app.Activity.performCreate(Activity.java:6237)
                                                                                at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
                                                                                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
                                                                                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
                                                                                at android.app.ActivityThread.-wrap11(ActivityThread.java) 
                                                                                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
                                                                                at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                at android.os.Looper.loop(Looper.java:148) 
                                                                                at android.app.ActivityThread.main(ActivityThread.java:5417) 
                                                                                at java.lang.reflect.Method.invoke(Native Method) 
                                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
                                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
                                                                             Caused by: android.view.InflateException: Binary XML file line #100: Error inflating class android.support.design.widget.FloatingActionButton
                                                                                at android.view.LayoutInflater.createView(LayoutInflater.java:645)
                                                                                at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
                                                                                at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
                                                                                at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
                                                                                at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
                                                                                at android.view.LayoutInflater.rInflate(LayoutInflater.java:838)
                                                                                at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
                                                                                at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
                                                                                at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
                                                                                at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
                                                                                at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284) 
                                                                                at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
                                                                                at net.alhazmy13.catcho.library.CatchoReportActivity.onCreate(CatchoReportActivity.java:32) 
                                                                                at android.app.Activity.performCreate(Activity.java:6237) 
                                                                                at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) 
                                                                                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) 
                                                                                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
                                                                                at android.app.ActivityThread.-wrap11(ActivityThread.java) 
                                                                                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
                                                                                at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                at android.os.Looper.loop(Looper.java:148) 
                                                                                at android.app.ActivityThread.main(ActivityThread.java:5417) 
                                                                                at java.lang.reflect.Method.invoke(Native Method) 
                                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
                                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
                                                                             Caused by: java.lang.reflect.InvocationTargetException
                                                                                at java.lang.reflect.Constructor.newInstance(Native Method)
                                                                                at android.view.LayoutInflater.createView(LayoutInflater.java:619)
                                                                                at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764) 
                                                                                at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 
                                                                                at android.view.LayoutInflater.rInflate(LayoutInflater.java:835) 
                                                                                at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
                                                                                at android.view.LayoutInflater.rInflate(LayoutInflater.java:838) 
                                                                                at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
                                                                                at android.view.LayoutInflater.inflate(LayoutInflater.java:515) 
                                                                                at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
                                                                                at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
                                                                                at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284) 
                                                                                at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
                                                                                at net.alhazmy13.catcho.library.CatchoReportActivity.onCreate(CatchoReportActivity.java:32) 
                                                                                at android.app.Activity.performCreate(Activity.java:6237) 
                                                                                at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) 
                                                                                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) 
                                                                                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
                                                                                at android.app.ActivityThread.-wrap11(ActivityThread.java) 
                                                                                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
                                                                                at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                at android.os.Looper.loop(Looper.java:148) 
                                                                                at android.app.ActivityThread.main(ActivityThread.java:5417) 
                                                                                at java.lang.reflect.Method.invoke(Native Method) 
                                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
                                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
                                                                             Caused by: java.lang.NoSuchMethodError: No direct method <init>(Landroid/widget/ImageView;Landroid/support/v7/widget/AppCompatDrawableManager;)V in class Landroid/support/v7/widget/AppCompatImageHelper; or its super classes (declaration of 'android.support.v7.widget.AppCompatImageHelper' appears in /data/data/com.twitter.i_droidi.notah/files/instant-run/dex/slice-com.android.support-appcompat-v7-24.2.0_6745dad81260adbd6a3e5cd1e754bd0f70ca1f25-classes.dex)
                                                                                at android.support.design.widget.FloatingActionButton.<init>(FloatingActionButton.java:170)
                                                                                at android.support.design.widget.FloatingActionButton.<init>(FloatingActionButton.java:147)
                                                                                at java.lang.reflect.Constructor.newInstance(Native Method) 
                                                                                at android.view.LayoutInflater.createView(LayoutInflater.java:619) 
                                                                                at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764) 
                                                                                at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 
                                                                                at android.view.LayoutInflater.rInflate(LayoutInflater.java:835) 
                                                                                at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
                                                                                at android.view.LayoutInflater.rInflate(LayoutInflater.java:838) 
                                                                                at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
                                                                                at android.view.LayoutInflater.inflate(LayoutInflater.java:515) 
                                                                                at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
                                                                                at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
                                                                                at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284) 
                                                                                at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
                                                                                at net.alhazmy13.catcho.library.CatchoReportActivity.onCreate(CatchoReportActivity.java:32) 
                                                                                at android.app.Activity.performCreate(Activity.java:6237) 
                                                                                at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) 
                                                                                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) 
                                                                                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
                                                                                at android.app.ActivityThread.-wrap11(ActivityThread.java) 
                                                                                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
                                                                                at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                at android.os.Looper.loop(Looper.java:148) 
                                                                                at android.app.ActivityThread.main(ActivityThread.java:5417) 
                                                                                at java.lang.reflect.Method.invoke(Native Method) 
                                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
                                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 

2. The second bug with the design library, after I update this library, the whole TextInputLayout and EditText goes away, and I can not write anything in the EditText area.

* Update: The XML file:

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:tools="http://schemas.android.com/tools"
    android:fitsSystemWindows="true"
    tools:context=".CreateNote"
    android:id="@+id/coordinatorlayout_create_note">

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical"
    android:id="@+id/rl1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

    <LinearLayout
        android:id="@+id/llmain"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:background="@color/colorPrimary"
        android:elevation="6dp"
        android:fitsSystemWindows="true" >

        <android.support.v7.widget.Toolbar
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/toolbar"
            app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
            android:fitsSystemWindows="true">

        </android.support.v7.widget.Toolbar>

        <LinearLayout
            android:id="@+id/ll1"
            android:layout_width="match_parent"
            android:layout_height="100dp"
            android:orientation="vertical"
            android:fitsSystemWindows="true">

            <android.support.design.widget.TextInputLayout
                android:id="@+id/inputlayoutTitle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="6dp">

                <EditText
                    android:id="@+id/create_title"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/note_title"
                    android:paddingLeft="10dp"
                    android:textSize="19.5sp"
                    android:textStyle="bold"
                    android:textColor="#212121"
                    android:typeface="serif"
                    android:fontFamily="serif"
                    android:inputType="text"
                    android:layout_marginLeft="15dp"
                    android:layout_marginRight="5dp"
                    android:layout_marginBottom="5dp"
                    android:tag="text_color|primary_text_inverse,text_size|title"
                    android:singleLine="true" />

            </android.support.design.widget.TextInputLayout>
        </LinearLayout>
    </LinearLayout>

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/save"
        android:layout_marginRight="16dp"
        android:layout_marginBottom="16dp"
        android:layout_gravity="right"
        android:layout_marginTop="-30dp"
        android:adjustViewBounds="false"
        android:tag="bg_tint_accent_color_selector_lighter"
        app:elevation="6dp"
        app:pressedTranslationZ="12dp" />

    <ScrollView
        android:id="@+id/scroll_view"
        android:scrollbars="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:fillViewport="true"
        android:fitsSystemWindows="true"
        android:layout_marginTop="-25dp"
        android:paddingTop="15dp"
        android:animateLayoutChanges="true">

        <LinearLayout
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <android.support.design.widget.TextInputLayout
                android:id="@+id/inputlayoutContent"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:paddingTop="17dp"
                android:layout_marginTop="-20dp"
                android:paddingBottom="5dp"
                app:counterEnabled="true"
                app:counterTextAppearance="@style/MyCounterTextStyle" >

                <EditText
                    android:id="@+id/create_body"
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:layout_weight="1"
                    android:paddingStart="10dp"
                    android:paddingEnd="10dp"
                    android:paddingLeft="10dp"
                    android:paddingRight="10dp"
                    android:hint="@string/note_content"
                    android:textSize="15sp"
                    android:gravity="top"
                    android:background="@android:color/transparent"
                    android:layout_marginLeft="7dp"
                    android:tag="tint_accent_color,text_primary,textsize_subheading"
                    android:layout_marginRight="3dp"
                    android:inputType="textMultiLine"
                    android:textColor="#727272"
                    android:typeface="serif"
                    android:fontFamily="serif" />

            </android.support.design.widget.TextInputLayout>
        </LinearLayout>
    </ScrollView>
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>

Copyright Notice:Content Author:「Androider」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/39306266/updating-appcompat-v7-and-design-libraries-to-v24-2-0-cause-bugs

More about “Updating appcompat-v7 and design libraries to v24.2.0 cause bugs” related questions

Updating appcompat-v7 and design libraries to v24.2.0 cause bugs

I used appcompat-v7 and design libraries with v24.1.1 and the project works as expected without any problem or bug. But when I update these two libraries to v24.2.0, some bugs appears. 1. The firs...

Show Detail

Material design and Appcompat-v7 not supported in Android?

I'm new to Android programming. When I tried to add material design library to build.gradle it shows error under implementation 'com.android.support:appcompat-v7:28.0.0'. Error message is :

Show Detail

Android support-v4 library being added with appcompat-v7

In my build gradle file I have two dependencies (appcompat-v7 and design) and then whatever externar jar files I add to the project dependencies { compile fileTree(dir: 'libs', include: ['*.ja...

Show Detail

Updating External Libraries in Android Studio

I'm fairly new to Android development, so apologies if this is obvious. I've searched quite a lot but am unable to resolve my issue. In my build.gradle file I have the following section: dependenci...

Show Detail

There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs

My gradle file has an error. The app compiles properly but it generates a runtime exception and crashes instantly. It shows: All com.android.support libraries must use the exact same version

Show Detail

can't resolve com.android.support:appcompat-v7:26.1.0

when i implementation this [com.android.support:animated-vector-drawable:27.0.2] it show me that i have to upgrade to [com.android.support:appcompat-v7:27.0.2] which will let me in end of way to up...

Show Detail

appcompat-v7:23.1.0 and mediarouter-v7:22.0.0

I have an exceptiuon I want to work on the SDK level 23 so on one of my depedencies I get an error: with: compile 'com.android.support:appcompat-v7:23.0.0' All com.android.support libraries must u...

Show Detail

appcompat-v7:25.2.0 conflicts with play-services:10.2.1

I am working on a new app. Presently I am trying to add dependency compile 'com.google.android.gms:play-services:10.2.1' When I do I get a gradle compile error on compile 'com.android.support:app...

Show Detail

How to handle minor bugs that represent design flaws?

I'm working on a project where I have a few related bugs that are fairly minor in terms of loss of functionality. They are basically minor but annoying aesthetic problems, and based on loss of

Show Detail

Android studio getting warning for support:appcompat-v7:28.0.0

I am getting error in build.gradle file All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 28.0.0, 26.1.0.

Show Detail