add moduel to gradle android

  1. Open the Android Studio project in which you want to add a module.

  2. In the Project Explorer, right-click on the root directory of your project.

  3. Navigate to "New" > "Module."

  4. Choose the type of module you want to add (e.g., Android Library, Java Library, etc.) and click "Next."

  5. Configure the module settings such as module name, language, and package name. Click "Finish" when done.

  6. Open the settings.gradle file in the root of your project.

  7. Add the following line to include the new module in the project:

gradle include ':newModuleName'

Replace "newModuleName" with the actual name of your module.

  1. Sync the project with the Gradle files by clicking on the "Sync Now" option that appears in the bar at the top of Android Studio.

  2. Open the build.gradle file of the app module (usually located in the "app" directory).

  3. Add the following dependency to the dependencies block to include the new module in your app:

    gradle implementation project(':newModuleName')

    Replace "newModuleName" with the actual name of your module.

  4. Sync the project again to apply the changes.

Now, you have successfully added a new module to your Android project using Kotlin and updated the Gradle files accordingly.