首页 > 解决方案 > android design library 28.0.0 causes app to crash

问题描述

Including android design library to the dependencies causes app to crash.

Im launching this on Nexus S emulator with 25 API. All my libraries are of the same version, so I don't know what's the problem.

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0' //this one
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:support-v4:28.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.android.support:cardview-v7:28.0.0' // For CardView
    implementation 'com.android.support:recyclerview-v7:28.0.0'
}

标签: androidcrashandroid-support-library

解决方案


将您的代码迁移到 AndroidX,新的 SDK 依赖目录结构将帮助您在现在和将来避免此类问题。


推荐阅读