IntelliJ 12 + ActionBarSherlock设置:找不到类'android.support.v4.app.FragmentActivity' [英] IntelliJ 12 + ActionBarSherlock settings: Could not find class 'android.support.v4.app.FragmentActivity'

查看:2468
本文介绍了IntelliJ 12 + ActionBarSherlock设置:找不到类'android.support.v4.app.FragmentActivity'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于IntelliJ 12 + ABS(ActionBarSherlock)设置有很多Q& A。

There are numerous Q&A about IntelliJ 12 + ABS(ActionBarSherlock) settings.

这个问题但显示不同的错误。

总体编译和运行都可以,但只有使用选项卡导航的活动( SherlockActivity实现ActionBar.TabListener )会出现以下错误并导致崩溃。
请注意,我可以使用一般 SherlockActivity 显示良好。

Overall compilation and runnings are OK but only Activity using Tab Navigation(SherlockActivity implements ActionBar.TabListener) gives following error and crash. Note that I can use general SherlockActivity shows well.

找不到课程'android.support.v4.app.FragmentActivity',从方法com.actionbarsherlock.internal.app.ActionBarWrapper $ TabWrapper.onTabReselected引用每个重写方法( onTabUnselected onTabSelected onTabReselected )。

"Could not find class 'android.support.v4.app.FragmentActivity', referenced from method com.actionbarsherlock.internal.app.ActionBarWrapper$TabWrapper.onTabReselected" on every overriden methods (onTabUnselected, onTabSelected, onTabReselected).

它似乎android-support-v4没有被成功引用,但很难找到check / uncheck试错法。

It seems like android-support-v4 is not sucessfully referenced but hard to find with check/uncheck trial-and-errors.

我的IntelliJ项目设置如下。

My IntelliJ project settings are as below.

1。库是ABS库文件夹的名称。

2。我的项目设置。

我将android-support-v4设置为提供
我还能做些什么?

I set both android-support-v4 to provided. What can I do more?

有些答案说删除android-support-v4 到我自己的项目但它显示参考错误 import android.support.v4.app.FragmentTransaction 因为实现了ActionBar.TabListener 需要它。

Some answers said to remove android-support-v4 to my own project but it shows reference errors on import android.support.v4.app.FragmentTransaction because implements ActionBar.TabListener requires it.

推荐答案

此配置不正确, android-support-v4 库的范围必须设置为编译,因为它不在Android上,并且必须包含在您的应用中。

This configuration is not correct, the scope of the android-support-v4 library must be set to Compile as it's not present on Android and must be included in your application.

的第二个副本必须从应用程序依赖项中删除android-support-v4 ,它将通过为启用导出选项的库模块提供给您的应用程序android-support-v4

Second copy of android-support-v4 must be removed from the application dependencies, it will be available to your application via a library module that has Export option enabled for android-support-v4.

这篇关于IntelliJ 12 + ActionBarSherlock设置:找不到类'android.support.v4.app.FragmentActivity'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆