android-build

How to install Android SDK Build Tools on the command line?

五迷三道 提交于 2019-11-26 19:10:49
I want to setup the Android dev environment from command line, and encounter the following issue: wget http://dl.google.com/android/android-sdk_r22.0.5-linux.tgz after extract the file, run tools/android update sdk --no-ui However, it is too slow on running Fetching https://dl-ssl.google.com/android/repository/addons_list-2.xml The result is that nothing in folder build-tools, and I want is aapt and apkbuilder, since I want to build apk from command line without ant. Nate By default, the SDK Manager from the command line does not include the build tools in the list. They're in the "obsolete"

How to configure gradle to work “offline” (using cached dependencies)

心不动则不痛 提交于 2019-11-26 17:42:55
I have a command line apk generator which compiles a lot of APKs using the same source code, so these apps have the same dependencies. In the gradle documentation I can see this: The Gradle project needs network connectivity to download dependencies. I know that it is possible to configure gradle to work offline and not download the same dependencies that it has downloaded for other apks. How can this offline mode be activated? Gradle does a good job of avoiding redownloading artifacts, but you can pass --offline to grade to prevent from accessing the network during builds. If it needs

How to define different dependencies for different product flavors

一笑奈何 提交于 2019-11-26 17:06:47
I am converting one of my apps to Gradle and would like to use the new build flavor features to have a paid and a free ad based flavor. I want only the ad based version to depend on the admob SDK. My build file looks like this: buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.5.+' } } apply plugin: 'android' repositories { mavenCentral() } android { compileSdkVersion 18 buildToolsVersion "18.0.1" defaultConfig { minSdkVersion 10 targetSdkVersion 18 } productFlavors { Pro { packageName "de.janusz.journeyman.zinsrechner.pro" } Free {

Disable Manifest Merger in Android Gradle Build

泪湿孤枕 提交于 2019-11-26 14:07:46
问题 I am using the new gradle android buildsystem. The project consists of two android library projects and one main project. Using the ant build, the manifest merger must be enable in project.properties. But when using the gradle build system the manifest merger is enabled by default. How can i disable the manifest merger? 回答1: Edit: this is actually possible though indirectly, starting with 0.3 What you need to do is disable the processManifest task so that it doesn't run and tell the

How to set different applicationId for each flavor combination using flavorDimensions?

岁酱吖の 提交于 2019-11-26 12:59:36
问题 I have and old android app that I am trying to migrate to the android gradle build system. The app is currently built in a multi project setup and published as four different apps (two different data sets included and free/paid versions for both datasets). I have managed to get away from the multi project setup by using flavorDimensions (previously called flavorGroups), but I can not figure out how to set a different applicationId for each flavor combination. Since the app versions are

How to change the Android app package name when assembling with Gradle?

送分小仙女□ 提交于 2019-11-26 10:34:45
问题 Is it possible to change the package name of an Android application using Gradle? I need to compile two copies of the same app, having a unique package name (so I can publish to the market twice). 回答1: You could so something like this android { ... defaultConfig { minSdkVersion 8 versionCode 10 } flavorDimensions "flavor1", "flavor2" productFlavors { flavor1 { applicationId "com.example.flavor1" versionCode 20 } flavor2 { applicationId "com.example.flavor2" minSdkVersion 14 } } } You can also

Automatic versioning of Android build using git describe with Gradle

只愿长相守 提交于 2019-11-26 10:13:00
问题 I have searched extensively, but likely due to the newness of Android Studio and Gradle. I haven\'t found any description of how to do this. I want to do basically exactly what is described in this post, but with Android Studio, Gradle and Windows rather than Eclipse and Linux. 回答1: A more proper and lean way to achieve the result which gained traction lately would be to use gradle git integration via Groovy JGit bindings. As it uses JGit it doesn't even require git to be installed to work.

Build errors after Android Studio 3.2.1 upgrade

梦想的初衷 提交于 2019-11-26 08:06:54
问题 I am building a sample project from Udacity. This was working fine till now, but after upgrading to Android Studio 3.2.1, I am facing the build error below. Gradle version: 4.6 Project link: https://github.com/udacity/ud851-Sunshine/tree/student/S02.02-Solution-Menus Could not find com.android.tools.build:aapt2:3.2.1-4818971**. Searched in the following locations: file:/C:/Users/sandeepk2/AppData/Local/Android/Sdk/extras/m2repository/com/android/tools/build/aapt2/3.2.1-4818971/aapt2-3.2.1

Android Studio: Plugin with id 'android-library' not found

蹲街弑〆低调 提交于 2019-11-26 07:58:15
问题 I\'ve been trying to get ActionBarSherlock to work and having some issue. One issue I\'ve come across is the following message when trying to build it: Plugin with id \'android-library\' not found Specifically: D:\\Projects\\Android\\actionbarsherlock>D:\\Projects\\Android\\gradlew --info build Starting Build Settings evaluated using empty settings script. Projects loaded. Root project using build file \'D:\\Projects\\Android\\actionbarsherlock\\build.gradle\'. Included projects: [root

How to install Android SDK Build Tools on the command line?

荒凉一梦 提交于 2019-11-26 06:51:03
问题 I want to setup the Android dev environment from command line, and encounter the following issue: wget http://dl.google.com/android/android-sdk_r22.0.5-linux.tgz after extract the file, run tools/android update sdk --no-ui However, it is too slow on running Fetching https://dl-ssl.google.com/android/repository/addons_list-2.xml The result is that nothing in folder build-tools, and I want is aapt and apkbuilder, since I want to build apk from command line without ant. 回答1: By default, the SDK