LoginSignup
12
11

More than 5 years have passed since last update.

Android Studioで外部jarを取り込む

Posted at

Android Studioで外部jarを取り込む方法として

  • libsディレクトリの下に指定のjarファイルをおく

build.gradleにlibs配下のjarを読み込む設定は必要

build.gradle
dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    ・・・
}

通常は上記方法で問題ないが、jarが読み込まれない場合がある。
その場合は、以下の記述を行うとjarが読み込まれるようになる。

  • build.gradleのdepenciesに読み込まれないjarファイルを参照するように指定する。
build.gradle
dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile file("libs/xxxxx.jar")
    ・・・
}

Android Studioで外部jarを取り込む際に
何度かclean buidしたりして
少しはまったので備忘録として残します。

12
11
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
12
11