{"id":1232,"date":"2023-03-18T09:20:16","date_gmt":"2023-03-18T01:20:16","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1232"},"modified":"2023-04-29T09:34:42","modified_gmt":"2023-04-29T01:34:42","slug":"android-studio-add-aar-dependency-summary","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/18\/android-studio-add-aar-dependency-summary\/","title":{"rendered":"Android Studio \u6dfb\u52a0aar\u4f9d\u8d56\u603b\u7ed3"},"content":{"rendered":"<h2>\u4e0d\u540cmodule\u5f15\u5165\u4e0d\u540c\u7684aar\u5305<\/h2>\n<p>1\u3001\u5728\u5404\u81eamodule\u7684libs\u76ee\u5f55\u4e0b\u653e\u7f6e\u4e0d\u540c\u7684aar\u5305<br \/>\n2\u3001\u5728\u5404\u81eamodule\u76ee\u5f55\u4e0b<code>build.gradle<\/code>\u7684<code>dependencies<\/code>\u4e2d\uff0c\u6dfb\u52a0<\/p>\n<p><!-- more --><\/p>\n<pre><code>implementation fileTree(include: [&#039;*.jar&#039;, &#039;*.aar&#039;], dir: &#039;libs&#039;)<\/code><\/pre>\n<h2>\u4e0d\u540cmodule\u5f15\u5165\u540c\u4e00\u4e2aaar\u5305<\/h2>\n<p>1\u3001\u5728\u5404\u81eamodule\u7684libs\u76ee\u5f55\u4e0b\u653e\u7f6e\u540c\u4e00\u4e2aaar\u5305<br \/>\n2\u3001\u5728\u5404\u81eamodule\u76ee\u5f55\u4e0b<code>build.gradle<\/code>\u7684<code>dependencies<\/code>\u4e2d\uff0c\u6dfb\u52a0<\/p>\n<pre><code>repositories {\n    flatDir {\n        dirs &#039;libs&#039;\n    }\n}\n\ndependencies {\n    implementation fileTree(dir: &#039;libs&#039;, include: [&#039;*.jar&#039;])\n\n    api(name: &#039;jsbridge&#039;, ext: &#039;aar&#039;)  \/\/\u4e5f\u53ef\u4ee5\u5f15\u5165\u591a\u4e2aaar\u5305\n}<\/code><\/pre>\n<p>3\u3001\u5728\u5de5\u7a0b\u76ee\u5f55\u4e0b\u7684<code>build.gradle<\/code>\u914d\u7f6e<\/p>\n<pre><code>allprojects {\n    repositories {\n        flatDir {\n            dirs project(&#039;:app_home&#039;).file(&#039;libs&#039;)\n            dirs project(&#039;:app_mine&#039;).file(&#039;libs&#039;)\n        }\n    }\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0d\u540cmodule\u5f15\u5165\u4e0d\u540c\u7684aar\u5305 1\u3001\u5728\u5404\u81eamodule\u7684libs\u76ee\u5f55\u4e0b\u653e\u7f6e\u4e0d\u540c\u7684aar\u5305 2\u3001\u5728\u5404\u81eamod [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[202],"tags":[307],"class_list":["post-1232","post","type-post","status-publish","format-standard","hentry","category-android-build","tag-aar"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1232","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1232"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1232\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1232"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}