5 ms·
> Google’s adoption of gradle has been a disaster and proved to be a terrible decision. It did help out with some previous issues, namely multiple app targets,
by MaulingMonkey 10y ago
> Google’s adoption of gradle has been a disaster and proved to be a terrible decision. It did help out with some previous issues, namely multiple app targets, but it’s slowed down compilation severely. It also makes for masochistic configuration files with major redundancy and fragmented dependency hosts. Getting an app to compile shouldn’t be a challenge.
The only thing worse than gradle is ANT, which it replaced.
> Wait, what is picasso? Oh wow, I hadn’t heard of that one…I was busy learning Swift.
I just minimize the amount of platform specific tech in the codebase as much as possible. RxJava? That's going to be real fun to port...
Ahh, this didn't even touch on my least favorite part of Android - command line tools that tell you they've "successfully" deployed APKs. And returned successful return codes. That in reality silently failed due to ever so slightly loose USB connections.
On the plus side, they finally fixed https://code.google.com/p/android/issues/detail?id=197287 https://code.google.com/p/android/issues/detail?id=197287 in Android 7.0 it looks like...? I'm trying to remember if that was the bug to blame for my last 16 hour day...
- rifung 10y ago> The only thing worse than gradle is ANT, which it replaced. What's wrong with ant? I liked it.. It was simple to understand for the most part. It also made it easy to develop without an IDE, although I'll admit I don't know how easy it is now as I stopped doing Android a year ago
- stuaxo 10y agoAlmost every ant file I've had the pleasure of working with in the wild is made badly (having to run things in specific order instead of depending on each other is a classic). With Android, they seemed to change the build files every minor release (my info may be out of date here).
- MaulingMonkey 10y ago> Almost every ant file I've had the pleasure of working with in the wild is made badly (having to run things in specific order instead of depending on each other is a classic). Dependencies were a mess. Depend on A and B with both depend on C? C gets pulled in twice, build fails. Workaround? Hack up A to depend on B instead, and have your project depend on A. Surely adding a new dependency isn't supposed to involve mucking with the build files for half of your existing previously fine third party libs just to get the bloody thing building again - such that all dependencies are only referenced once, yet such that every library has it's dependencies indirectly satisfied by whatever it's been configured to depend on. I assume I was doing something wrong. I probably sunk a good week into consuming docs and trying stuff out to figure out exactly what. I still have no clue. My coworkers couldn't figure it out either. I wrote wrapper scripts - and later a full blown partial adb wrapper - to fix the silent deploy failures, after one too many hours of wasted debugging sessions (caused by debugging stale builds) made me crack. A few commands to check file sizes and timestamps... a few regular expressions to parse the results... a few debugging sessions when e.g. the installation defaults for "adb logcat" log output format changed between SDK versions... After reaching a similar snapping point for ANT, I took the slightly less drastic option of switching to gradle for the next Android project I tackled. I remember gradle being merely 50% as terrible as ANT. I seem to have successfully repressed many of my more detailed memories of dealing with both. Huzzah!
- flukus 10y agoThe problem I had with it was all the crap google would do automagically, not really an ant problem, but building android software is a mess: http://flukus.github.io/2014/08/19/2014_08_19_Android-Take-back-your-builds/ http://flukus.github.io/2014/08/19/2014_08_19_Android-Take-b...
- izacus 10y agoAnd that's about all it does. Gradle has proper dependency managment with Maven repository support (add one line and your library is in, no fsckery with JARs and whatnot), has scripting in an imperative language instead of craziness of XML (we use it to automate releases, uploads, Git commits, etc.) and really good plugin support. It's also slow as arse unfortunately.
- pjmlp 10y agoExcept many of us are comfortable with XML "craziness" and see no value in Gradle besides wasting battery.
- rifung 10y agoAh I agree on the dependency part. I suppose it was easy enough for me to just pull in the jars but I suspect my projects had rather simple dependency needs. Sounds like what you were doing was much more involved! I appreciate the reply
- flukus 10y agoSo it's like make then? We've had tools to do this for 30+ years.
- pjmlp 10y ago> The only thing worse than gradle is ANT, which it replaced. Ant is wonderful. It runs FAST and executes builds properly. Gradle makes my fans go full throttle, takes minutes to complete builds unless I make use of a background daemon with 2GB allocated to it. If it wasn't for Android, I would never use Gradle! Even Maven feels like a pleasure (yes I do enjoy XML).
- dlubarov 10y agoDid you try profiling your build? https://docs.gradle.org/current/userguide/tutorial_gradle_command_line.html#sec:profiling_build https://docs.gradle.org/current/userguide/tutorial_gradle_co... If not then you shouldn't assume it's Gradle's fault. A lot of Android Gradle builds are slow because they proguard lots of class files, merge large dex files, etc. Which is all optional functionality of the Android plugin, not inherent to gradle.
- pjmlp 10y agoAny Android Studio generated project will do. Dual core with 8 GB, 500 GB HD, perfectly fine for Eclipse, Visual Studio, MSBuild, Ant, Maven. No need for performance tricks like Gradle requires.
- shruubi 10y agoDo you realise how insane it sounds to tell someone to profile their build config? The fact that people need to do this is the problem.
- seviu 10y agoMoving to Gradle was a terrible mess. Ant was simple, effective and fast. Even now every time I fire up an Android build with gradle my laptop feels like it is going to fly. However Android has come a long way since the early days. The author focuses on the bad things we all know about. Android development is incrementally getting better every month. On top of that Android Studio is a way better development tool than Xcode. To the point that I wish Apple drops Xcode completely and starts using AppCode. - Android Studio has powerful refactoring tools. Xcode lets you do some basic refactoring only on Objective C - Despite gradle being a pain, it gives you dependency management. To get that on iOS you have to resort to third party tools like cocoapods or carthage (though swift has now one too) - Autocomplete works reliably, every single time - Translations are way easier to do. Android studio comes with a translation editor and translations are in one place. I welcome you to try to translate a storyboard on Xcode and maintain that. - Android Studio UI editor is now way better than what it used to be. Despite that, Interface Builder is still the king of UI editors. - Editing the UI XML is trivial on Android. Try to merge a storyboard or a xib... and Android Studio does not automatically modify your UI xml files every time you open them. - Signing on Android is a thing you configure once and that's it. I have wasted days dealing with signing problems on iOS. - Etc... However I enjoy more doing iOS development. I cannot explain why, it is a more pleasant experience. At least to me. I still love both platforms anyway.
- vbezhenar 10y agoI wonder, what's wrong with Gradle? I didn't develop for Android, but I use Gradle for plain Java projects and it's greatest build tool I've ever worked with. It's even better than Maven. Is it because of bad Android plugins?
- lmm 10y agoI used maven from the start and it's wonderful. Actually declarative builds. A well-defined config format rather than the unspecified .gradle . Plugins with reasonable defaults rather than turing-complete code all over your build definition.