Gradle exclude lib imported by dependence from built apk Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experience Should we burninate the [wrap] tag?Android apk - How to exclude a .so file from a 3rd party dependency using gradleIs there a way to get the source code from an APK file?How can I force gradle to redownload dependencies?How to create a release signed apk file using Gradle?How to set versionName in APK filename using gradle?Android Gradle plugin 0.7.0: “duplicate files during packaging of APK”Using gradle to find dependency treeHow to set gradle home while importing existing project in Android studiogradle distribution lib excludeIntellij Idea: Importing Gradle project - getting JAVA_HOME not defined yetExcluding the same group from multiple dependencies in gradle?

What are 'alternative tunings' of a guitar and why would you use them? Doesn't it make it more difficult to play?

Why does Python start at index 1 when iterating an array backwards?

The logistics of corpse disposal

What happens to sewage if there is no river near by?

Why is "Captain Marvel" translated as male in Portugal?

What is this single-engine low-wing propeller plane?

What is the correct way to use the pinch test for dehydration?

Is there a documented rationale why the House Ways and Means chairman can demand tax info?

Is there a "higher Segal conjecture"?

If a contract sometimes uses the wrong name, is it still valid?

If 'B is more likely given A', then 'A is more likely given B'

What are the motives behind Cersei's orders given to Bronn?

Bonus calculation: Am I making a mountain out of a molehill?

What LEGO pieces have "real-world" functionality?

Is 1 ppb equal to 1 μg/kg?

Do I really need recursive chmod to restrict access to a folder?

Right-skewed distribution with mean equals to mode?

Is a manifold-with-boundary with given interior and non-empty boundary essentially unique?

Java 8 stream max() function argument type Comparator vs Comparable

Why are there no cargo aircraft with "flying wing" design?

Doubts about chords

I am not a queen, who am I?

If Jon Snow became King of the Seven Kingdoms what would his regnal number be?

How to deal with a team lead who never gives me credit?



Gradle exclude lib imported by dependence from built apk



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
The Ask Question Wizard is Live!
Data science time! April 2019 and salary with experience
Should we burninate the [wrap] tag?Android apk - How to exclude a .so file from a 3rd party dependency using gradleIs there a way to get the source code from an APK file?How can I force gradle to redownload dependencies?How to create a release signed apk file using Gradle?How to set versionName in APK filename using gradle?Android Gradle plugin 0.7.0: “duplicate files during packaging of APK”Using gradle to find dependency treeHow to set gradle home while importing existing project in Android studiogradle distribution lib excludeIntellij Idea: Importing Gradle project - getting JAVA_HOME not defined yetExcluding the same group from multiple dependencies in gradle?



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I'm using one api in my project that is maintained by a small team of developers and not very good ones.



This api intent to manage payment process with a specific gateway from brazil, so if I dont use this api i would need to reverse engineer all the gateway process what woult be even more complicated.



The api has many flaws and i'm always in contact with the developer team to fix them but there is one major problem in my point that they are not willing to solve



enter image description here



They do import fresco and add those libs into their dependency BUT IM 100% SURE THEY DONT USE IT



I've checked fresco documentation and the libwebp.so is intent to load webp images in older versions of android, my app is minsdk 16 it doesn't need it anyway



the other lib i dont know what is the usage but i'm pretty sure they dont use it, they just included because someone told them to do...



My app have a final apk size around 3MB and after including this only payment api it got 6MB size (unnaceptable in my opinion since a payment gateway should be as small as possible)



THE QUESTION IS:
How can i tell gradle to exclude from the build file those libs imported by the dependency i'm importing?










share|improve this question
























  • Possible duplicate of Android apk - How to exclude a .so file from a 3rd party dependency using gradle

    – Martin Zeitler
    Mar 9 at 5:18

















0















I'm using one api in my project that is maintained by a small team of developers and not very good ones.



This api intent to manage payment process with a specific gateway from brazil, so if I dont use this api i would need to reverse engineer all the gateway process what woult be even more complicated.



The api has many flaws and i'm always in contact with the developer team to fix them but there is one major problem in my point that they are not willing to solve



enter image description here



They do import fresco and add those libs into their dependency BUT IM 100% SURE THEY DONT USE IT



I've checked fresco documentation and the libwebp.so is intent to load webp images in older versions of android, my app is minsdk 16 it doesn't need it anyway



the other lib i dont know what is the usage but i'm pretty sure they dont use it, they just included because someone told them to do...



My app have a final apk size around 3MB and after including this only payment api it got 6MB size (unnaceptable in my opinion since a payment gateway should be as small as possible)



THE QUESTION IS:
How can i tell gradle to exclude from the build file those libs imported by the dependency i'm importing?










share|improve this question
























  • Possible duplicate of Android apk - How to exclude a .so file from a 3rd party dependency using gradle

    – Martin Zeitler
    Mar 9 at 5:18













0












0








0








I'm using one api in my project that is maintained by a small team of developers and not very good ones.



This api intent to manage payment process with a specific gateway from brazil, so if I dont use this api i would need to reverse engineer all the gateway process what woult be even more complicated.



The api has many flaws and i'm always in contact with the developer team to fix them but there is one major problem in my point that they are not willing to solve



enter image description here



They do import fresco and add those libs into their dependency BUT IM 100% SURE THEY DONT USE IT



I've checked fresco documentation and the libwebp.so is intent to load webp images in older versions of android, my app is minsdk 16 it doesn't need it anyway



the other lib i dont know what is the usage but i'm pretty sure they dont use it, they just included because someone told them to do...



My app have a final apk size around 3MB and after including this only payment api it got 6MB size (unnaceptable in my opinion since a payment gateway should be as small as possible)



THE QUESTION IS:
How can i tell gradle to exclude from the build file those libs imported by the dependency i'm importing?










share|improve this question
















I'm using one api in my project that is maintained by a small team of developers and not very good ones.



This api intent to manage payment process with a specific gateway from brazil, so if I dont use this api i would need to reverse engineer all the gateway process what woult be even more complicated.



The api has many flaws and i'm always in contact with the developer team to fix them but there is one major problem in my point that they are not willing to solve



enter image description here



They do import fresco and add those libs into their dependency BUT IM 100% SURE THEY DONT USE IT



I've checked fresco documentation and the libwebp.so is intent to load webp images in older versions of android, my app is minsdk 16 it doesn't need it anyway



the other lib i dont know what is the usage but i'm pretty sure they dont use it, they just included because someone told them to do...



My app have a final apk size around 3MB and after including this only payment api it got 6MB size (unnaceptable in my opinion since a payment gateway should be as small as possible)



THE QUESTION IS:
How can i tell gradle to exclude from the build file those libs imported by the dependency i'm importing?







android gradle android-gradle build.gradle






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 8 at 16:21









Zoe

13.6k85486




13.6k85486










asked Mar 8 at 16:19









Rafael LimaRafael Lima

524420




524420












  • Possible duplicate of Android apk - How to exclude a .so file from a 3rd party dependency using gradle

    – Martin Zeitler
    Mar 9 at 5:18

















  • Possible duplicate of Android apk - How to exclude a .so file from a 3rd party dependency using gradle

    – Martin Zeitler
    Mar 9 at 5:18
















Possible duplicate of Android apk - How to exclude a .so file from a 3rd party dependency using gradle

– Martin Zeitler
Mar 9 at 5:18





Possible duplicate of Android apk - How to exclude a .so file from a 3rd party dependency using gradle

– Martin Zeitler
Mar 9 at 5:18












1 Answer
1






active

oldest

votes


















0














Example of excluding modules from support library. 
implementation ('com.android.support:appcompat-v7:28.0.3')
exclude group: 'com.android.support', module: 'support-annotations'






share|improve this answer

























  • uhm. have you read the question? besides, this version number does not even exist.

    – Martin Zeitler
    Mar 9 at 5:18












  • Martin, I am sorry to mention that this was only for example, not exact solution.

    – Ranjan Kumar
    Mar 9 at 5:59











  • sorry, but this has absolutely nothing to do with the question. just see the answer I've linked... the topic here aren't support libraries, it's not even Java dependencies.

    – Martin Zeitler
    Mar 9 at 5:59












  • Thanks Martin. Learned more from your post.

    – Ranjan Kumar
    Mar 9 at 6:01











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55067100%2fgradle-exclude-lib-imported-by-dependence-from-built-apk%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Example of excluding modules from support library. 
implementation ('com.android.support:appcompat-v7:28.0.3')
exclude group: 'com.android.support', module: 'support-annotations'






share|improve this answer

























  • uhm. have you read the question? besides, this version number does not even exist.

    – Martin Zeitler
    Mar 9 at 5:18












  • Martin, I am sorry to mention that this was only for example, not exact solution.

    – Ranjan Kumar
    Mar 9 at 5:59











  • sorry, but this has absolutely nothing to do with the question. just see the answer I've linked... the topic here aren't support libraries, it's not even Java dependencies.

    – Martin Zeitler
    Mar 9 at 5:59












  • Thanks Martin. Learned more from your post.

    – Ranjan Kumar
    Mar 9 at 6:01















0














Example of excluding modules from support library. 
implementation ('com.android.support:appcompat-v7:28.0.3')
exclude group: 'com.android.support', module: 'support-annotations'






share|improve this answer

























  • uhm. have you read the question? besides, this version number does not even exist.

    – Martin Zeitler
    Mar 9 at 5:18












  • Martin, I am sorry to mention that this was only for example, not exact solution.

    – Ranjan Kumar
    Mar 9 at 5:59











  • sorry, but this has absolutely nothing to do with the question. just see the answer I've linked... the topic here aren't support libraries, it's not even Java dependencies.

    – Martin Zeitler
    Mar 9 at 5:59












  • Thanks Martin. Learned more from your post.

    – Ranjan Kumar
    Mar 9 at 6:01













0












0








0







Example of excluding modules from support library. 
implementation ('com.android.support:appcompat-v7:28.0.3')
exclude group: 'com.android.support', module: 'support-annotations'






share|improve this answer















Example of excluding modules from support library. 
implementation ('com.android.support:appcompat-v7:28.0.3')
exclude group: 'com.android.support', module: 'support-annotations'







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 9 at 5:58

























answered Mar 9 at 5:12









Ranjan KumarRanjan Kumar

1804




1804












  • uhm. have you read the question? besides, this version number does not even exist.

    – Martin Zeitler
    Mar 9 at 5:18












  • Martin, I am sorry to mention that this was only for example, not exact solution.

    – Ranjan Kumar
    Mar 9 at 5:59











  • sorry, but this has absolutely nothing to do with the question. just see the answer I've linked... the topic here aren't support libraries, it's not even Java dependencies.

    – Martin Zeitler
    Mar 9 at 5:59












  • Thanks Martin. Learned more from your post.

    – Ranjan Kumar
    Mar 9 at 6:01

















  • uhm. have you read the question? besides, this version number does not even exist.

    – Martin Zeitler
    Mar 9 at 5:18












  • Martin, I am sorry to mention that this was only for example, not exact solution.

    – Ranjan Kumar
    Mar 9 at 5:59











  • sorry, but this has absolutely nothing to do with the question. just see the answer I've linked... the topic here aren't support libraries, it's not even Java dependencies.

    – Martin Zeitler
    Mar 9 at 5:59












  • Thanks Martin. Learned more from your post.

    – Ranjan Kumar
    Mar 9 at 6:01
















uhm. have you read the question? besides, this version number does not even exist.

– Martin Zeitler
Mar 9 at 5:18






uhm. have you read the question? besides, this version number does not even exist.

– Martin Zeitler
Mar 9 at 5:18














Martin, I am sorry to mention that this was only for example, not exact solution.

– Ranjan Kumar
Mar 9 at 5:59





Martin, I am sorry to mention that this was only for example, not exact solution.

– Ranjan Kumar
Mar 9 at 5:59













sorry, but this has absolutely nothing to do with the question. just see the answer I've linked... the topic here aren't support libraries, it's not even Java dependencies.

– Martin Zeitler
Mar 9 at 5:59






sorry, but this has absolutely nothing to do with the question. just see the answer I've linked... the topic here aren't support libraries, it's not even Java dependencies.

– Martin Zeitler
Mar 9 at 5:59














Thanks Martin. Learned more from your post.

– Ranjan Kumar
Mar 9 at 6:01





Thanks Martin. Learned more from your post.

– Ranjan Kumar
Mar 9 at 6:01



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55067100%2fgradle-exclude-lib-imported-by-dependence-from-built-apk%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

1928 у кіно

Захаров Федір Захарович

Ель Греко