Open10
Android Studioが起動できない
それっぽい調べた記事
1.FinderでApplicationフォルダを表示
2.Android Studioをダブルクリックして[パッケージの内容を表示]を選択
3.Applications/Android Studio/Contents/MacOS/studio をダブルクリックで実行
これででたエラーが上記の記事のエラーとは違った
Error occurred during initialization of VM
Initial heap size set to a larger value than the maximum heap size
zsh: locking failed for /.zsh-history: read-only file system
なので flutter doctor -v
をしてみる
$ flutter doctor -v
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.4 20F71 darwin-x64, locale ja-JP)
• Flutter version 2.2.3 at /Users/tamakikyou/development/flutter
• Framework revision f4abaa0735 (10 weeks ago), 2021-07-01 12:46:11 -0700
• Engine revision 241c87ad80
• Dart version 2.13.4
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/tamakikyou/Library/Android/sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: /usr/local/Cellar/openjdk/16.0.1/libexec/openjdk.jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment Homebrew (build 16.0.1+0)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.10.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[!] Android Studio (version 2020.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
✗ Unable to find bundled Java version.
• Try updating or re-installing Android Studio.
[✓] IntelliJ IDEA Ultimate Edition (version 2021.2)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] VS Code (version 1.60.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (1 available)
• Chrome (web) • chrome • web-javascript • Google Chrome 92.0.4515.159
! Doctor found issues in 1 category.
これで解決はできたけどまだ開けなかった
結局vscodeに移行しました。
✗ Unable to find bundled Java version.
この問題はflutterのバージョンを上げることで解決しました。
$ flutter upgrade
$ rm -r AndroidStudio2020.3
$ rm -r .gradle
$ rm -r .android
$ rm -r AndroidStudio4.1
$ rm -r .emulator_console_auth_token
削除ごインストールしてみたがだめだった。
このサイトを参考にして解決した。
↑ここのエラー文にあるように初期ヒープサイズが最大ヒープサイズよりも大きい値に設定されていることが原因だったそうです。
【手順】
- AndroidStudio○.○があるディレクトリを見つける
// ここにいた
~/Library/Application Support/Google/AndroidStudio4.2
- 同ディレクトリ内にAndroidStudio20〇〇.○というディレクトリ内の
studio.vmoptions
を編集する
~/Library/Application Support/Google
$ ls
AndroidStudio2020.3 AndroidStudio4.2 Chrome JapaneseInput RLZ consentOptions
~/Library/Application Support/Google/AndroidStudio2020.3
$ ls
# custom Android Studio VM options, see https://developer.android.com/studio/intro/studio-config.html
codestyles disabled_plugins.txt migrate.config plugins ssl tasks user.token
colors disabled_update.txt options port.lock studio.vmoptions terminal workspace
-
studio.vmoptions
の中身
# custom Android Studio VM options, see https://developer.android.com/studio/intro/studio-config.html
- -Xmx128m
+ -Xms128m
+ -Xmx512m
-XX:ReservedCodeCacheSize=240m%
ファイル編集して保存後AndroidStudioを無事開けるようになった。