android-gradle

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

对着背影说爱祢 提交于 2019-11-30 17:52:56
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. 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 the source of truth in the Gradle build files. It doesn't execute a specific task to do this, but it instead

Why Android change 'compile' to 'implementation' configuration in Gradle dependencies?

纵饮孤独 提交于 2019-11-30 17:49:06
As seen in Android Studio 3.0 (canary 3.0), we now add depedencies by declaring implementation instead of compile configuration. // Before compile 'com.android.support:appcompat-v7:25.3.1' // Currently implementation 'com.android.support:appcompat-v7:25.3.1' We can still use compile , but I would like to understand: What is the difference between implementation and compile configuration? Why do Android Gradle build change to use implementation as default? It seems like compile has been deprecated and api or implementation should be used instead. According to The Java Library Plugin - Gradle

How to exclude a file from an .AAR Android library archive with gradle

走远了吗. 提交于 2019-11-30 17:46:14
I am trying to create an AAR file for a library Android project using Android Studio and gradle. I want to exclude from this archive specific folders and files but I cannot find a working solution. The project has 2 flavours. app/ |--libs/ |--src/ |--flavour1/ | |--java/ | |--a1/ | | |--class_File1.java |--flavour2/ | |--java/ | |--a1/ | | |--class_File1.java |--main/ |--java/ | |--... |--res/ | |--raw/ | | |--comments.txt | |--... |--AndroidManifest.xml and I use a build.gradle file like this one apply plugin: 'com.android.library' android { compileSdkVersion 21 buildToolsVersion "21.1.2"

Gradle buildConfigField: Syntax for arrays & maps?

Deadly 提交于 2019-11-30 17:36:57
The android gradle documentation says about buildConfigField: void buildConfigField(String type, String name, String value) Adds a new field to the generated BuildConfig class. The field is generated as: type name = value; This means each of these must have valid Java content. If the type is a String, then the value should include quotes. I can't find any information about the syntax of buildConfigField values for Arrays, Arraylist or a HashMap? Since they are compiled into java code usually everything should be possible. Does anyone has some examples or documentation? For array app.gradle

Change generated apk name from “app-debug.apk”

不想你离开。 提交于 2019-11-30 17:23:31
Every time I run a project with Android Studio (1.02) it's generate an unsigned apk which located in ..\build\outputs\apk folder and get by default the name "app-debug.apk" I want to change that default name to something else. Is it possible? How? You can use applicationVariants and change the output file in the build.gradle. You can also modify the name regarding to your needs. buildTypes{ applicationVariants.all { variant -> variant.outputs.each { output -> output.outputFile = file("$project.buildDir/apk/test.apk") } } } In build.gradle (Module: app): android { ... defaultConfig { ...

Why Android Gradle preDexDebug “Source and destination must be different” build failed?

半世苍凉 提交于 2019-11-30 17:20:15
I have an Android application built with Android Studio 0.8.1 and facing the issue: Error:Execution failed for task ':app:preDexDebug'. > java.lang.IllegalArgumentException: Source C:\Users\mfedorov\AndroidStudioProjects\EPOS2\app\build\intermediates\pre-dexed\debug\mate-api-0.0.1-SNAPSHOT-0ef7e3259aeaf19202f545da97dc6b1ae2502c9a.jar and destination C:\Users\mfedorov.ALTIUS-PLUS\AndroidStudioProjects\EPOS2\app\build\intermediates\pre-dexed\debug\mate-api-0.0.1-SNAPSHOT-0ef7e3259aeaf19202f545da97dc6b1ae2502c9a.jar must be different Here's my build.gradle file contents (the part that I have

Is it safe to delete the .gradle folder in Android Studio?

纵饮孤独 提交于 2019-11-30 17:07:59
I have an old project that am working at, I noticed that the .gradle folder has too many subfolders for each distribution of gradle I've changed in the past, is it safe to delete the old versions subfolders? Inside the project you can find the .gradle folder. Inside you can find all settings and other files used by gradle to build the project. You can delete these files without problems. Gradle will recreate it. Also these file are not committed and Version Control Systems. It means that when you checkout the project these files are not present on the project. Though its very old thread but

Gradle build failing after update to Android studio 2.3 Canary 3

早过忘川 提交于 2019-11-30 17:06:09
I've recently updated the android studio version of my project from 2.3 Canary 2 to 2.3 Canary 3. Since then the gradle build is failing every time with this error: Error:Unable to find method 'org.gradle.api.tasks.Sync.getInputs()Lorg/gradle/api/internal/TaskInputsInternal;'. Possible causes for this unexpected error include: Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network) The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this

Gradle Build Failure

若如初见. 提交于 2019-11-30 16:58:08
My project compiles and executes well on debug mode but when i try to generate a signed apk, errors arise. This appears on the message log: :app:proguardRelease Warning:android.support.v4.app.DialogFragment: can't find referenced class android.support.v4.app.DialogFragment$DialogStyle Warning:android.support.v4.app.FragmentTransaction: can't find referenced class android.support.v4.app.FragmentTransaction$Transit Warning:android.support.v4.view.ViewCompat: can't find referenced class android.support.v4.view.ViewCompat$ResolvedLayoutDirectionMode Warning:android.support.v4.view.ViewCompat: can

Android - Renderscript Support Library - Error loading RS jni library

筅森魡賤 提交于 2019-11-30 15:51:50
I am trying to include the Renderscript support library into my project. I am getting the following error. android.support.v8.renderscript.RSRuntimeException: Error loading RS jni library: java.lang.UnsatisfiedLinkError: Couldn't load rsjni: findLibrary returned null I am not using any Renderscript jar files, I am attempting to use it via Gradle. Here are my Gradle.build files TOP LEVEL buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.2.3' } } ext { compileSdkVersion="Google Inc.:Google APIs:22" buildToolsVersion="23.0.1"