chrisbanes / Android-BitmapCache

Android-BitmapCache is a specialised cache, for use with Android Bitmap objects.
834 stars 224 forks source link

Gradle build includes ancient support-lib-v4 #54

Open arberg opened 8 years ago

arberg commented 8 years ago

The Gradle build compile 'com.github.chrisbanes.bitmapcache:library:2.3' will cause inclusion of support-v4 from maven-central http://mvnrepository.com/artifact/com.google.android/support-v4/r7

This is an ancient release from 2012. The new releases are in android-sdk downloaded and updated via SDK manager. They appear to not be in maven central.

In my particular case I lost access to the class ViewCompat after including the bitmap-cache library via gradle (using compile 'com.github.chrisbanes.bitmapcache:library:2.3').

I think it will be a build problem if the gradle build forces inclusion of a particular version of the support lib, including if it forces newest version via '+'. I'm no Gradle 'expert' but it seems others have solved the problem of dependencies eg. me.henrytao:mdcore:1.2.0 (or I just havn't run into problems there yet).

Best Alex

PS: Seems to be awesome library though, thank you for sharing.

arberg commented 8 years ago

I found I could exclude the dependencies like this: compile('com.github.chrisbanes.bitmapcache:library:2.3'){ exclude group: 'com.google.android' } compile 'com.android.support:support-v4:23.1.1'

I still think this project should include the newest support-lib-v4 (as it claims to to in front-page). I admit it is a neat trap that the most recent version on maven is ancient.

Its also possible to manually choose version of DiskLruCache like this but its probably not safe if different version of DiskLruCache is included, as a future version of DiskLru may not play well with BitmapCache. compile('com.github.chrisbanes.bitmapcache:library:2.3'){ exclude group: 'com.jakewharton' } compile 'com.jakewharton:disklrucache:2.0.2'

bkhall commented 8 years ago

@arberg Thanks for posting a quick fix to this problem.

@chrisbanes Please remove the android-support jar from this library.

I wasted 4+ hours trying to find where this duplicate jar was coming from.

arberg commented 8 years ago

Hi @bkhall

@chrisbanes has not updated repository for 2 years, so I would say its dead.

farfromrefug (https://github.com/Akylas/Android-BitmapCache/) made lots of updates in 2014 that was never pulled. I pushed my changes to farfromrefug(Akylas) but those have not yet been accepted. So today this is the most update version of the repository, I believe (as I pulled from farfromrefug):

https://github.com/arberg/Android-BitmapCache/