Android Studio Add External Project to Build.Gradle

Android studio add external project to build.gradle

Assuming that Some Other Folder is a gradle project you could add something like the following to your settings.gradle file:

include ':module1'
project(':module1').projectDir = new File(settingsDir, '../Project B/Module 1')

Can't import external project as module in Android Studio 3

I have solved opening modules project one by one and doing this for each one:

  • Project Structure -> Project -> Gradle Version = 4.7
  • Settings -> Build, Execution, Deployment -> Compiler -> Uncheck "Configure on demand"
  • Rebuild project once you can see your .aar file into build/outputs/aar

Then repeat these steps for main project module

Adding external library in Android studio

Try this:

File > Project Structure > Dependencies Tab > Add module dependency (scope = compile)

Where the module dependency is the project library Android folder.

How to add external library project to android studio 1.2.2? with solution

You just need to create a module and add the external library project to this module. Then add module dependency in project structure. That's all. Android Studio will automatically add everything to Gradle file. You don't need to do these manually.

Android Studio: Setup external project as module

It turned out that you can add ResuableProject but cannot use its source if build.gradle has value apply plugin: 'android' i.e. the type of the project is application.

I changed that to apply plugin: 'android-library' i.e. it must be a library and now everything is working fine.

Including external project into Android app

Are you missing colon in your AndroidApp/settings.gradle file?

include ':app', ':core'
project(':core').projectDir = new File('../NetworkCore')

Add external project in Android Studio project as dependency results in error not finding a file

Use binary deps via mavenLocal() repo:

  1. git clone https://github.com/firebase/FirebaseUI-Android
  2. cd FirebaseUI-Android
  3. gradlew tasks // you will see publishToMavenLocal
  4. Open FirebaseUI-Android into a separate instance of Intellij
  5. Make your changes
  6. Run gradlew publishToMavenLocal
  7. In your own project, add mavenLocal() to your repositories
  8. Then add compile 'com.firebaseui:firebase-ui:0.4.1' do your dependencies

After all that, you are good to go.

  1. Make changes to the library
  2. Publish it again via gradlew publishToMavenLocal
  3. Re-compile your application

Add external project dependency in gradle

I hope you understand basics of grade file structure in the project.

Refer to my answer here for a solution to getting external library projects to compile into your main project.

Hope it helps! :)

How to add an external library to my project in Android Studio?

Go to :
File > Project Structure > in modules App go to 'dependencies' tab > click on '+' go for 1 'Library Dependency' > search for 'com.astuetz:pagerslidingtabstrip:1.0.1' without quotes > ok



Related Topics



Leave a reply



Submit