You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Joe Bowser (JIRA)" <ji...@apache.org> on 2016/09/22 17:32:21 UTC

[jira] [Resolved] (CB-11590) Gradle 'provided' not excluding dependancy from runtime

     [ https://issues.apache.org/jira/browse/CB-11590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joe Bowser resolved CB-11590.
-----------------------------
    Resolution: Won't Fix

This is a weird Gradle vs Android Studio issue where Gradle builds done manually will not be smart and exclude dependencies that are already provided.  It expects that you do the management of these jar dependencies yourself and exclude the shared so you don't compile them twice.  I recently ran into this with Cordova when playing with the idea of making cordova plugins Android Library modules.  Sadly, the solution was to resource intensive to go into the next version of Cordova, and it would only work for CordovaLib, and not for any third party solution.

Ideally, if you're editing the gradle-extras, you should probably know which dependencies to exclude and add the exclude call to the build-extras.gradle.

> Gradle 'provided' not excluding dependancy from runtime
> -------------------------------------------------------
>
>                 Key: CB-11590
>                 URL: https://issues.apache.org/jira/browse/CB-11590
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>            Reporter: Steven Reid
>              Labels: build, gradle
>
> I've created a build-extras.gradle to compile a 3rd party .jar dependancy into my application.  This 3rd party .jar dependancy exists on the android device under systems/framework so I need to only compile it, but not provide it at run time (otherwise I get DEX issues because 2 identical .jar files exist at runtime).  
> I've confirmed the .jar dependancy is compiled AND included in the apk file deployed to the android device using "dependancies { provided files('my-file.jar') }" in the build-extras.gradle file. Using android studio and a non-cordova based project i've used the same syntax (provided) and the my-file.jar was compiled BUT NOT included in the apk...thus it worked.  
> Why isn't 'provided' working the same way it works on a non-cordova android project?  And is there another way to get a .jar dependancy compiled but NOT included in the final apk file?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org