VictorAlbertos / ReactiveCache

A reactive cache for Android and Java which honors the reactive chain.
Apache License 2.0
240 stars 24 forks source link

ReactiveCache is crashing when used in project with new version of Dagger2 #23

Closed AlexTrotsenko closed 4 years ago

AlexTrotsenko commented 6 years ago

I got following exception/crash when updating dagger2 to the new version.

It might be cause by this issue. And looks very similar to issue from another project

      AndroidRuntime  E  FATAL EXCEPTION: main
                         E  Process: com.spotme.android, PID: 4817
                         E  java.lang.NoSuchMethodError: No static method injectMembers(Ldagger/MembersInjector;Ljava/lang/Object;)Ljava/lang/Object; in class Ldagger/internal/Me
                            mbersInjectors; or its super classes (declaration of 'dagger.internal.MembersInjectors' appears in base.apk!classes29.dex)
                         E      at io.rx_cache2.internal.cache.EvictRecord_Factory.get(EvictRecord_Factory.java:36)
                         E      at io.rx_cache2.internal.cache.EvictRecord_Factory.get(EvictRecord_Factory.java:11)
                         E      at io.rx_cache2.internal.cache.TwoLayersCache_Factory.get(TwoLayersCache_Factory.java:33)
                         E      at io.rx_cache2.internal.cache.TwoLayersCache_Factory.get(TwoLayersCache_Factory.java:7)
                         E      at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
                         E      at io.rx_cache2.internal.ProcessorProvidersBehaviour_Factory.get(ProcessorProvidersBehaviour_Factory.java:48)
                         E      at io.rx_cache2.internal.ProcessorProvidersBehaviour_Factory.get(ProcessorProvidersBehaviour_Factory.java:11)
                         E      at io.rx_cache2.internal.RxCacheModule_ProvideProcessorProvidersFactory.get(RxCacheModule_ProvideProcessorProvidersFactory.java:30)
                         E      at io.rx_cache2.internal.RxCacheModule_ProvideProcessorProvidersFactory.get(RxCacheModule_ProvideProcessorProvidersFactory.java:8)
                         E      at io.rx_cache2.internal.DaggerRxCacheComponent.providers(DaggerRxCacheComponent.java:202)
                         E      at io.reactivecache2.ReactiveCache.<init>(ReactiveCache.java:39)
                         E      at io.reactivecache2.ReactiveCache.<init>(ReactiveCache.java:30)
                         E      at io.reactivecache2.ReactiveCache$Builder.using(ReactiveCache.java:154)
AlexTrotsenko commented 6 years ago

@VictorAlbertos looks like changes in https://github.com/VictorAlbertos/RxCache is needed otherwise lib is not usable in newer projects.

Looks like shading is mandatory in the libs. And here is an example.

Do you think you will be able to update the lib with needed changes or ?

AlexTrotsenko commented 6 years ago

Just to note: after updating to the latest version, which has "bump libs version" commit - it starts to work. But anyway looks like shading is needed as otherwise the issue could come again in the future. (also I am not sure how it will affects projects with lower version of the dagger)

VictorAlbertos commented 4 years ago

Feel free to open a PR to improve it 👍