Search code examples
macosandroid-studiocrashstartuposx-yosemite

Android Studio for Mac crashes on startup


I downloaded Android Studio 2.3 and installed. Then I tried to open the app and it did "quit unexpectedly" before even starting up.

This is the result I got for $ /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

I have Java(TM) SE Runtime Environment (build 1.8.0_121-b13) installed and OS X Yosemite 10.10.5 running.

This is the result I got for $ 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

You can read the error log at /Users/chevindu/java_error_in_studio_5988.log from here.

Any help on this matter is very much appreciated.


Solution

  • Known Bug?

    This may be related to a known bug which, according to one comment, should be fixed in the next minor version (2.3.1).

    There are workarounds and interim solutions described in the issue, including downgrading java or downloading and replacing a binary in the Android Studio app. (I personally haven't tried them, but feel free to comment directly on the issue if it works for you.)