大田区から発信するゆるゆる日記

主にITエンジニアに関する備忘録日記。たまに趣味も。何か不備があればコメント頂けると幸いです。Twitterアカウント https://twitter.com/ryuzan03

【Ionic/Angular】Android Studioの初期設定で少し躓いたところ

※下記の内容に不備がありましたら、コメント頂けると幸いです。また、下記の内容をご使用頂ける場合は自己責任でお願いします。

【目次】

 

概要

【Ionicで作る モバイルアプリ制作入門[Angular版]】を参考にモバイルアプリ開発に手を出しました。Angularでさえまともなレベルじゃないのに手を出して良かったのかな…

 

最初の開発環境のところで少しだけ躓いたところがあったので備忘録として書いていきます。が、アプリの指示通りにしていたらまず大丈夫だと思いますので、この記事を見てIonic難しいとかは思わないでくださいね笑

 

 

Android Studioの初期設定で少し躓いたところ

1 ライセンスが許可されていないため一部のAndroid SDKパッケージのインストールに失敗した

ERROR: Failed to install the following Android SDK packages as some licences have not been accepted.
build-tools;28.0.3 Android SDK Build-Tools 28.0.3
platforms;android-28 Android SDK Platform 28
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html

Using Android SDK: /Users/ryuzan/Library/Android/sdk
Install missing SDK package(s)

 

解決方法 

Install missing SDK package(s)

ここをクリックする。

 

common.jarをダウンロードしていない

ERROR: Unable to resolve dependency for ':capacitor-android@debug/compileClasspath': Could not download common.jar (android.arch.lifecycle:common:1.1.1)
Show Details
Affected Modules: capacitor-android

 

解決方法 

Android Studioを再起動させる。

 

 

 

USBデバッグが無効になっている

今回はMacAndroidをUSBで繋げて、アプリ画面をAndroidに表示させようとした時に躓いたところです。

For ADB to recognize your device as a target for deploying debuggable APKs, you must first enable USB debugging in the on-device developer options.
Depending on the version of Android you're using, proceed as follows:

◆On Android 8.0 and higher, go to Settings > System > About phone and tap Build number seven times.
◆On Android 4.2 through 7.1.2, go to Settings > About phone and tap Build number seven times.

Return to the main Settings menu to find Developer options at the bottom. In the Developer options menu, scroll down and enable USB debugging.

 

解決方法 

Android8.0以上で以下の操作を行う。

Settings > System > About phone and tap Build number seven times.

設定>システム>電話情報にある「ビルド番号」を7回押す。

そうすると、どこかに「開発者向けオプション」が表示されます。私の場合は、設計>システムに「開発者向けオプション」が出現しました。

 

最後に「開発者向けオプション」のUSBデバッグを有効にします。

 

 

今後に向けて

 まずは本の内容を実践していきたいと思ってます。