工人:java.lang.verifyError:验证者拒绝类androidx.work.impl.operationimpl
我正在尝试恢复旧代码库。
在其中一项活动中,enqueue()
在下面的代码段中表示的调用一直在崩溃应用程序:
WorkManager
.getInstance(requireContext())
.enqueue(updateValues) // updateValues is a WorkRequest
以下是例外:
java.lang.verifyError:verifier拒绝类androidx.work.impl.operationImpl:com.google.common.util.concurrent.listenable.listenablefuture androidx.work.impl.operationImpl.operationImpl.getResult()未能验证:com.google:com.google。 common.util.concurrent.listenableFuture androidx.work.impl.operationImpl.getResult():[0x2]无法解决返回的类型'未解决的参考:com.google.common.util.concurrent.concurrent.concurrent.listenable.listenable.listenablefuture 。 apk)
tor拥有:
- 将工人的依赖性版本更新为
2.8.0-alpha02
,它是最新版本的 - Minsdk更新为21(从19)
- 使用JDK 11
- 升级的jdk 11升级的target_sdk和compile_sdk和31
- 升级的kotlin版本至1.6.0.0.6.0
- 无效的缓存并重新启动
..但是崩溃仍然存在。
这是updateValues
workRequest:
private val updateValues: WorkRequest by lazy {
OneTimeWorkRequestBuilder<UpdateValuesWorker>()
.setConstraints(
Constraints
.Builder()
.setRequiredNetworkType(NetworkType.CONNECTED)
.build()
)
.setBackoffCriteria(
BackoffPolicy.EXPONENTIAL,
5,
TimeUnit.MINUTES
)
.build()
}
updateValuesworker
只是进行常规的API调用。
I'm trying to resuscitate an old codebase.
In one of the activities, the enqueue()
call represented in the code snippet below keeps crashing the app:
WorkManager
.getInstance(requireContext())
.enqueue(updateValues) // updateValues is a WorkRequest
Here's the exception:
java.lang.VerifyError: Verifier rejected class androidx.work.impl.OperationImpl: com.google.common.util.concurrent.ListenableFuture androidx.work.impl.OperationImpl.getResult() failed to verify: com.google.common.util.concurrent.ListenableFuture androidx.work.impl.OperationImpl.getResult(): [0x2] can't resolve returned type 'Unresolved Reference: com.google.common.util.concurrent.ListenableFuture' or 'Unresolved Reference: androidx.work.impl.utils.futures.SettableFuture' (declaration of 'androidx.work.impl.OperationImpl' appears in /data/app/~~KoZa3Uwv5hinF_EqVv8JEA==/com.flesson.tutor.uat-YOfhXEvtwlYyJ7ihgXtB_A==/base.apk)
I have:
- Updated the dependency version for WorkManager to
2.8.0-alpha02
which is the latest version - Updated minSdk to 21 (from 19)
- Used JDK 11
- Upgraded TARGET_SDK and COMPILE_SDK to 31
- Upgraded Kotlin version to 1.6.0
- Invalidate cache and restart
..but the crash still persists.
Here's the updateValues
WorkRequest:
private val updateValues: WorkRequest by lazy {
OneTimeWorkRequestBuilder<UpdateValuesWorker>()
.setConstraints(
Constraints
.Builder()
.setRequiredNetworkType(NetworkType.CONNECTED)
.build()
)
.setBackoffCriteria(
BackoffPolicy.EXPONENTIAL,
5,
TimeUnit.MINUTES
)
.build()
}
UpdateValuesWorker
just makes a regular API call.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我承认,解决方案有点奇怪。
我的第一步是将Workmanager的依赖版本以及Coroutines更新为最新版本(如问题细节所述)。之后,我更新了提供商Lt;&gt;在我的 androidmanifest.xml 文件中标记:到此
:
之后,一切都很好。
The solution was a tad weird, I admit.
My first step was to update the dependency versions for WorkManager as well as Coroutines to the latest versions (as stated in the question details). After that, I updated the provider<> tag in my AndroidManifest.xml file from this:
to this:
After that, everything just worked fine.