背景:
阅读新闻

android studio 引用自己的类库设置

  作者: 今日评论: [字体: ]

Some things to point out, make sure you have your settings.gradle updated to reference both the app and library modules.

settings.gradle: include ':app', ':libraries:lib1', ':libraries:lib2'

Also make sure that the app's build.gradle has the followng:

dependencies {
     compile project(':libraries:lib1')
}

You should have the following structure:

 MyProject/
  | settings.gradle
  + app/
    | build.gradle
  + libraries/
    + lib1/
       | build.gradle
    + lib2/
       | build.gradle

The app's build.gradle should use thecom.android.application plugin while any libraries' build.gradle should use thecom.android.library plugin.

The Android Studio IDE should update if you're able to build from the command line with this setup.


来源:
录入日期:[2015/11/16 10:23:00]
收藏 推荐 打印 | 录入:mikebai | 阅读:
文章评论      
正在加载评论列表...
评论表单加载中...