LEO
LEO

Reputation: 2612

Use Android Studio With Maven ONLY

All I want to do is use Android Studio without converting to Gradle. I MUST use maven (Client Requirements). How can I accomplish this?

I was able to get this working by opening up the pom.xml file but every time I close the project and reopen it, gradle is forced on me and I can't run anymore. Project layout also changes on me.

When I open up the project the first time using pom.xml, the module looks like this: enter image description here

When I close the project and open up a 2nd time, the module looks like this: (With the inability to run because Run/Debug says 'No Android facet found in the module') enter image description here

I can get back to my original state by doing File->Open and reselecting the pom.xml file. I make sure to hit no on the first pop-up:

enter image description here

I blanked out my build.gradle file like so:

buildscript {
    repositories {
    }
    dependencies {
    }
}
repositories {
}
dependencies {
}

Extra Notes:

  1. Exported from eclipse ADT for a build.gradle file. Android Studio was missing all External Libraries that were Maven Dependencies.
  2. Started my own build.gradle file to indlude dependencies but I don't want to maintain two separate files (build.gradle & pom.xml).
  3. Deleted the build.gradle file and anything gradle related in the android project folder before reopening but that did nothing.
  4. Developing on Linux OS Android Studio version 0.4.2

Upvotes: 0

Views: 2377

Answers (1)

LEO
LEO

Reputation: 2612

I don't like to answer my own questions but I thought a work around might help others in this case.

What I noticed is that Android Studio fights between gradle and maven and chooses gradle if you have a gradlefile for the project as well as maven.

Work Around

  1. Open Module Settings

  2. Remove all modules. Select the module and hit the minus key to delete.

  3. Click yes on the prompt.

  4. Open up Maven Projects and click the plus key

  5. Browse to your pom file and hit open.

Upvotes: 1

Related Questions