转自:http://blog.163.com/smilecatflower_18z/blog/static/1926270452011102523921331/

2011-11-25 14:46:12|分类: android |标签:开发问题及解决 |字号订阅

1 .导入含有第三方jar包的项目时,无法定位项目中的jar包,“This will not be added to the package." 解决方法: 右击项目--->BuildPath-->Configuration Build Path--> 选中右侧的”Libraries“标签-->选中带有红叉的jar包并Remove; 然后单击”Add JARs“,找到该jar包在本项目中的位置就可以了。 如果运行后出现”Could not find .apk“,可以重新导入项目就可以了。
关于Could not find xxx.apk可
参考: http://blog.csdn.net/johee/article/details/5521310 2. “gen already exists but is not a source folder. Convert to a source folder or rename it” 右击项目选"Properties"-->在左侧选中"Java Build Path"-->打开右侧的“ Source”标签-->单击 "Add Folder..."-->在弹出的对话框中选中 "gen" ,点击ok,ok; 右击项目选 "Andriod Tools" -->选中单击 "Fix Project Properties" 以下是英文说明:
  1. Right click on the project and go to "Properties
  2. Select "Java Build Path" on the left
  3. Open "Source" tab
  4. Click "Add Folder..."
  5. Check "gen" folder and click Ok and Ok again
  6. Again right click on the project and in the "Andriod Tools" click on "Fix Project Properties"
  7. 来自逆流的鱼的百度空间
  8. http://hi.baidu.com/flash_fish/blog/item/0237e11dc86c529786d6b60b.html
3. ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent

最近在调试程序的时候经常出现ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.xxxxx.xxxxx/.ui.xxxxxxx } from null (pid=-1, uid=-1) requires null的问题,困扰我好几天了,一开始只是认为权限的问题,跟了好久一直没有解决。

后来看到:

The java.lang.SecurityException you are seeing is because you may enter two entries pointing to same activity. Remove the second one and you should be good to go.

才发现这个Activity在Manifest文件里写了两份,去掉一份后,终于可以正常运行了。

注:此问题还会引起,在手机端点击程序图标时,会提示程序未安装在手机上。

http://hi.baidu.com/b__a__i__d__u/blog/item/645fe45c1537a05afbf2c0fa.html

4.java.lang.IllegalArgumentException: x + width must be <= bitmap.width()

调用截图方法时应用强制退出: public Bitmap takeScreenShot(Activity activity){
//View是你需要截图的View View view = activity.getWindow().getDecorView(); view.setDrawingCacheEnabled(true); view.buildDrawingCache(); b1 = view.getDrawingCache(); //获取状态栏高度 Rect frame = new Rect(); activity.getWindow().getDecorView().getWindowVisibleDisplayFrame(frame); int statusBarHeight = frame.top; //获取屏幕长和高 int width = activity.getWindowManager().getDefaultDisplay().getWidth(); //去掉标题栏 b = Bitmap.createBitmap(b1, 0, statusBarHeight, 350, b1.getHeight()-statusBarHeight); view.destroyDrawingCache(); return b; } 解决方法: x + width must be <= bitmap.width()宽度超出了你要截的图的宽度~width改成b1.getWidth() 来自: http://topic.csdn.net/u/20111031/10/4472919e-4653-4d5f-b9ae-b66277823ee5.html 5. Activity XXXX(项目名) has leaked ServiceConnection 解决方法: 在onDestory方法里解除绑定服务就ok,解除绑定后服务还是可以运行的。
@Override
protected void onDestroy() {
// TODO Auto-generated method stub
this.unbindService(conn);
super.onDestroy();
}

更多相关文章

  1. 优秀Android开源项目
  2. Caused by: com.android.builder.dexing.DexArchiveBuilderExcep
  3. Android(安卓)PinnedSectionListView 收缩
  4. 安卓巴士Android开发神贴整理
  5. Android(安卓)Studio:resource android:attr/dialogCornerRadius
  6. Android读取xxx.properties配置文件中文出现乱码解决方法
  7. android studio 项目的版本问题
  8. Android原生项目引入最新的React Native包
  9. 安卓巴士Android开发神贴整理

随机推荐

  1. Kubernetes Pod水平自动伸缩(HPA)
  2. git常用命令
  3. OpenKruise v0.8.0 版本发布:K8s 社区首个
  4. Linux运维入门教程01-02 (UNIX和Linux操
  5. 冲着这份大数据分析案例,我立马下载该分析
  6. 掌握这8个Java实战小技巧,再也不用为了内
  7. Prometheus警报规则
  8. 厌倦了excel绘制地图的繁琐操作,来看看这
  9. 3种方法,隐藏苹果Mac档案、资料夹
  10. Kubernetes日志系统新贵Loki-Stack