Androidx和数据绑定 [英] Androidx and databinding

查看:76
本文介绍了Androidx和数据绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将我的Android P测试依赖项迁移到androidx依赖项.由于某些不太清楚的原因,我的项目不再编译了(不,我不会提供详细信息以避免出现明显的问题).我发现(通过gradlew dependencies)数据绑定使用"oldschool"依赖项android.arch.lifecycle:runtime:1.0.3而不是androidx.lifecycle:lifecycle-runtime:2.0.0-beta01.我想这可能是原因之一.

I'm migrating my dependencies for an Android P test to the androidx dependencies. For some not very clear reasons my project does not compile anymore (and no I won't provide the details to avoid a distinct problem). I found out (via gradlew dependencies) that the databinding uses the "oldschool" dependency android.arch.lifecycle:runtime:1.0.3 instead of androidx.lifecycle:lifecycle-runtime:2.0.0-beta01. I guess that could be one reason.

有什么主意如何强制使用新的程序包名称/依赖关系?

Any idea how to force using the new package names/dependencies?

推荐答案

我尝试在互联网连接较弱的情况下尝试此操作,因此我跳过了更新至Android Studio 3.2的操作.那是我的错升级后(解压缩花了将近一个小时的时间才知道为什么),我还被要求将构建工具升级到com.android.tools.build:gradle:3.2.0-beta04(或与您的Android Studio版本匹配的最新版本(我不会安装3.3.0-alpha03))并将gradle包装器升级到4.6.

I tried that while I had a weak internet connection, so I skipped to update to Android Studio 3.2. That was my fault. With that upgrade (the unziping took almost an hour no idea why) I was requested also to upgrade my build tools to com.android.tools.build:gradle:3.2.0-beta04 (or whatever is the newest version matching for your Android Studio version (I would not install the 3.3.0-alpha03) and upgraded the gradle wrapper to 4.6.

现在依赖性消失了,我很高兴.

Now the dependencies are gone and I'm happy.

这篇关于Androidx和数据绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆