Android Studio for Mac 在启动时崩溃

Posted

技术标签:

【中文标题】Android Studio for Mac 在启动时崩溃【英文标题】:Android Studio for Mac crashes on startup 【发布时间】:2017-08-13 14:46:56 【问题描述】:

我下载并安装了 android Studio 2.3。然后我尝试打开该应用程序,它甚至在启动之前就“意外退出”了。

这是我为$ /Applications/Android\ Studio.app/Contents/MacOS/studio 得到的结果。

2017-03-23 19:40:03.869 studio[5988:353457] Value of STUDIO_JDK: /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk
2017-03-23 19:40:03.871 studio[5988:353457] allVms required 1.8*,1.8+
2017-03-23 19:40:03.873 studio[5988:353468] fullFileName is: /Applications/Android Studio.app/Contents/bin/studio.vmoptions
2017-03-23 19:40:03.874 studio[5988:353468] fullFileName exists: /Applications/Android Studio.app/Contents/bin/studio.vmoptions
2017-03-23 19:40:03.874 studio[5988:353468] Value of STUDIO_VM_OPTIONS is (null)
2017-03-23 19:40:03.874 studio[5988:353468] Processing VMOptions file at /Applications/Android Studio.app/Contents/bin/studio.vmoptions
2017-03-23 19:40:03.875 studio[5988:353468] Done
2017-03-23 19:40:03.875 studio[5988:353468] Processing VMOptions file at /Users/chevindu/Library/Preferences/AndroidStudio2.3/studio.vmoptions
2017-03-23 19:40:03.877 studio[5988:353468] No content found
2017-03-23 19:40:03.877 studio[5988:353468] Processing VMOptions file at 
2017-03-23 19:40:03.878 studio[5988:353468] No content found
/Applications/Android Studio.app/Contents/bin/idea.properties: 'java.endorsed.dirs' already defined
Looking in classpath from com.intellij.util.lang.UrlClassLoader@5c29bfd for /com/sun/jna/darwin/libjnidispatch.jnilib
Found library resource at jar:file:/Applications/Android%20Studio.app/Contents/lib/jna.jar!/com/sun/jna/darwin/libjnidispatch.jnilib
Trying /Users/chevindu/Library/Caches/AndroidStudio2.3/tmp/jna7329126360829887390.tmp
Found jnidispatch at /Users/chevindu/Library/Caches/AndroidStudio2.3/tmp/jna7329126360829887390.tmp
Looking for library 'c'
Adding paths from jna.library.path: null
Trying libc.dylib
Found library 'c' at libc.dylib
Looking for library 'Foundation'
Adding paths from jna.library.path: null
Trying libFoundation.dylib
Adding system paths: [/usr/lib, /usr/lib]
Trying libFoundation.dylib
Looking for matching frameworks
Trying /System/Library/Frameworks/Foundation.framework/Foundation
Found library 'Foundation' at /System/Library/Frameworks/Foundation.framework/Foundation
[   9207]   WARN - s.RepoProgressIndicatorAdapter - java.io.FileNotFoundException: /private/var/folders/m3/9bsc3x6s2vq8z50zh24c1g9w0000gn/T/StudioDownloadersys-img2-1.xml (No such file or directory) 
[   9995]   WARN - s.RepoProgressIndicatorAdapter - File /Users/chevindu/.android/repositories.cfg could not be loaded. 
[  10051]   WARN - dea.updater.SdkComponentSource - java.io.FileNotFoundException: /private/var/folders/m3/9bsc3x6s2vq8z50zh24c1g9w0000gn/T/StudioDownloader1addon2-1.xml (No such file or directory) 
[  10051]   WARN - dea.updater.SdkComponentSource - File /Users/chevindu/.android/repositories.cfg could not be loaded. 
[  10117]   WARN - vdmanager.AvdManagerConnection - No Android SDK Found 
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fff87706f72, pid=5988, tid=0x0000000000000513
#
# JRE version: OpenJDK Runtime Environment (8.0_112-b06) (build 1.8.0_112-release-b06)
# Java VM: OpenJDK 64-Bit Server VM (25.112-b06 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C  [libsystem_c.dylib+0xf72]  strlen+0x12
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/chevindu/java_error_in_studio_5988.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Abort trap: 6

我已安装 Java(TM) SE 运行时环境(内部版本 1.8.0_121-b13)并运行 OS X Yosemite 10.10.5。

这是我为$ printenv 得到的结果。

TERM_PROGRAM=Apple_Terminal
SHELL=/bin/bash
TERM=xterm-256color
TMPDIR=/var/folders/m3/9bsc3x6s2vq8z50zh24c1g9w0000gn/T/Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.AvWjd1Ew1S/Render
TERM_PROGRAM_VERSION=343.7
TERM_SESSION_ID=CEC1537E-091C-4099-9C40-D933AF826E27
USER=chevindu
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.l8xDQvW92n/Listeners
__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
PWD=/Users/chevindu
LANG=en_US.UTF-8
XPC_FLAGS=0x0
XPC_SERVICE_NAME=0
SHLVL=1
HOME=/Users/chevindu
STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk
LOGNAME=chevindu
_=/usr/bin/printenv

您可以从here 阅读/Users/chevindu/java_error_in_studio_5988.log 的错误日志。

非常感谢您对此事的任何帮助。

【问题讨论】:

同时贴出在/Users/chevindu/java_error_in_studio_5988.log位置找到的错误日志 @Isuru - 请在此处查看日志:justpaste.it/javaerrorlog 【参考方案1】:

已知错误?

这可能与known bug 有关,根据one comment,应该在下一个次要版本 (2.3.1) 中修复。

问题中描述了解决方法和临时解决方案,包括降级 java 或下载并替换 Android Studio 应用中的二进制文件。 (我个人没有尝试过,但如果对您有用,请随时直接评论该问题。)

【讨论】:

我尝试替换该论坛中提到的二进制文件,它就像一个魅力!这已经困扰了我好几个星期了,我感激不尽。希望问题能在下一次更新中得到解决。【参考方案2】:

我下载了另一个版本,从 Contents/macos/studio 复制了工作室并将其粘贴到我的新错误版本上;我替换了工作室文件。

效果很好。

【讨论】:

以上是关于Android Studio for Mac 在启动时崩溃的主要内容,如果未能解决你的问题,请参考以下文章

android studio for Mac快捷键大全

Android studio For Mac 常用快捷键

如何在 Visual Studio for Mac for Xamarin 中添加更多 android 模拟器设备?

Visual Studio 2017 for Mac 体验之Android.Form

Android Studio 常用快捷键 for mac

Android Studio 快捷键 for Mac OS X