Intellij:android-support-v4.jar 包含在 actionBarSherlock 和 Project => 中非法参数异常 [英] Intellij: android-support-v4.jar in included in actionBarSherlock and Project => IllegalArgumentException
问题描述
我目前正在将我的所有项目从 Eclipse 迁移到 IntelliJ Idea.
I am currently migrating all my projects from Eclipse to IntelliJ Idea.
当我使用 Eclipse 时,该包仅包含在 ActionBarSherlock 库中,当该库包含在我的项目中时,所有内容都会自动添加.
When I was using Eclipse, the package was only included in ActionBarSherlock library and when the library was included in my project, everything was automatically added.
使用 IntelliJ,一旦将 android-support-v4.jar 添加到 ABS,这似乎还不够,因为我所有的导入都已损坏.
With IntelliJ, once the android-support-v4.jar is added to ABS, that does not seems enough, as all my imports are broken.
ActionBarSherlock (LibABS) 导入的屏幕截图:
一切看起来都很好,所有的 SherlockActivity 都很好,但是我的应用程序无法识别所有与支持相关的内容:
Everything seems fine, all the SherlockActivity are fine, but all the stuff related to support is not recognized in my application:
java: /home/user/workspace/....
cannot access android.support.v4.app.FragmentActivity
class file for android.support.v4.app.FragmentActivity not found
因此,我必须手动将 jar 复制到 libs 文件夹中,然后再次将其包含到我的项目中.
So, I have to copy manually the jar into a libs folder and include it to my project once again.
我的项目导入的屏幕截图:
导入已被识别,但是我现在收到此错误:
The imports are recognized, nut I now get this error:
Android Dex: [BeTrains-for-Android] UNEXPECTED TOP-LEVEL EXCEPTION:
Android Dex: [BeTrains-for-Android] java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ShareCompat$ShareCompatImplJB;
非常感谢您的帮助.
推荐答案
尝试使用依赖范围和导出标志.检查此页面的描述:依赖选项卡.
Try to play with dependencies scopes and export flags. Check this page for the description: dependency tab.
这篇关于Intellij:android-support-v4.jar 包含在 actionBarSherlock 和 Project => 中非法参数异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!