在 Android Studio 中导入模块 [英] Importing Module in Android Studio
本文介绍了在 Android Studio 中导入模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在 Android Studio 中导入外部模块(名为 ViewPagerIndicator)?
解决方案
在 Android Studio 3.3 及更低版本中导入模块的步骤.
- 转到填充 >>新 >>导入模块...
- 选择要导入的模块的源目录,然后单击完成.
- 打开项目结构并打开项目的模块设置.
- 打开依赖项标签.
- 单击 (+) 图标并选择模块依赖项.选择模块并单击确定".
- 打开您的
build.gradle
文件并检查该模块现在是否在依赖项下列出.实现项目(路径:':ViewPagerIndicator')
<块引用>
在 Android Studio 3.4 及更高版本中导入模块的步骤(见附件图片).
- 转到文件 >>新 >>导入模块...
- 选择要导入的模块的源目录,然后单击完成.
- 打开项目结构对话框(您可以通过选择文件 > 项目结构来打开 PSD)并从左侧面板中单击依赖项.
- 从模块(中间)部分选择要添加模块依赖项的模块.
- 点击声明的依赖项部分的 (+) 图标,然后点击模块依赖项.
- 选择模块并点击确定.
- 打开您的
build.gradle
文件并检查该模块现在是否列在依赖项下.实现项目(路径:':ViewPagerIndicator')
How can I import an external module (named ViewPagerIndicator) in Android Studio?
解决方案
Steps to import Module in Android Studio 3.3 and lower.
- Go to Fill >> New >> Import Module...
- Select the source directory of the Module you want to import and click Finish.
- Open Project Structure and open Module Settings for your project.
- Open the Dependencies tab.
- Click the (+) icon and select Module Dependency. Select the module and click Ok.
- Open your
build.gradle
file and check that the module is now listed under dependencies.implementation project(path: ':ViewPagerIndicator')
Steps to import Module in Android Studio 3.4 and higher (See attached image).
- Go to File >> New >> Import Module...
- Select the source directory of the Module you want to import and click Finish.
- Open Project Structure Dialog (You can open the PSD by selecting File > Project Structure) and from the left panel click on Dependencies.
- Select the module from the Module(Middle) section In which you want to add module dependency.
- Click the (+) icon from the Declared Dependencies section and click Module Dependency.
- Select the module and click Ok.
- Open your
build.gradle
file and check that the module is now listed under dependencies.implementation project(path: ':ViewPagerIndicator')
这篇关于在 Android Studio 中导入模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文