reactnativecn / react-native-http-cache

Native module to control react native http cache
226 stars 109 forks source link

Throwing error cannot find symbol method getMainDiskStorageCache() on building #23

Open csooraj opened 7 years ago

csooraj commented 7 years ago

I followed the doc and added react-native-http-cache to my project, but on building the app I am getting the following error

/Users/sooraj/test/node_modules/react-native-http-cache/android/src/main/java/cn/reactnative/httpcache/HttpCacheModule.java

Error:(69, 62) error: cannot find symbol method getMainDiskStorageCache() Error:(80, 62) error: cannot find symbol method getSmallImageDiskStorageCache()

I could not figure out this issue, could you please help to fix this.

I am using React Native version 0.47

guopeng1994 commented 6 years ago

did you solve this problem?

ismjt commented 6 years ago

@csooraj try to fix these two line : https://github.com/reactnativecn/react-native-http-cache/blob/ab4571a7584ba6b5796e83752e25b2f1a6c9cf28/android/src/main/java/cn/reactnative/httpcache/HttpCacheModule.java#L69 https://github.com/reactnativecn/react-native-http-cache/blob/ab4571a7584ba6b5796e83752e25b2f1a6c9cf28/android/src/main/java/cn/reactnative/httpcache/HttpCacheModule.java#L80

solution: 【L69】FileCache cache1 = ImagePipelineFactory.getInstance().getMainFileCache(); 【L80】FileCache cache2 = ImagePipelineFactory.getInstance().getSmallImageFileCache();

after edit, rebuild, it works for me , you can try it!

SteffenC commented 6 years ago

I had same issue, and while @ismjt suggestion did work (it builds) I am now getting "undefined is not a function (evaluating CacheManager.clear())

ismjt commented 6 years ago

@SteffenC see here: https://github.com/reactnativecn/react-native-http-cache/blob/ab4571a7584ba6b5796e83752e25b2f1a6c9cf28/index.js#L23

try this: CacheManager.clearCache()