【问题标题】:databinding error after updating gradle to 4.4 when android studio updated to 3.1当 android studio 更新到 3.1 时,将 gradle 更新到 4.4 后数据绑定错误
【发布时间】:2018-03-27 20:40:45
【问题描述】:

我已将 Android Studio 从 3.0 更新到 3.1,gradle 从 3.1 更新到 4.4:https://services.gradle.org/distributions/gradle-4.4-all.zip

我收到1 error1 warning

错误:

Cause: couldn't make a guess for com.example.example.databinding.ContentApplicationBinding

警告:

Configuration 'compile' is obsolete and has been replaced with 'implementation'.
It will be removed at the end of 2018

我怎样才能让它像以前一样运行?

【问题讨论】:

    标签: android android-gradle-plugin android-databinding


    【解决方案1】:

    dependencies {...} 内的 app/build.gradle 中,您应该从(例如):compile 'com.google.code.gson:gson:2.8.2' 更改为 implementation 'com.google.code.gson:gson:2.8.2'

    更多答案见here

    【讨论】:

    • 我已将所有 compile 更改为 implementation 我仍然遇到同样的错误!
    猜你喜欢
    • 1970-01-01
    • 2016-03-11
    • 2017-08-10
    • 2018-09-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多