Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle support #619

Merged
merged 6 commits into from
Jan 30, 2014
Merged

Gradle support #619

merged 6 commits into from
Jan 30, 2014

Conversation

zumbrunnen
Copy link
Member

Gasp! That gave me headaches! After a few more hours, I managed to do achieve basic Gradle support: Project can be opened and built in Android Studio. Here's what I've done:

  • build.gradle files for main and sub-projects
  • Fixed some redundancies in the resources (Build system complained about it)
  • Moved to API v19

Except for the last bullet (API update), the traditional builds with Eclipse should not be affected by this.

Anyway, there are a few things to care about in the future:

  • Different Android Support libraries: The submodules and the main project use different versions (Android Support, Google Play Services). In Android Studio, external libraries can be referenced like this: http://developer.android.com/google/play-services/setup.html#Setup
  • .gitignore files aren't perfect yet. We need some more experience for a better tuning. For the moment, I excluded the whole .idea directory.

@m4gr3d
Copy link
Member

m4gr3d commented Jan 29, 2014

@zumbrunnen Great job! I'll try to run the project when I get off work, and see if I ran into any issues.

@zumbrunnen
Copy link
Member Author

Hey @ne0fhyk
Cool, let me know if you run into problems. Sometimes it's a bit tricky. Here are a few things to remember:

  • After importing/opening the project, it's important to sync your projects from the Gradle files
  • I think, the Google Play Services are lacking resources. As a result, the app only runs if you have Google Maps installed (Google API target or attached device)
  • Also, pay attention that you have the right change-sets of the sub modules. If not, the sub-projects won't build.

@arthurbenemann
Copy link
Member

I hope to do this merge in a couple of hours.

@ne0fhyk could you check the build via gradle and post here? Ill make sure
it build correctly with eclipse.
Em 29/01/2014 20:45, "David Zumbrunnen" [email protected] escreveu:

Hey @ne0fhyk https://github.com/ne0fhyk
Cool, let me know if you run into problems. Sometimes it's a bit tricky.
Here are a few things to remember:

  • After importing/opening the project, it's important to sync your
    projects from the Gradle files
  • I think, the Google Play Services are lacking ressources. As a
    result, the app only runs if you have Google Maps installed (Google API
    target or attached device)
  • Also, pay attention that you have the right changesets of the
    submodules. If not, the sub-projects won't build.

Reply to this email directly or view it on GitHubhttps://github.com//pull/619#issuecomment-33640539
.

@arthurbenemann
Copy link
Member

I think, the Google Play Services are lacking ressources. As a result,
the app only runs if you have Google Maps installed (Google API target or
attached device)

Thats the way it works with google services, what we dont have is a way to
wsrn the user about this prpblem.

@arthurbenemann
Copy link
Member

I just tested the build on Eclipse+ADT and it build-ed without problems, so I'm merging this. Also the change to API19 is a good change.

I have not confirmed that the gradle build works, but since that doesn't interfere with the eclipse build there should be no problems for other developers.

@zumbrunnen Now I see why you wanted me to do the merges of the submodules before making this pull request, you needed the merge commit id (I was thinking to myself why he needs me to merge that since he has already commited the changes to his own fork).

arthurbenemann added a commit that referenced this pull request Jan 30, 2014
@arthurbenemann arthurbenemann merged commit dd61981 into DroidPlanner:master Jan 30, 2014
@arthurbenemann
Copy link
Member

Please update your submodules

On the command line run: git submodule updatebash

@m4gr3d
Copy link
Member

m4gr3d commented Jan 30, 2014

@zumbrunnen sorry for the delay, i had to take care of some work.
I checkout the branch and import the project as described, but i've been unable to build yet on android studio. The build throws a com.android.dex.DexException error which i think is related to having multiple support library jar files in the project. Have you run into this issue?

@zumbrunnen
Copy link
Member Author

@ne0fhyk I encountered this error, too. It wants to tell us "you have a library twice (with two different versions) in your app". Cause for this is the Android Support library which is linked by the main project and by the projects in the submodules. If everything is the same version, you won't see this error.

That's why I mentioned my concern "Different Android Support libraries".

@m4gr3d
Copy link
Member

m4gr3d commented Jan 30, 2014

@zumbrunnen I got it to work. It seems that for whatever reasons I wasn't getting the latest update to the submodule even after running git submodule update.

HorizontalVariableListView and Mavlink projects don't really depend on the google-play-service-lib project, so I'd suggest replacing:

dependencies {
    compile project(':google-play-services_lib')
}

with

dependencies {
    compile 'com.android.support:support-v4:13.0.0'
}

I tested it, and the application build fine with those entries.

@zumbrunnen
Copy link
Member Author

Hey @ne0fhyk
Thanks for the info. I was not sure about the deps - so I'm glad to hear those two don't depend on it. And that you managed to reference the Support library the "Android Studio way" is really great! I tried that too, but somehow I got errors because of other references to the google-play-services_lib.

Do you fix the Gradle files or shall I?

@zumbrunnen zumbrunnen deleted the gradle branch January 31, 2014 10:25
@m4gr3d
Copy link
Member

m4gr3d commented Jan 31, 2014

@zumbrunnen you already got the work started so it's all yours :)

Also, could you try to import the project from scratch after removing the *.iml files. I think they update with local information, so it might be better to remove them from the git repository if they're not needed to successfully import the project in android studio.

@zumbrunnen
Copy link
Member Author

@ne0fhyk Wilco! I'll file 3 "clean up" PRs (for the main project and the 2 sub modules) as soon as I find some time.

@arthurbenemann For the "clean up" it would be good to merge the 2 PRs for the submodules first, so I can include the new subproject commits in the main PR (droidplanner repo).

@arthurbenemann
Copy link
Member

@zumbrunnen The submodules pull's have been merged, fell free to proceed with #623. I'm sorry for the delay, I expĺained my reasons here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants