Android:eclipse 工作区需要很长时间才能构建?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4596445/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 15:35:20  来源:igfitidea点击:

Android: eclipse workspace takes a long time to build?

androideclipse

提问by ab11

My eclipse workspace has just one android project in it and is set to "build automatically". Every time I make a change to some code, and save the change, the workspace builds. Initially this is fine, but at some point the builds start to take about 5 seconds for every change. At this point, I create a new workspace and import the project, and everything works great for a while (days or weeks), but inevitably it slows down again. Has anyone else experienced this and/or have a solution?

我的 eclipse 工作区中只有一个 android 项目,并且设置为“自动构建”。每次我对一些代码进行更改并保存更改时,工作区就会构建。最初这很好,但在某些时候,每次更改构建开始需要大约 5 秒。在这一点上,我创建了一个新的工作区并导入了项目,一切都运行良好一段时间(几天或几周),但不可避免地再次变慢。有没有其他人经历过这个和/或有解决方案?

回答by Felipe FMMobile

You can try in Eclipse:

您可以在 Eclipse 中尝试:

Window - > Preferences - > Android -> Build -> Skip packaging and dexing export or launch.(Speeds up automatic builds on file save)

窗口 -> 首选项 -> Android -> 构建 -> 跳过打包和 dexing 导出或启动。(加快文件保存时的自动构建)

And

UnMark : Project - > Build Automatically

取消标记:项目 - > 自动构建

And you can also complete with :

你还可以完成:

Window - > Preferences - > General -> Workspace - > Linked Resource - Enable linked resource (unmark) try only if your project not have resources from other project.

Window -> Preferences -> General -> Workspace -> Linked Resource - 仅当您的项目没有来自其他项目的资源时才启用链接资源(取消标记)。

For me stoped building slow process after every save.

对我来说,每次保存后都停止构建缓慢的过程。

回答by Jorgesys

Increasing Xmsand Xmxparameters in eclipse.iniworked for me:

增加XmsXmx参数eclipse.ini对我有用:

Original values:

原始值:

-Xms40m
-Xmx768m

New values:

新值:

-Xms256m 
-Xmx1024m

回答by The Guy

Under top menu item Project->Build Automatically uncheck the option, then you'll have to build project manually before testing, just select Project->Build Project then Run after build completes.

在顶部菜单项 Project->Build Automatically 下取消选中该选项,然后您必须在测试之前手动构建项目,只需选择 Project->Build Project 然后在构建完成后运行。

回答by Mohit Verma

Removing the device from USB & then re-connect.

从 USB 移除设备,然后重新连接。

回答by Nanne

Does it help if you clean your project (menu 'project'-> clean) and does that help?

如果您清理项目(菜单“项目”-> 清理)是否有帮助,这有帮助吗?

This might be something that's a part of the slowness, although it doesn't explain why it's quick after a new import, and then slows down: Android compilation is slow (using Eclipse)

这可能是缓慢的一部分,尽管它没有解释为什么在新导入后它很快,然后变慢:Android 编译很慢(使用 Eclipse)