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? :(
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…