まず、プロジェクトレベルのbuild.gradleに次のようにflatDirの記述を追加します。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
allprojects { | |
repositories { | |
jcenter() | |
// ここを追加。下記の設定ではプロジェクトのapp/libs/にaarを設置する設定になる。 | |
flatDir { | |
dirs 'libs' | |
} | |
} | |
} |
flatDirのdirsのパスは任意のパスを指定できますが、ここでは簡便に使えるプロジェクトのapp/libs/を指定しています。
次に、appレベルのbuild.gradleに次のように取り込むaarファイルの情報を追記します。
次に、appレベルのbuild.gradleに次のように取り込むaarファイルの情報を追記します。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies { | |
// HogeHoge.aarを取り込む記述 | |
compile(name:'HogeHoge', ext:'aar') | |
} |
ここまで行ったら、プロジェクトのapp/libs/ディレクトリに目的のaarファイル(例ではHogeHoge.aar)を設置します。
あとは、Android StudioでSyncProject(下図の赤枠部)を実行すれば無事にaarがプロジェクトに取り込まれて幸せになれます。
参考:
AndroidStudio - Android Studio でaarをローカルから読み込む方法 - Qiita
あとは、Android StudioでSyncProject(下図の赤枠部)を実行すれば無事にaarがプロジェクトに取り込まれて幸せになれます。
参考:
AndroidStudio - Android Studio でaarをローカルから読み込む方法 - Qiita
0 件のコメント:
コメントを投稿