美文网首页
Android inflate 错误 xml

Android inflate 错误 xml

作者: Krisez | 来源:发表于2018-07-31 15:38 被阅读0次

    Gradle version: 4.4

    Android Plugin Version: 3.1.3

    Module Compile Sdk Version: API 27: Android 8.1 (Oreo)

    Module Build Tools Version: null

    Android SDK Tools version: 26.1.1

    我配置有点抽疯,我这么用的时候

    implementation 'com.android.support:appcompat-v7:27.1.1
    implementation 'com.android.support:design:27.1.1'

    给我显示这个

    java.lang.RuntimeException: Unable to start activity ComponentInfo{cn.krisez.car/cn.krisez.car.MainActivity}: android.view.InflateException: Binary XML file line #11: Binary XML file line #14: Error inflating class android.support.v7.widget.Toolbar
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
    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:1808)

    我周五也是同样的代码,我这两个就这样对我
    em, compileSdkVersion 27 targetSdkVersion 27

    我把这些改成28 顺便
    implementation 'com.android.support:appcompat-v7:28.+'
    implementation 'com.android.support:design:28.+'
    运行正常,但是我想用API27来写。所以我改成了
    implementation 'com.android.support:appcompat-v7:27.0.2'
    implementation 'com.android.support:design:27.0.2'
    又正常了。这么针对我的么?Glide在这个版本 不能用需要降低版本。。。我简直。。。

    相关文章

      网友评论

          本文标题:Android inflate 错误 xml

          本文链接:https://www.haomeiwen.com/subject/kjjhvftx.html