GitHub上最火的开源项目SlidingMenu导入出错的终极解决方案
SlidingMenu 开源项目下载地址 : https://github.com/jfeinstein10/slidingmenu
Actionbarsherlock 开源项目下载地址 :http://actionbarsherlock.com/download.html
导入步骤如下:
1.将下载的Actionbarsherlock中/actionbarsherlock文件夹复制到workspace(你的项目工作空间),改名为Actionbarssherlock,从eclipse中操作new->project->Android Project from Existing Code将项目添加进去,target改为api14以上。
2.将下载的slidingmenu中/library文件夹复制到workspace(你的项目工作空间),改名SlidingMenu, 从eclipse中操作new->project->Android Project from Existing Code将项目添加进去,target改为Google APIs 14以上。 或者打开project.properties:target=Google Inc.:Google APIs:14或更高。
3.这样SlidingMenu就可以用在自己项目中了。让我们来运行例子。解压slidingmenu中/example。 从eclipse中操作new->project->Android Project from Existing Code将项目添加进去,target改为api14以上。 运行看看效果。2.1以上的系统都可以运行。
导入之后可能会出现的问题如下:
1、 SlidingMenu library project出现错误
Console error: Unable to resolve target ‘Google Inc.:Google APIs:16.
Fix: 进入 Properties检查Target sdk是否选择了 Google APIs.
List of errors: ACTION_POINTER_INDEX_MASK cannot be resolved android.
HONEYCOMB cannot be resolved or is not a field
LAYER_TYPE_HARDWARE cannot be resolved or is not a field
LAYER_TYPE_NONE cannot be resolved or is not a field
MATCH_PARENT cannot be resolved or is not a field
The method getLayerType() is undefined for the type View
The method setLayerType(int, null) is undefined for the type ViewFix: 将manifest里面的min sdk version 改为你当前用到的sdk版本,7
2、SlidingMenu example project出现错误
Console error: Found 2 versions of android-support-v4.jar in the dependency list,but not all the versions are identical (check is based on SHA-1 only at this time). Jar mismatch! Fix your dependencies
Fix: 这是由于jar包版本不一致导致的,检查SlidingMenu和Actionbarsherlock中的\libs文件夹里的哪个android-support-v4.jar版本比较新,用新的替换掉其中的老版本. 如果错误还是会出现,就clean项目并重启eclipse.
List of errors: The method getSupportActionBar() is undefined for the type BaseActivity
The method getSupportMenuInflater() is undefined for the type BaseActivity
The method onCreateOptionsMenu(Menu) of type BaseActivity must override or implement a supertype method
The method onOptionsItemSelected(MenuItem) in the type Activity is not applicable for the arguments
The method onOptionsItemSelected(MenuItem) of type BaseActivity must override or implement a supertype method
The method onOptionsItemSelected(MenuItem) of type ResponsiveUIActivity must override or implement a supertype methodFix: 打开SlidingMenu library project里SlidingFragmentActivity这个类并在声明前添加以下代码:
import com.actionbarsherlock.app.SherlockFragmentActivity;
然后,将下面这个父类:
public class SlidingFragmentActivity extends FragmentActivity implements SlidingActivityBase {换成Actionbarsherlock里的另外一个父类(如果此时Library没有引用Actionbarsherlock库项目,则先引用之) :
public class SlidingFragmentActivity extends SherlockFragmentActivity implements SlidingActivityBase {附上运行效果图之一:

GitHub上最火的开源项目SlidingMenu导入出错的终极解决方案的更多相关文章
- 【转】GitHub平台最火Android开源项目整理——2013-08-25 17
http://game.dapps.net/news/developer/9199.html GitHub在中国的火爆程度无需多言,越来越多的开源项目迁移到GitHub平台上.更何况,基于不要重复造轮 ...
- 如何在 Github 上发现优秀的开源项目?
之前发过一系列有关 GitHub 的文章,有同学问了,GitHub 我大概了解了,Git 也差不多会使用了,但是还是搞不清 GitHub 如何帮助我的工作,怎么提升我的工作效率? 问到点子上了,Git ...
- 【转载】如何在 Github 上发现优秀的开源项目?
之前发过一系列有关 GitHub 的文章,有同学问了,GitHub 我大概了解了,Git 也差不多会使用了,但是还是搞不清 GitHub 如何帮助我的工作,怎么提升我的工作效率? 问到点子上了,Git ...
- Golang优秀开源项目汇总, 10大流行Go语言开源项目, golang 开源项目全集(golang/go/wiki/Projects), GitHub上优秀的Go开源项目
Golang优秀开源项目汇总(持续更新...)我把这个汇总放在github上了, 后面更新也会在github上更新. https://github.com/hackstoic/golang-open- ...
- (转载)如何在 Github 上发现优秀的开源项目?
转载自:传送门 之前发过一系列有关 GitHub 的文章,有同学问了,GitHub 我大概了解了,Git 也差不多会使用了,但是还是搞不清 GitHub 如何帮助我的工作,怎么提升我的工作效率? 问到 ...
- GitHub上不错的Android开源项目(三)
收集相关系列资料,自己用作参考,练习和实践.小伙伴们,总有一天,你也能写出 Niubility 的 Android App :-) GitHub上不错的Android开源项目(一):http://ww ...
- GitHub上不错的Android开源项目(二)
收集相关系列资料,自己用作参考,练习和实践.小伙伴们,总有一天,你也能写出 Niubility 的 Android App :-) 系列文章如下: GitHub上不错的Android开源项目(一):h ...
- [转]GitHub上优秀的Go开源项目
转载于GitHub上优秀的Go开源项目 正文 近一年来,学习和研究Go语言,断断续续的收集了一些比较优秀的开源项目,这些项目都非常不错,可以供我们学习和研究Go用,从中可以学到很多关于Go的使用.技巧 ...
- 2018上半年GitHub上最热门的开源项目
关注GitHub的人都知道,这个平台上面有太多优秀的值得学习的开源项目了,这里总结了2018上半年GitHub上最热门的开源项目. 1: tensorflow https://github.com/t ...
随机推荐
- HDU 4628 多校第三场1008 dp
这题就没什么好说的了.直接枚举2 ^ 16 的状态,用1表示拿这位,0表示不拿,每次判断是否可以这么拿. #include <iostream> #include <cstdio&g ...
- XML转义特殊字符
正常来说,只有"<" 字符和"&"字符对于XML来说是严格禁止使用的. 需要注意的是: a. 转义序列各字符间不能有空格: b. 转义序列必须以& ...
- Fuel4D 2.1 免费跨平台游戏引擎 现已发布
Fuel4D 2.1 免费跨平台游戏引擎 现已发布 开发环境:纯 C/C++,无JAVA.O-C. 支持 WIN32.安卓 系统. 详情见官方网站:http://www.fuel4d.com 或者进F ...
- KMP学习笔记
功能 字符串T,长度为n. 模板串P,长度为m.在字符串T中找到匹配点i,使得从i开始T[i]=P[0], T[i+1]=P[1], . . . , T[i+m-1]=P[m-1] KMP算法先用O( ...
- excel数据导入到sqlserver中---------工作笔记
调用页面: using System; using System.Collections.Generic; using System.Linq; using System.Web; using Sys ...
- Mysql 列转行group_concat函数,与行转列
1.正常情况. SELECT JoinEventIds from nt_mainnum 2.使用group_concat函数 select group_concat(JoinEventIds) fro ...
- Iframe之间及iframe与父窗体之间值的传递
方法一:ScriptManager.RegisterClientScriptBlock(this,typeof(Page), "NoInformation", "wind ...
- model 和 view 实现思考
采用model.view = view 和 view.model=model 进行双向绑定,还有一种方案是采用id号进行绑定,viewmodel的views 和 models 属性存放所有的id 映 ...
- 爬虫爬oj用户头像
import requests import Queue import urllib import urllib2 import re import requests alreadyImg = set ...
- 『重构--改善既有代码的设计』读书笔记----Remove Assignments to Parameters
C++存在按值传递和按引用传递两种传递方式,Java严格按照按值传递这种方式来进行.以按值传递方式的角度来说,如果你 int test(int a) { ) { a = 1; } return a; ...