Unable to import java.time.Duration in PeriodicWorkRequest class (WorkManager)

回眸只為那壹抹淺笑 提交于 2021-01-29 05:58:38

问题


Getting Cannot resolve symbol for import java.time.Duration in PeriodicWorkRequest class.

Java: 8 JDK: 1.8.0_191 implementation 'android.arch.work:work-runtime:1.0.0-alpha10'


回答1:


Make sure that compileSdkVersion is set to 26 or higher because java.time.Duration is available only on API 26+. This won't affect the ability to run your app on devices with a lower API level.



来源:https://stackoverflow.com/questions/52996714/unable-to-import-java-time-duration-in-periodicworkrequest-class-workmanager

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!