How to import gradle built-in module as parameter in Android Studio?

I just created my first project in Android Studio and now I want to add a third-party library to the project (which is also built by gradle). How can this be done? I have tried so far:

  • File-> Import Module-> Select build.gradle from the library folder.
  • Displays the text ": build.gradle" next to "Module name:", as well as the error message: "The project already contains a module with this name." The completion button remains disabled until the ": build.gradle" value is changed.
  • Changing ": build.gradle" to "something-else" turns on the completion button, but clicking causes the following error message: FileNotFoundException: /Workspace/AndroidStudio/project/something-else (No such file or directory): /Workspace/AndroidStudio/project/something-else (No such file or directory)

Obviously, the wrong approach for importing a module as a dependency. But how else should this be done? Any advice is welcome, thanks!

+4
source share
2 answers

. , . , , . , , . ". . , , . build.gradle.

, . , -.

+7

(" ") Android-gradle .

, ( - ).

: gradle Android android, " ". , "app" Gradle.

:

  1. New Module-> Import Gradle project-> gradle. "app", : "Project " enter image description here
  2. "import" "app" "your- Module- name" . gradle . enter image description here
  3. build.gradle " "

    : 'com.android.application'

    : 'com.android.library'

  4. , build.gradle "applicationId", . "app". applicationId. . applicationId ( ) , .

  5. . , . .

0

Source: https://habr.com/ru/post/1569690/


All Articles