android - Issues with dependencies, modules. How do I properly reference this library? -


i'm confused something. i'm working on android app 2 modules. here's project structure

myproject    app       libs          abc.jar       src       etc...    importedproject       libs       src       etc...       build.gradle    build.gradle 

if right click on abc.jar, , choose add library..., dialog comes asking me module add options app , importedproject.

if select importedproject, adds dependency importedproject's build.gradle file.. uses full path file on hard drive.

compile files('c:/users/my.name/workspace/myproject/app/libs/abc.jar') 

i'm confused why it's using full local path rather relative. android studio warns me not this, yet me.

i've tried these , none work:

compile files('app/libs/abc.jar') compile files('myproject/app/libs/abc.jar') 

anyone know i'm doing wrong here? thank you

edit:

got work using:

compile files('../app/libs/abc.jar') 

however, i've read using relative paths bad idea. there better solution?

paths in gradle build file typically relative location of build file. in case want path relative root project.

compile files("${rootproject.projectdir}/app/libs/abc.jar") 

Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -