我已经更新了gradle.properties
文件,添加了以下内容:
android.useAndroidX=true
android.enableJetifier=true
但我遇到了这个错误:
e: [kapt] An exception occurred: android.databinding.tool.util.LoggedErrorException: failure, see logs for details.
AndroidX Error: Both old and new data binding packages are available in dependencies. Make sure you've setup jettifier for any data binding dependencies and also set android.useAndroidx in your gradle.properties file.
at android.databinding.tool.util.L.printMessage(L.java:134)
at android.databinding.tool.util.L.e(L.java:107)
at android.databinding.tool.Context.discoverAndroidX(Context.kt:62)
build.gradle
文件吗? - Khemraj Sharmabuild.gradle
文件会很有帮助。最近我也遇到了这个问题,不得不禁用 SafeArgs 库来解决它。 - MowDownJoe