0

I have a library say abc.aar, this includes timber.jar in its lib. This timber is Version - 2.5.1 Library abc is developed by a different team, and I cannot modify that. :-( I am developing another library which has a dependency on abc.aar. I need to use timber-4.7.0. How do I exclude timber2.5.1 from compiling. I tried the following

    compile(name: 'abc-aaa', ext: 'aar'){
           exclude module: 'com.jakewharton.timber'
    }
compile 'com.jakewharton.timber:timber:4.7.0'

This did not work for me. I get the Timber reference from abc module. (timber-2.5.1). Any help much appreciated.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
subair_a
  • 1,028
  • 2
  • 14
  • 19
  • You wil have to rebuild the whole library – HB. Mar 28 '18 at 16:19
  • @H.Brooks Thanks for the quick reply. Here library abc is developed by a different team, and I cannot modify that. – subair_a Mar 28 '18 at 18:35
  • Why can't you modify it? Your best bet is to send the developer of the library a email – HB. Mar 28 '18 at 18:50
  • 1
    `aar` is a ZIP archive which can be unzipped, get it's contents modified like removing the timber jar from it and zip it again. Checkout this link: https://stackoverflow.com/q/38860912/2949966. Beware that doing this might break certain functionalities in your `abc-aaa` library do to the difference in versions but it's worth a shot. – ahasbini Mar 28 '18 at 23:03
  • As a side note, gradle cannot manage dependencies within packaged libraries since it depends on certain files like `pom.xml` which is usually not packaged in `aar` libraries. – ahasbini Mar 28 '18 at 23:04

0 Answers0