LoginSignup
0
1

More than 3 years have passed since last update.

scalaで開発する環境を整える@AndroidStudio, Mac

Last updated at Posted at 2019-10-19

めちゃめちゃ苦しんだ…
すでにできているリポジトリをクローンして開発環境を整えるまでのメモ

作業環境⬇︎
MacOS:Mojave 10.14.6(18G95)
android studio:3.0.1

もろもろインストール

とりあえずandroid studioで該当のPJを開くとno scala sdkみたいなのが上部に出てるので指示通りに入れる。
PJではsbtを使ってたので、ローカルにもインストール

$ brew install sbt
Error: An exception occurred within a child process:
  CompilerSelectionError: sbt cannot be built with any available compilers.
Install GNU's GCC:
  brew install gcc

言われた通りgccをインストール

$ brew install gcc
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Error: Xcode alone is not sufficient on Mojave.
Install the Command Line Tools:
  xcode-select --install

orz

https://qiita.com/ponsuke0531/items/10bca8aee7534bdefa1f
xcodeのコマンドラインツールがないとだめらしい。そういえばxcodeをzipからインストールしたのでそのときのインストール忘れ?
>仕方ないので上記サイトの通りインストール
https://developer.apple.com/download/more/
の中のCommand_Line_Tools_macOS_10.14_for_Xcode_10.2.1をDL。

$ xcode-select --install

を叩くと

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

が出た。
もうインストールされてるとのことなのだけどどのタイミングで入ったんだろうか…
この後gcc > sbtの順で無事インストールできた

アプリを実行するまで

https://dev.classmethod.jp/smartphone/scala-androi/
の通りコンソールからsbtを起動してみる

$ sbt
[info] Loading project definition from {PJルート}
[error] set ANDROID_HOME or run 'android update project -p {PJルート}'
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? q

起動に失敗してる。。

$ export ANDROID_HOME=/Users/hoge/android-sdks/

してみる
>この状態でsbtを起動できた。さらにandroid:package-debugでapkを作成できた。
パスは./bin/appname.apk
>これをadb installして実機で確認できた。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1