build.gradle

Using APK Splits for Release but not Debug build type

两盒软妹~` 提交于 2019-11-30 01:35:02
I've successfully implemented APK Splits so that separate APKs are generated for different ABIs. However, for efficiency (and since I have no need for non-armeabi-v7a APKs in Debug), I would like to limit Debug builds to only generate armeabi-v7a APKs. How can this be done? One idea is with this: abi { enable true reset() include 'x86', 'armeabi-v7a', 'mips' universalApk false } Maybe there is some way to set enable based on the Build type? Jeff P You can try a variation on @Geralt_Encore's answer, which avoids the separate gradlew command. In my case, I only cared to use APK splitting to

What Gradle task(s) does IDEA / Android Studio run when I press Sync Now and the Refresh button?

冷暖自知 提交于 2019-11-30 01:29:45
问题 See image below: What exactly does the Sync now (blue) and refesh button (red) do respectively? What Gradle Tasks and/or other processes does Idea/Android Studio launche when clicking these? I need to debug some errors with my gradle.build file and knowing what these buttons do will help me in that regard. 回答1: Both those actions do essentially the same thing. Their primary task is to evaluate the Gradle build files to synchronize Android Studio's picture of the structure of the project with

Android Studio update -Error:Could not run build action using Gradle distribution

倖福魔咒の 提交于 2019-11-30 01:26:42
I have recently updated android studio to the latest version,but then comes the problem. Gradle 'MyApplication' project refresh failed. Error:Could not run build action using Gradle distribution ' https://services.gradle.org/distributions/gradle-2.2.1-all.zip '. Found this in StackOverflow However trying everything nothing works - cannot create new project of import anything at the moment.Please kindly advice. apply plugin: 'com.android.application' android { compileSdkVersion 21 buildToolsVersion "21.1.2" defaultConfig { applicationId "com.sclick.myapplication" minSdkVersion 14

Run shell command in gradle but NOT inside a task

你离开我真会死。 提交于 2019-11-30 00:43:52
问题 What I currently have is: task myTask (type : Exec) { executable "something.sh" ... (a lot of other things) args "-t" args ext.target } task doIt { myTask.ext.target = "/tmp/foo" myTask.execute(); myTask.ext.target = "/tmp/gee" myTask.execute(); } With this I thought I could run "myTask" with different parameters when I start "doIt". But only the first time the script is executed because gradle takes care that a task only runs once. How can I rewrite the "myTask" so that I can call it more

com.android.tools.r8.errors.CompilationError: Program type already present: androidx.annotation.AnimRes

China☆狼群 提交于 2019-11-30 00:41:06
问题 I'm trying to rebuild my project which I've written in kotlin but it has constantly failed with the error Program type already present: androidx.annotation.AnimRes I've tried Invalidating cache cleaning and rebuilding using ./gradlew build --stacktrace --info command but without success. Exception is org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformClassesWithMultidexlistForDebug' Stack trace is Caused by: java.lang.RuntimeException: com.android.build.api

Starting a Gradle Daemon, 1 busy and 6 stopped Daemons could not be reused, use --status for details

删除回忆录丶 提交于 2019-11-30 00:40:40
问题 When I was running the gradle clean command, I got the following message Starting a Gradle Daemon, 1 busy and 6 stopped Daemons could not be reused, use --status for details For the investigation, I run the following command. $ gradle --status PID STATUS INFO 11506 BUSY 4.3.1 8027 STOPPED (stop command received) 9347 STOPPED (stop command received) 11727 STOPPED (by user or operating system) 4786 STOPPED (by user or operating system) 14569 STOPPED (by user or operating system) 31237 STOPPED

Gradle build error, Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'

匆匆过客 提交于 2019-11-30 00:09:16
I've updated the Android studio for 1.4, also gradle version updated(1.4.0-beta3). It is my build.gradle file // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { //classpath 'com.android.tools.build:gradle:1.2.3' classpath 'com.android.tools.build:gradle:1.4.0-beta3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { //ViewPagerIndicator maven { url "http://dl.bintray.com/populov/maven" }

How to use flavors with different app names in Android studio?

筅森魡賤 提交于 2019-11-29 23:37:30
In my app-level build.gradle I have the following flavors: productFlavors { originalFlavour{ } freeFlavour{ } } The thing is building both flavors I get the same App Name. Instead I would like to have different app names for each flavors. Just adding a suffix would be useful. Hope someone could help me. Thanks in advance EDIT : app/src/main/AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="z.fncapps.etsiipod" > <uses-permission android:name="android.permission.CALL_PHONE" android:required="false" /> <uses

Force Android Studio to download and install gradle 1.10 or 1.1

亡梦爱人 提交于 2019-11-29 22:23:33
I installed Android Studio 0.5.1 and my project is not working any more. Error it provides is: The project is using an unsupported version of Gradle. Please use version 1.10. I tried to change settings in gradle-wrapper.properties and gradle.build file, but without luck. gradle-wrapper.properties file: #Wed Mar 12 11:11:46 CET 2014 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip My gradle.build looks like this: buildscript { repositories {

How can I add flavors in a module with Android Studio?

我是研究僧i 提交于 2019-11-29 20:19:24
I have a suite of projects that use the same module, which contains nearly all the actual code. The project is setup like: project/ - app/ - build.gradle - libraries/ - module/ - build.gradle - build.gradle - settings.gradle The dependencies are all setup correctly, and I can build and run apps great, however I can only add flavors to the project, which is not the ideal solution. settings.gradle contains the following: include ':app', ':libraries:module' In the app directory's build.gradle file, I added the following block: productFlavors { alpha production } Using gradle 0.11, this syncs and