添加一个模块依赖它包含其他相关性 [英] Add a module dependency which contains other dependencies
问题描述
我用的IntelliJ 12。
我有一个模块A
有模块依赖于Github上项目。我加入到我的主模块B
依赖于模块A
。
模块A
依赖于模块1
,模块2
, module3
,...
模块B
依赖于模块A
但模块B
未找到任何引用模块1
,模块2
,......这就是我在Eclipse中宣称它(增加库项目)和它的作品。
现在,如果我加入模块B
的模块1
,模块2
...它会影响模块B
project.properties搞乱与Eclipse。我可以从Eclipse中得到这个
I'm using IntelliJ 12 .
I have a Module A
which has module dependencies to github projects. I added to my main Module B
a dependency to Module A
.
Module A
depends on module1
, module2
, module3
, ...
Module B
depends on Module A
But Module B
doesn't find any reference to module1
, module2
, ... That's how I declared it in Eclipse ( "add library project" ) and it works.
Now if I add to Module B
the module1
, module2
... it will affect Module B
project.properties messing up with Eclipse. I can get this from Eclipse
敏捷装载机]无法执行DEX:多DEX文件中定义
模块
B]转换为的Dalvik格式失败:无法执行DEX:多
DEX文件
Dex Loader] Unable to execute dex: Multiple dex files define
Module B] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files
是什么在的IntelliJ以正确的方式,从它本身包含几个相关性的模块添加依赖关系?
What's the right way in IntelliJ to add dependency from a module which itself contains several dependencies ?
修改 我也跟着疯狂codeR的说明。然后的IntelliJ告诉
EDIT I followed CrazyCoder's instructions. Then IntelliJ is telling
安卓敏捷:[模块B]意外的顶级例外:机器人敏捷: [模块B] java.lang.IllegalArgumentException:如果已经加入: Landroid /支持/ V4 / APP / ShareCompat $ ShareCompatImplJB; Android的地塞米松: [模块B]在 com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123) 安卓敏捷:[模块B]在 com.android.dx.dex.file.DexFile.add(DexFile.java:163)
Android Dex: [Module B] UNEXPECTED TOP-LEVEL EXCEPTION: Android Dex: [Module B] java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ShareCompat$ShareCompatImplJB; Android Dex: [Module B] at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123) Android Dex: [Module B] at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
一些模块1
,模块2
...包含Android的支持,v4.jar在libs文件夹。该JAR依赖被添加,但不出口。
只有模块A
有库(包含libs文件夹中的所有jar)出口
Some of module1
, module2
... contain android-support-v4.jar in libs folder. The jar dependency is added but not exported.
Only Module A
has its library (containing all the jar in libs folder) exported
推荐答案
由于疯狂codeR,我出口的所有依赖关系,从模块A
Thanks to CrazyCoder, I exported all the dependencies from Module A
对于同样的.jar的多个依赖。我只是设置Android的支持,v4.jar为项目库
。看完<一href="http://stackoverflow.com/questions/14099291/intellij-android-support-v4-jar-in-included-in-actionbarsherlock-and-project">Intellij: Android的支持,v4.jar在列入actionBarSherlock和项目=&GT;抛出:IllegalArgumentException 。我改变范围从编译
到提供
Android的支持-V4中引用它的所有模块。
For the multiple dependencies of the same .jar . I just set android-support-v4.jar as Project Library
. After reading Intellij: android-support-v4.jar in included in actionBarSherlock and Project => IllegalArgumentException . I changed the scope from Compile
to Provided
of android-support-v4 in all Modules that references it.
这篇关于添加一个模块依赖它包含其他相关性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!