错误:包 androidx.work 不存在

pro*_*123 5 android androidx

我从 Android Studio 创建了一个新项目,当尝试使用 androidx.work 时,看到错误“错误:包 androidx.work 不存在”

我可以看到大多数其他 androidx 包,例如活动、核心、加载程序等,但不是“工作”。有最新和最大的更新。

项目 gradle.properties

# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
Run Code Online (Sandbox Code Playgroud)

and*_*oid 6

在您的应用程序级别 gradle 中使用以下库:

implementation 'androidx.work:work-runtime:2.0.1-rc01'
Run Code Online (Sandbox Code Playgroud)

代替

implementation 'android.arch.work:work-runtime:2.0.1-rc01'
Run Code Online (Sandbox Code Playgroud)