メンチカツには醤油でしょ!!

AWS/Java/Node.js/Spreadsheets/Docker/Jenkins/コミュニティ・勉強会レポを主とした技術系ブログ

Xamarin Studioのインストールでエラー

インストール中にエラー

買って間もないMacにXamarinをインストールしようとしたらこんなエラーが
f:id:ryoichi0102:20170123203405j:plain

正直新規マシンでこれが出ると結構諦めモード入りやすいです^^;

エラー内容

Xamarin Manual Installtion Instructions

An error has occured.
Please follow the steps outlined below in order to install the missing software

It was not possible to complete an automatic installation. This might be due to a problem with your network, proxy servers or an unsolvable installation conflict. At this point, you can continue the installation by manually downloading and installing the independent pieces. The list below shows each component that you need to install.

Android SDK

Download the Android SDK for Mac OS X version 24.4.1, open the downloaded archive and copy the contents of the folder found at its root directory (most probably named android-sdk-macosx) to the /Users/my-user-name/Library/Developer/Xamarin/android-sdk-macosx directory.

Click here in order to start the Android SDK Manager application. In the GUI make sure the following components are installed or selected for installation:

Android SDK Tools
Android SDK Platform-tools
Android SDK Build-tools
Android API 23
Once all the required components are selected (you can select others as well, if you wish) start the installation.

If you cannot see /Users/my-user-name/Library/Developer/Xamarin/android-sdk-macosx in Finder please click here to reveal the directory in Finder.

Download the Android NDK for Mac OS X version r10e, open the downloaded archive and copy the contents of its root directory (most probably named android-ndk-r10e) to the /Users/my-user-name/Library/Developer/Xamarin/android-ndk directory.

When the Android SDK installation is finished you might want to start the Android Emulator Manager and create as many emulator images as you might need for your development. This step can be performed at any time, on an as-needed basis.

Xamarin Studio

Download the Xamarin Studio v6.1.4 archive to any directory on your disk, double-click it and then drag and drop the Xamarin Studio icon to the Applications folder.

Xamarin.Android

Download the Xamarin.Android v7.0.2 archive to any directory on your disk, double-click it and follow the instructions on screen. Please accept all the defaults during the installation, including the target drive.

Xamarin.iOS

Download the Xamarin.iOS v10.3.1 archive to any directory on your disk, double-click it and follow the instructions on screen. Please accept all the defaults during the installation, including the target drive.

This might be due to a problem with your network

とエラーメッセージにはあるので
複数のインターネット接続環境から試したのですが、ダメでした。

助け舟が

つぶやいた(ぼやいた?)ところ、助言を頂きました。
ありがとうございます!

Android SDKをインストール

ということで、Android SDKをインストールします。

ちなみにXamarin InstallerではXamarin.Androidコンポーネントを選択するとDependenciesにAndroid SDKが追加でチェックが入っているのですが、これがどうもうまく入らないということでしょうか。
(Installerのプログレスを見ていた限りだと、Android SDK含めて数GBはDLされていたのでこれもちょっと不思議な所ですが)

手動ダウンロード&配置

下記のダウンロードサイトへ行き、コマンドラインツールの方を手動ダウンロードして解凍します。
記載時点では tools_r25.2.3-macosx.zip です。
(バージョンってエラーメッセージの24.4.1に合わせた方がいいんですかね?私は入手できる最新版の25.2.3を入れました)

developer.android.com

解凍して得られたファイルをXamarin Installerのウィザートの途中で出てくる
/Users/my-user-name/Library/Developer/Xamarin/android-sdk-macosx
に配置すればOKです。
(このディレクトリはインストールに一度はコケていれば存在すると思います。
LibraryはFinderからは通常は表示されないので⌘ + Shift + Gでアドレス入力します。)

 

f:id:ryoichi0102:20170123204200j:plain

f:id:ryoichi0102:20170123204207j:plain

f:id:ryoichi0102:20170123204214j:plain

f:id:ryoichi0102:20170123204220j:plain

 

無事にインストールが完了しました!

USB規格関連が難しいのでなるべく簡素に説明

MacBook(2016)を買ったけど…

USB規格関連が難しい!
3.0やら3.1やらType-CやらPD(Power Delivery)やら。(Thunderboltは一旦置いときます)

しかもType-Cで給電するため、火を吹かせないように(冗談)
最低限 間違いのない製品を選択する必要に差し迫られ…

代表的な4つのキーワード

USB Type-Cとは

端子の形状の規格です。
正確にはUSB-Cではなく"USB Type-C"です。
端子の裏表がないのと、Power Delivery(最大20V/5A)にも対応している所が特長です。
なお、PD対応がなくてもType-Cは5V/3Aとなっており
従来の5V/1.5Aに比べて2倍の速度で充電できることになっています。

f:id:ryoichi0102:20170113123424j:plain

この写真を見たただけで、ケーブル内で何がどう転送されるかはさておき「あーこれはUSB Type-Cだね」と言い切って間違いないことになります。

なお、USB Type-CはUSB 2.0も3.1もサポートしているため、
USB Type-C端子⇔USB A端子(従来型端子)のようなケーブルで
USB 2.0の転送を行うといった後方互換があります。

USB 3.0とは

正確には"USB 3.1 Gen 1"です。(紛らわしい!)
従来のスタンダードであるUSB 2.0から転送速度を高速化させたものです。
実転送速度 4 [Gbps]で、USB-A側の端子が青いのが特徴です。

f:id:ryoichi0102:20170113123436j:plain
これはUSB A端子のUSB 3.0対応ケーブルと言えます。

USB 3.1とは

正確には"USB 3.1 Gen 2"です。
転送速度 10 [Gbps] です。
3.0から転送速度が早くなったものが3.1です。

USB PD (Power Delivery) とは

最大20V/5Aが流せる規格です。
PDを利用するには、給電元・ケーブル・充電先の3つすべてがPDに対応している必要があります。
従来のUSBでは安定して電流が流せず機器が不安定になったりなどの状況を改善するための、大容量電力対応の規格です。 

速度と言っても充電速度とデータ転送速度がある所もヤヤコシイ

USB 3.1(伝送速度)のPD対応(電力)のケーブルを買えばよさそうなのですが、
あまり売ってませんw

また、端子がUSB Type-C⇔USB Aだと、互換性あってちょうど良さそうなのですが、
PDに対応していないのと、規格外のケーブルを使った場合、過電流になるので危険です。
結構有名メーカーでも規格外のケーブルが混在していますので、下記の参考サイトで各メーカーの対応状況などが掲載されているので購入を検討する際には参考にしてみてください。

C⇔Cと、C⇔Aで1本づつあれば良さそう

・C⇔C のUSB 3.1 Gen 2のPD対応ケーブル (5V/20A)
・C⇔A のUSB 3.1 Gen 2のケーブル (5V/3A)
と2本あればとりあえず良さそうですね。

参考

andmem.blogspot.jp

hanpenblog.com

hanpenblog.com