Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android - support libraries 23.2.0 cause app to crash

My app works well with support libraries 23.1.0 or 23.1.1, but when i start using 23.2.0 it crashes on launch. I use five support libraries, but the ones that seem to make it crash are these two:

com.android.support:appcompat-v7:23.2.0

com.android.support:design:23.2.0

I have this issue on my galaxy nexus (API 17) but not on my Nexus 7 (API 22). Does anyone know what might be the problem? Here is my gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.ikarirobotics.aichordfinder"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:support-annotations:23.2.0'
    compile "com.android.support:appcompat-v7:23.2.0"
    compile 'com.android.support:design:23.2.0'
    compile 'com.android.support:cardview-v7:23.2.0'
    compile 'com.android.support:recyclerview-v7:23.2.0'
}

My layout is only a frame where i place the currently appropriate fragment:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/fragment_container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="HomeActivity"
    tools:ignore="MergeRootFrame" />

Using the debugger I was able to discover that the crash happens when the main activity calls setContentView():

java.lang.reflect.InvocationTargetException

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ikarirobotics.aichordfinder/com.ikarirobotics.aichordfinder.HomeActivity}: android.view.InflateException: Binary XML file line #36: Error inflating class android.support.v7.widget.Toolbar

My activity extends AppCompatActivity and i make use of the support action bar. Any ideas on how to fix this problem? :(

like image 890
CesarPim Avatar asked Feb 25 '16 04:02

CesarPim


2 Answers

There seems to be a drawable mutation bug as being worked on Google with the 23.2.0 release. See the issue here. Reverting back to 23.1.1 should be fine until the next bugfix release.

like image 92
opt05 Avatar answered Nov 20 '22 02:11

opt05


Same thing happens to me. I partially fixed it reverting to 23.1.1 on support:design.

like image 25
Juan Santiago Acevedo Correa Avatar answered Nov 20 '22 03:11

Juan Santiago Acevedo Correa