android studio Library source does not match the bytecode for class

android studio Library source does not match the bytecode for class 这个错误是引用的aar或者jar中的某些代码,还是旧的库中的文件,可能的原因是android Studio 引用了gradle的cache中的库,导致无法使用新的代码,编译无法通过。
解决办法:
找到gradle缓存的位置:
android studio Library source does not match the bytecode for class
打开缓存:
android studio Library source does not match the bytecode for class
android studio Library source does not match the bytecode for class
找到缓存的文件夹,删除。

然后删除android studio中的引用,最后重新更新依赖,就可以使用最新的代码。
android studio Library source does not match the bytecode for class
android studio Library source does not match the bytecode for class