Android studio project as a module into another project

Android two items, one of pozhudl, one of app, now as a module wishing pozhudl project into app and call pozhudl project class

In the first modification build.gradle pozhudl projects sentence apply plugin: 'com.android.application' plugin is the Apply:  'com.android.library'

If there is a direct replacement for these few lines

def buildAsApplication = !buildAsLibrary
if (buildAsApplication) {
    apply plugin: 'com.android.application'
}
else {
    apply plugin: 'com.android.library'
}

Replace

 apply plugin: 'com.android.library'

Then there's the phrase deleted

//applicationId "org.libsdl.app"

Open the project in the next Android studio app

file ->new->import module

In the window that opens app file directories pozhudl project, to rename the module, click finish, OK

This put pozhudl directory on the app in the next sentence add app project

implementation project(':pozhudl')

pozhudl为你的module名

接下来按下面的操作继续导入

按箭头所示点击

在弹出的module列表中选择pozhudl  的module点击OK,现在差不多就已经把项目作为module导入成功了,

 如遇到Android Studio报:“Attribute application@theme or @ icon ”问题,可参考下面的链接

https://www.jb51.net/article/130175.htm

 

 

Guess you like

Origin www.cnblogs.com/pozhu15/p/11359352.html