Questions tagged [android-build]

For questions related to the build process of Android Applications, for all build tools.

882 questions
719
votes
13 answers

What is the difference between compileSdkVersion and targetSdkVersion?

I have looked at the documentation for building with Gradle, but I'm still not sure what the difference between compileSdkVersion and targetSdkVersion is. All it says is: The `compileSdkVersion` property specifies the compilation target. Well, what…
coder123
  • 9,267
  • 5
  • 16
  • 13
330
votes
20 answers

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

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…
Zhenguo Yang
  • 3,800
  • 5
  • 18
  • 22
216
votes
24 answers

Android Command line tools sdkmanager always shows: Warning: Could not create settings

I use the new command line tools for Android because the old sdk-tools repository of Android isn't available anymore. So I changed my gitlab-ci to load the commandlintools. But when I try to run it I get the following error: Warning: Could not…
196
votes
7 answers

How to define different dependencies for different product flavors

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 { …
Janusz
  • 187,060
  • 113
  • 301
  • 369
184
votes
24 answers

Installation failed with message Invalid File

Installation failed with message Invalid File: K:\project\app\build\intermediates\split-apk\with_ImageProcessor\debug\slices\slice_0.apk. It is possible that this issue is resolved by uninstalling an existing version of the apk if it is…
Bharat Kumar Emani
  • 3,436
  • 3
  • 16
  • 30
178
votes
10 answers

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

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…
Michael
  • 4,010
  • 4
  • 28
  • 49
166
votes
6 answers

Is it possible to declare git repository as dependency in android gradle?

I want to use master version of my lib from mavencentral. Is it possible to declare git repository as dependency in android gradle?
Alexey Zakharov
  • 24,694
  • 42
  • 126
  • 197
154
votes
31 answers

Gradle, Android and the ANDROID_HOME SDK location

edit: (aug-2016) That question is from November 2013 (while Android Studio was still in Developer Preview mode), Currently (AS v2.2, Aug-2016) during instalation AS asks to choose the SDK folder (or install on their default) and it automatically…
Budius
  • 39,391
  • 16
  • 102
  • 144
103
votes
20 answers

failed to find target with hash string android-23

When trying to build OpenStreetMapView from git://github.com/osmdroid/osmdroid, I get this error: failed to find target with hash string android-23: D:\Users\myusername\AppData\Local\Android How can I fix this? Previous questions similar to this…
Al Lelopath
  • 6,448
  • 13
  • 82
  • 139
94
votes
20 answers

BuildConfig not getting created correctly (Gradle Android)

I am trying to convert our Android application to a gradle build. I have the project and it's libraries building successfully. I am now trying to create separate apks for our various environments (dev/test/prod have different urls for the restful…
Innova
  • 1,751
  • 2
  • 18
  • 26
78
votes
7 answers

Out of memory issue after updating buildToolsVersion '23.0.1' in Android studio

I am getting out of memory issue very often after updating buildToolsVersion '22.0.1' to buildToolsVersion '23.0.1' I am really confused and don't know how to solve this issue, since this error showing only with buildTools version 23.0.1. Whereas it…
Chandru
  • 5,954
  • 11
  • 45
  • 85
75
votes
10 answers

Slow SDK download through Android SDK manager

When I run Android SDK manager to download SDK platform, the download speed is 8 KiB/s. It would take more than 2 hours to download one platform like Android 2.2, API 8. There is no problem with download stuff through browser. Does anyone know how…
Peter
  • 843
  • 1
  • 9
  • 9
75
votes
9 answers

Build errors after Android Studio 3.2.1 upgrade

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:…
71
votes
6 answers

Gradle build slow on transformClassesWithDexForDebug

Building my Android app takes about 90 seconds ("fast"), up to 3 minutes for each update to my code. It's a complete waste of time as it really and I assume a solution must be within reach. I tried investigating the issue and found different…
Justin Hammenga
  • 1,091
  • 1
  • 8
  • 14
71
votes
6 answers

How to configure gradle to work "offline" (using cached dependencies)

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…
1
2 3
58 59