zoukankan      html  css  js  c++  java
  • eclipse中一些问题

    eclipse中一些问题

    安装时

    1.eclipse安装后没有Android SDK Manager与Android Virstual Diverce Manager 图标

     解决方法:首先,保证正确安装ADT插件并重启(检查方法:检查是否正确安装的一种方式:打开Window——>Preferences属性,如果看到了名为Android的内容,就基本说明ok了);  操作:打开eclipse ->window->costomize Perpective(定做透视图)->Command Groups Availability选项卡,选中Android SDK and AVD Manager

    2.Android SDK Manager无法获取更新版本列表

     解决方法:打开Android SDK Manager ->Tools->Settings。  然后(a)网址:mirrors.neusoft.edu.cn 端口:80  (b)勾选”Force http://...”选项

    3.NDK配置时“Not a valid NDK directory

     解决方法:下载的r11c需要添加至build这一层

    项目加载问题

    1.android.support.v7库有小红叉

     原因::android.support.v7库的build target选择版本问题(版本低)。如:error: Error retrieving parent for item: No resource found that matches the given name

     解决方法:在project.properties中修改target;或者右键该库——>properties——>修改target——>菜单栏中的project——>clean(可能会失败)。

    2.报错:Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCom

     原因:未添加相应的库;

     解决方法:右键项目——>properties——>Android——>Library——>add相应库,注意不要勾选is library

    3.报错:The import android.support.v7.app cannot be resolved

     解决方法:(1)添加库后与项目一起clean;如果还不行(2)选中项目-->右键-->Properties——>Java build path——>library中添加android-support-v7.jar(或在在libs中放入android-support-v7.jar文件

    4.报错:Call requires API level 11 (current min is 8): android.app.Activity#onCreateView

     解决方法::在project.properties中修改8为11

    5.报错:activity_main cannot be resolved or is not a field

     原因:可能是添加文件,比如xml文件或者资源文件时,系统自动添加了import android.R; android.R是系统提供的资源,R是应用程序的资源

     解决方法:删除 import android.R;这条语句

    6.(OpenCV导入)报错:Import of android.hardware.camera2 cannot be resolved

     原因:build target选择版本问题(版本低)

     解决方法:在project.properties中修改target

    7.注意:复制代码有时候会自动导入原代码所在包,导致报错。

    8.使用高版本的SDK后再导入以前用低版本的project,(1)Unable to resolve target 'android-5';(2)Conversion to Dalvik format failed with error 1

     解决方法:(1)本机中现在使用的是2.2的SDK,API的版本是8;而导入的工程使用的是2.0开发的,其API版本是5。 需要将default.properties中的target=android-5改为target=android-8就好了。但要注意,也要同步将AndroidManifest.xml中的改为,否则编译中会警告提示使用的版本过低。  (2)这个与加载的SDK有关,通过“右键选择工程build path -> configure build path... -> libraries发现导入的JARs中除了一个Android 2.2外还有一个同路径下的文件夹item,将其移除。

    9.报错:android library projects cannot be launched

     解决方法:properties 的android选项中将 is library中将前面的勾去了

    10.报错:android-support-v7-appcompat] Could not find android-support-v7-appcompat.apk!

     解决方法:不要再java built path——>projects中添加android-support-v7库,若要用该库,则首先在Android——>library中添加,再在libs中放入android-support-v7.jar文件(或Java build path——>library中添加android-support-v7.jar)。

    其他

    1.报错:error: Error parsing XML: not well-formed (invalid token)

     原因:格式问题

     解决方法:(如)

    把
    <TextView
    		…
    />
    改为 
    <TextView>
    	…	
    </TextView>
    

    2.报错:The method FindViewById(int) is undefined for the type MainActivity

     原因:MainActivity没有继承Activity

    3.点开activity_main.xml这个文件在应该出现一个可以直接往里面拖控件的界面啊,可是我的界面里面就是什么都没有,然后就出现以下信息:

    Failed to find the style corresponding to the id 2130772026
    Failed to find the style corresponding to the id 2130771996
    java.lang.NullPointerException
    

     解决方法:调低API(Activity界面上数字下拉框的) (优选)或 重启Eclipse 都有用或下拉App Theme——>Holo——>选择一个Theme

  • 相关阅读:
    (转)linux书籍推荐
    (转)X Windows与GNOME,KDE的关系
    (转)学习Linux编程开发必读书籍
    (转)详解C中volatile关键字
    博客开张了
    VMware虚拟产品简介
    c++ eof()
    旋转矩阵
    VMware文件辨别
    Microsoft HTTPAPI/2.0 use Port 80 – 无法启动WAMP Apache
  • 原文地址:https://www.cnblogs.com/silentteen/p/6535572.html
Copyright © 2011-2022 走看看