Android工作室2.3总是挂掉 [英] Android studio 2.3 always hangs out

查看:154
本文介绍了Android工作室2.3总是挂掉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在gradle中使用Android Studio 2.3 2.3.3 。我面临一个奇怪的问题,被困了一个星期。当我输入一些代码行时,它会在显示自动完成框之前经常挂起。
或者,如果我没有输入任何内容,只需使用命令 - 单击来查找变量或方法的实现,它会显示对话框解决参考并挂起。
有时,如果我转换到另一个应用程序一段时间并切换回查看Android Studio,它也会挂起。

I'm using Android Studio 2.3 within gradle 2.3.3. I face a weird problem and being stuck for a week. It hangs out very often when I type some lines of code, right before it shows the auto complete box. Or if I didn't type anything but use Command-clickto find implementation of a variable or method, it show the dialog says Resolving Reference and hangs there. Sometime, if I switch to another application for awhile and switch back to view Android Studio, it hangs as well.

我已经尝试了很多不同的方法但是没有没有帮助,包括:

I already tried many different methods but didn't help, including:

  • Remove Android studio completely follow this answer then download and install again.
  • Go to menu File > Invalidate Cache/Restart...
  • Remove JDK and install again. I'm using JDK jdk-8u131-macosx-x64 downloaded from here
  • Delete all build folders and Rebuild Project
  • Rollback to my project's stable source code that I built successfully in the past.
  • Try to use Android Studio 3.0 Preview
  • Downgrade or upgrade Gradle Plugin
  • Download and replace the JDK bundle with Android studio follow this thread

以上所有方法都无助于保持Android Studio的稳定性。

All above methods didn't help to keep my Android Studio stability.

我使用的是带有16Gb内存的Macbook,核心i7, MacOS Sierra 10.12.5 我不知道认为挂起是关于我的笔记本电脑规格,

I am using Macbook with 16Gb of RAM, core i7, MacOS Sierra 10.12.5 and I don't think the hang is regarding to my laptop specification,

所以我在这里报告我的情况,并希望有人可以帮助给我新的推荐。任何想法或建议都表示赞赏。

So I report my situation here and hope someone can help to give me new recommendation. Any idea or suggestion are appreciated.

更新:我在〜/ Library / Logs / Android Studio2.3 / <下查看Android Studio的日志/ code>并查看一些异常日志文件。以下是最新的一个:

Update: I check the logs of Android Studio under ~/Library/Logs/Android Studio2.3/ and see some exception log files. Below is the latest one:

2017-07-04 19:14:35,633 [1233357]   INFO - roid.sdk.MessageBuildingSdkLog - Exception from KotlinOutputParser 
2017-07-04 19:14:35,633 [1233357]   INFO - roid.sdk.MessageBuildingSdkLog - com.android.ide.common.blame.Message.<init>(com.android.ide.common.blame.Message$Kind, java.lang.String, java.lang.String, com.google.common.collect.ImmutableList) 
java.lang.NoSuchMethodException: com.android.ide.common.blame.Message.<init>(com.android.ide.common.blame.Message$Kind, java.lang.String, java.lang.String, com.google.common.collect.ImmutableList)
    at java.lang.Class.getConstructor0(Class.java:3082)
    at java.lang.Class.getConstructor(Class.java:1825)
    at org.jetbrains.kotlin.android.KotlinOutputParserHelper$simpleMessageConstructor$2.invoke(KotlinOutputParserHelper.kt:171)
    at org.jetbrains.kotlin.android.KotlinOutputParserHelper$simpleMessageConstructor$2.invoke(KotlinOutputParserHelper.kt:143)
    at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:130)
    at org.jetbrains.kotlin.android.KotlinOutputParserHelper.getSimpleMessageConstructor(KotlinOutputParserHelper.kt)
    at org.jetbrains.kotlin.android.KotlinOutputParserHelper.createNewMessage(KotlinOutputParserHelper.kt:272)
    at org.jetbrains.kotlin.android.KotlinOutputParserHelper.createMessage(KotlinOutputParserHelper.kt:250)
    at org.jetbrains.kotlin.android.KotlinOutputParserHelper.createMessage$default(KotlinOutputParserHelper.kt:244)
    at org.jetbrains.kotlin.android.KotlinOutputParserHelperKt.parse(KotlinOutputParserHelper.kt:41)
    at org.jetbrains.kotlin.android.KotlinOutputParser.parse(KotlinOutputParser.java:28)
    at com.android.ide.common.blame.parser.ToolOutputParser.parseToolOutput(ToolOutputParser.java:86)
    at com.android.tools.idea.gradle.output.parser.BuildOutputParser.parseGradleOutput(BuildOutputParser.java:43)
    at com.android.tools.idea.gradle.project.build.invoker.GradleTasksExecutor$GradleTasksExecutorImpl.lambda$collectMessages$5(GradleTasksExecutor.java:516)
    at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:307)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

更新2 有时Android Studio显示错误报告对话框,其中包含以下消息:

Update 2 Sometime Android Studio show a dialog for error report, with this message inside:

Cannot add jps/kotlin-jps-plugin.jar from plugin 'Kotlin' to external compiler classpath: home directory of plugin not found


推荐答案

最后我可以建立和继续编码而不会崩溃(至少1小时后我不会崩溃)。
对于Android Studio 2.3,我选择文件>省电模式因此它不会再挂起。更糟糕的是我不能在后台使用智能自动完成或自动构建。

Finally I can build and continue coding without crash ( at least after 1 hour I don't get crash). For the Android Studio 2.3, I select File > Power Save Mode so it won't hang out any more. The worse thing is I can't use intelligent auto complete or auto-build at background.

然后,我再次安装 Android studio 3.0预览金丝雀5 ,使用 Gradle工具3.0.0 alpha5 。修复所有编译警告(例如用新的替换已弃用的gradle函数),将所有库更新到最新版本,......它可以工作!

Then, I install again Android studio 3.0 Preview Canary 5, using Gradle tool 3.0.0 alpha5. Fix all compile warnings (such as replace deprecated gradle functions by new ones), update all libraries to latest version,... It works!

现在我有两个版本的Android Studio兼容运行。旧的运行省电模式,新的运行正常模式。

Now I got 2 versions of Android Studio running concurrently. The old one running with Power Save Mode, the new one running with normal mode.

这篇关于Android工作室2.3总是挂掉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆