N
N
Nikolay Alekseev2019-12-19 13:01:16
Android
Nikolay Alekseev, 2019-12-19 13:01:16

What is the correct way to create new modules in Android Studio?

Welcome all!
There is an application, part of its functionality is placed in a separate module. Initially, a separate project was created for this module, from there I collected it into aar and then connected this same aar to the current application. All this worked, but then I thought that it would be easier for me to work with both the module and the application from the same project and decided to transfer the sources.
In the project, I clicked File->new->New module->Phone & Tablet module
Specified the name, everything was created, I transferred the class files to the folder of the newly created module and tried to add a dependency to it.
implementation project(":basiccore")
When trying to synchronize, I got an error that the dependency could not be resolved. I don't see, he says, I'm your basiccore. I searched on the Internet, they advised me to clear the cache. (Invalidate Caches / Restart)
I did, when loading the project I got:

Compilation is not supported for following modules: tszhcore. Unfortunately you can't have non-Gradle Java modules and Android-Gradle modules in one project.

Since I'm still not very confident in this business, I understand that I'm just, most likely, doing something wrong.
If not difficult, please explain what exactly and why. This is important, because I don’t want to do it thoughtlessly, I want to understand exactly what I’m doing in general.
Thank you in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Zagaevsky, 2019-12-19
@VariusRain

I don't really use this wizard, but, it seems, Phone & Tablet module is an application module, an application cannot depend on another application. You need a library module, choose Android Library in this step.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question