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

查看:30
本文介绍了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天全站免登陆