Ask Your Question

Android how to remove unnecessary modules?

asked 2020-02-11 02:18:00 -0500

NoMaD gravatar image

OpenCV modules has cross dependencies to each other. I need only improc and core modules in a Android project but there are a lot of other files related with other modules. I do not want to add them in my repository. Is it possible to remove all unnecessary modules and related files? And do you know that how R8 shrinker and code optimizer works on that does it remove all unused parts of opencv?

edit retag flag offensive close merge delete



You must disbale module and compile sdk yourself

LBerger gravatar imageLBerger ( 2020-02-11 03:06:29 -0500 )edit

Hi, @LBerger You can post a link that shows how to do it ?

LiorA gravatar imageLiorA ( 2020-04-24 14:00:27 -0500 )edit

Hi, any context ? I read also the following:

but it's hard to figure it out ..

LiorA gravatar imageLiorA ( 2020-04-25 06:18:47 -0500 )edit

NVM, found a solution..

LiorA gravatar imageLiorA ( 2020-04-26 06:32:58 -0500 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2020-02-11 08:28:07 -0500

Akhil Patel gravatar image

Remove module from settings.gradle file or manually delete module which you do not add them in your repository.

edit flag offensive delete link more


the heaviest files is the '.so' files.

LiorA gravatar imageLiorA ( 2020-05-11 18:36:04 -0500 )edit

answered 2020-04-26 06:33:24 -0500

LiorA gravatar image

updated 2020-04-26 06:37:25 -0500


  • This is the way to do it, you will have to take the java wrappers from the Opencv site (from some reason it fail to produce them)

  • The java wrappers from opencv, have missing files (.project/.classpath/lint/ - Solve this problem before hand.

  • you still will have to play with it for a day or two..

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2020-02-11 02:18:00 -0500

Seen: 393 times

Last updated: Apr 26 '20