Java – how to merge an Android studio project into another Android studio project
I have two separate Android application projects made in Android studio. I'm trying to merge project 1 into project 2 to make it an application. What should I do? I know how to do this in eclipse, but not in Android studio. Please note that both projects are Android applications, not Android libraries
Any help will be amazing!
When I import project 1 into the project module, this error occurs when generating grades:
resolvent:
In Android studio, you cannot treat two "projects" as one project
Convert one (or two) projects into libraries. Then create a "shell" project to build each application. The shell project is basically empty, or it may have build specific value overrides. The advantage of this is that you can modify the library, The disadvantage is that you must fix all problems in all projects caused by any changes made to any library. However, you can create "composite" projects in a similar way
After converting one or both to libraries, you can create an AAR file. In this way, you can choose to include the AAR as a gradle dependency. Remember that the AAR needs to be rebuilt every time you modify the project - therefore, if you have a prompt indicating which is a more stable code base, use AAR. This enables you to "version control" the main project dependency, So that you can change one project without affecting the stability of another project
In addition, you can write scripts and use tools such as bamboos or Jenkins to update AAR in real time - but it's like using a "snapshot" dependency. When you change AAR, it may compile, but it may cause you to not know the construction of the second project until it is built on that project (yes, you can include the build of the project in part of the bamboo or Jenkins script, but it's not easy.)
There may be other options, but they seem to provide enough options to produce a wide variety of build options