`
modabobo
  • 浏览: 508297 次
文章分类
社区版块
存档分类
最新评论

gen already exists but is not a source folder. Convert to a source folder or rename it.

 
阅读更多

异常提示:

gen already exists but is not a source folder. Convert to a source folder or rename it.

错误原因:

我在导入以前的项目的时候出现了这个异常,原因是.classpath文件(这个文件在eclipse中是看不到的,必须在文件浏览器中才能看到并编辑)出错,导致eclipse不能识别我的src代码文件夹,需要通过设置来指明源码所在的文件夹。

解决办法:

右键项目,选择Properties——Java Build Path——Source——Add Folder...
然后在弹出框中选中项目的src和gen目录,OK即可。如下图所示:



当然,既然是.classpath文件出错,我们也可以通过手动修改.classpath文件来修复这个错误,下面我们来看下正常的.classpath文件,如下:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="src" path="src"/>
	<classpathentry kind="src" path="gen"/>
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
	<classpathentry exported="true" kind="lib" path="libs/android-support-v4.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/gson-2.2.4.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/umeng_sdk.jar"/>
	<classpathentry kind="output" path="bin/classes"/>
</classpath>


kind="src"指明源码位置
kind="con"指明当前系统环境
kind="lib"指明工程依赖的library的具体位置
kind="output"指明项目生成文件的输入位置

修复这个异常只需要我们手动指明src的源码位置即可。
分享到:
评论

相关推荐

    apktool documentation

    This retains the apk is nearly original format, but will make rebuild more than likely not work due to ignoring the changes that newer aapt requires After [d]ecode, there will be new folders ...

    VB编程资源大全(英文源码 文件)

    parsepth.zip Parse a File's Path&lt;END&gt;&lt;br&gt;45,isdirect.zip Determine if a Directory Exists&lt;END&gt;&lt;br&gt;46,isfile.zip Determine if a File Exists&lt;END&gt;&lt;br&gt;47,createdir.zip Create a Directory&lt;END&gt;...

    edjpgcom|图片中插入一句话

    edjpgcom is a free Windows application that allows you to change (or add) a JPEG commment in a JPEG file. That's all it does. All other fields in a JFIF or Exif file are left untouched. It even keeps ...

    ChromeCacheView

    The software is provided "AS IS" without any warranty, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose....

    BUS Hound

    It is possible for Commands to be overlapped at the I/O subsystem level (which Bus Hound displays), but not at the hardware level. &lt;br&gt;Multiple DI/DO phases &lt;br&gt;Windows 9x only: if multiple DI/...

    windows copy (复制) 工具

    Copy the file to the new location and rename it right away. example4: ycopy.exe -s=C:\Users\Yun Liu\Desk*\test\*Temp\*source*.txt;-b=C:\Users\Yun Liu\Desktop\test\backup\2010source.txt;-i=0;/o Only ...

    8-07-14_MegaCLI for linux_windows

    LSIP200232870 (DFCT) Add a Gen2 to Gen3 toggle function and a check for the PCI speed to MegaSCU/CLI [ PR : LSIP200231423 ] LSIP200232927 (DFCT) Port PR 198414 to MR5.4 (Headless Boot) ...

    CodeTyphonIns2.30

    GDB Ver 7.3.50 exists to CodeTyphon\binGDB\xnewGDB for testing... -Update pl_GLScene (SVN 24-8-2011) -Update pl_ZenGL (SVN 24-8-2011) -Fix some CodeOcean samples NOTE: Lazarus 0.9.31 Source ...

    fso浏览54646465465464564

    If IsFolder(FilePath) Or IsFile(FilePath) Then Response.Write "&lt;script language='javascript'&gt;alert('文件或文件夹已存在!');history.back();&lt;/script&gt;" Exit Sub End If If Request.Form("ntype")=1 ...

    DELPHI TXT 树文档 管理器

    if not __RenameFile('C:\tree.txt','TreeView') then Application.MessageBox('重命名文件失败','重命名',MB_ICONERROR); } { 重命名文件 } function __RenameFile(OldName: string; Title: string): Boolean; ...

Global site tag (gtag.js) - Google Analytics