I'm a devops engineer, and my company is building their first Android app. For all of our other projects, we've used Jenkins to handle builds.
I've read quite a few tutorials on getting android building on Jenkins and they all seem to rely on Gradle. I'd like to get out in front of the devs a bit and start the job. Is it possible that the app that they build doesn't support Gradle? What scenarios are those, so I can influence decisions?
Maybe Gradle isn't the latest thing, if not, what is?
Is it possible that the app that they build doesn't support Gradle?
It is possible that they are not currently building the app with Gradle, but highly unlikely that the app could not be built with Gradle.
What scenarios are those, so I can influence decisions?
The most likely scenario where they are not building with Gradle, is that they use the Eclipse IDE to develop the app. Eclipse projects have historically been built more often with Ant or Maven. But an Eclipse project can be built with Gradle. That said, configuring an Android project to be built with Gradle is not a requirement to build that project with Jenkins. Ant, Maven, and other build tools play nice with Jenkins also. So, if your dev team is using a build tool other than Gradle, that shouldn't be a blocker for you. You should be able to accommodate them, if that's going to cause less friction.
Maybe Gradle isn't the latest thing, if not, what is?
I'm not sure about latest, but Gradle does currently have a lot of momentum as the build tool of choice for Android projects because it is the default build tool for Android Studio (which is positioned to replace Eclipse as the default Android IDE).
So, my advice would be to ask your dev team what IDE and build tool they are currently using, and go from there... (if they use Eclipse and you want to build with Gradle: Is it possible to use the Gradle build system for Android with Eclipse?)
Source: At the company I work for, I develop two Android apps and make daily builds with Jenkins. A few months ago I switched from Eclipse (Ant) to Android Studio (Gradle).
I hope this was helpful. I have not answered many questions on here so I'm not entirely sure I'm doing it right. :)
Related
For the last few days, I have been trying to build a testing project for android using the default build method but I just keep recieving errors and not knowing how to fix them.
Short Error and Full Error Decscription. Also I am using Unity 5.6.7f1 with Admob plugins (And yes because my pc is shit so I use this version)
So I want to ask is there an alternative way for building an android app with Unity. I have heard about exporting the project to gradle and building it using Android Studio. But I don't know how.
If you know an alternative way or how to build the project with Android Studio or how to fix the error PLEASE ANSWER. I am having a nightmare with building this stupid test project to Android
The problem is your jdk(1.8.0_311) is too new to support legacy build command from Unity (5.6.7f1).
Two method to solve:
Install older jdk
if you don't know which version you should use. You may use the default jdk with Unity installer in preferences. (I'm not sure 5.6.7f1 is supported).
Export android project
You can export android project by check the "Export Project". Then use android studio to build apk.
Android studio provides lots of plugins and features to run the task more quickly. There are two ways to run Android applications that I know,
Download Gradle and run in cmd. (Without Android Studio)
In Android Studio generally, all developers do in this way.
I know the major differences. Can we run below tasks without Android Studio and with installed Gradle and in CMD.
E.g.
I want to clean build in cmd without Android Studio.
Generate signed APK in CMD.
Run test cases in CMD.
Make sure to run above tasks there will not be any dependency on Android Studio.
The two ways are totally the same.
Also, with Gradle, you do not run Android applications. Gradle is your build tool which has a plugin for build steps necessary for Android applications. Android Studio offers you an integration of the mentioned build tool, but you are free to use this integration or a standalone Gradle installation.
However, take care about different versions of Gradle, this may cause your build files to only work with either the standalone or the Android Studio Gradle installation. Also, it may be possible, that the two installations do not share temporal folders or global properties, as they expect them in different directories.
For my part, I use the Android Studio Gradle installation with the tool integration, but switch to a standalone installation for continouus runs (e.g. a Gretty container).
What are the differences of apk from Eclipse and Android Studio[IntelliJ IDEA]
is there more security in Android Studio build?
Android Studio utilizes the fast growing Gradle build system. It builds on top of the concepts of Apache Ant and Apache Maven but it also introduces a Groovy DSL (Domain-Specific Language) that allows for scripted builds which opens up many automation possibilities like uploading your beta .apk to TestFlight for testing.
Eclipse on the other hand uses Apache Ant as its main build system which a very robust XML based build system .
Please check this SO Answer
ADT (Eclipse) vs. Android Studio: How much APK file size difference is normal?
Conclusion
Both are identical.But i prefer Android Studio.
They both use the Android SDK to generate the APKs, they should be identical.
Code protection (security by obfuscation) is done with ProGuard both on Android Studio and on ADT (Eclipse). So if you use ProGuard, there should be no difference.
I have a main Android project which references 4 other Android-Library projects in gradle. It compiles just fine and i can deploy it via gradle commandline, however I would like to debug my code using eclipse.
Whenever I load up the projects in Eclipse using the gradle integration plugin for Eclipse, eclipse won't even recognize them as library projects and instead treats them like normal android applications. Is this behavior normal or is something wrong with my gradle build script or does eclipse simply not support such a setup yet? Running/debugging the main application in eclipse just installs the individual libraries as regular applications which results in my main application not being able to find the specified classes.
My gradle build script is basically a c&p from Mike Gouline's sample project https://github.com/mgouline/android-samples with "apply: android" replaced with "apply: android-library" for my library projects.
Eclipse doesn't properly support Android Gradle projects. The Android plugin has a lot of specialized support for android-library modules that Eclipse's Gradle integration doesn't know about. For the time being, if you want full IDE support for Android/Gradle, Android Studio or IntelliJ with the Android plugin are your only choices.
We know the situation for people who are using the Gradle build system and want to use Eclipse isn't great; it's something we're thinking about, but we don't have anything definite on the roadmap yet.
So,
as it seems that more and more people are using Android Studio i got curious and wanted to take a peek at it.
I have used Eclipse up until now and wanted to migrate a project to Android Studio. So i exported a gradle buildfile from within Eclipse, as android.developer.com suggested.
That worked fine, now i wanted to import that into Android Studio 0.3.2
When trying to import i got that Unable to import Eclipse project to Android Studio error. Now it is building.
But it got a new suprise, now before it is finished building, its asking specifically for an older Version of Gradle(1.6)... Ok, i can do that. Which leads me right back to the first error. So i tried this - Gradle version 1.6 is required. Current version is 1.8-20130730220035+0000
I can however create a New Project with Android Studio.
I've tried this for about an hour now and im getting sort of pissed, because it doesnt seem to know what it wants. Is it some sort of Bug or did i make some sort of mistake.
You're using a very old version of Android Studio. I'd recommend upgrading to 0.4.3. Versions later than 0.4.0 allow direct import of Eclipse projects instead of requiring you to do the cumbersome (and as you've seen problematic) export of projects from Eclipse; it's smarter about setting up the right plugin and Gradle versions. 0.4.3 has some important bugfixes over 0.4.0-0.4.2.
I've just migrated my projects. Here is two suggestions from my side.
Take the latest Android Studio.
Do not export / import projects from Eclipse. Most likely you are going to have errors in the project after this step. Starting from a clean project, which builds, will safe you a lot of time and avoid unnecessary frustration.
Create an empty Android Project in Android Studio. It must build without errors (⌘ F9). The start to enhance it using official Gradle Plugin user guide.
Create libraries folder and add all libraries in there one by one. Update build.gradle dependencies as mentioned in user guide. Make sure everything builds successfully.
After all libraries build you can copy-paste sources, resources and assets from Eclipse project to corresponding folders of Android Studio project. Make sure everything build as expected.
Now you can start with more advanced configuration like ProGuard configuration, release certificates etc.
I've done it in a couple of hours. Hope this helps you too.