简体   繁体   中英

Import module on Android Studio

I've got a problem on library importation. I followed these step :

  1. File / New / Import Module.
  2. Then I go to Project structure, Dependencies and "+". But there is Nothing to show.

Is somebody can help me ?

Screen : https://imgur.com/a/34mhw1N

尝试:转到“ SDK管理器”->“ SDK工具”:查找支持存储库并下载它们,这可能有效

In order to add library module in your project you should follow the following steps:

1) After adding library, open your project's build.gradle file and add implementation project(path: ':yourLibraryName') .

2) Don't sync yet, now open your settings.gradle file and add your project with your library: include ':yourLibrayName', ':yourProject/ModuleName' . Now sync.

3) After sync you will be able to use your library in your project.

You need to add import module in gradle also

Try this

implementation project(path: ':yourLibName')

than sync it will show dependencies.

Go to main menu -> File -> New -> Import Module. Then select the source code. Give module a name. (Android studio 3.3)

Add following line to app build.gradle

implementation project(':module_name')

Also in the settings.gradle file should have following line

  include ':app'
  include ':module_name'

导入模块

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM