build.gradle

Gradle build error: Failed to resolve:

隐身守侯 提交于 2019-12-04 07:39:45
I just downloaded Android Studio and created a new project and I'm getting gradle build errors: Failed to resolve: com.android.support.test.espresso-core:2.2.2 and Failed to resolve: com.android.support.appcompat-v7:25.3.1 This error was resolved reinstalling the SDK Tools + Repository + API when launching android studio as admin. I've installed API Level 25 which what I want to build on and have downloaded the SDK Build-Tools. I have also already download the support repository Here's my app file: apply plugin: 'com.android.application' android { compileSdkVersion 25 buildToolsVersion '25.0.3

Force task execution in Gradle

不打扰是莪最后的温柔 提交于 2019-12-04 06:34:57
A certain amount of Gradle tasks I wrote, don't need any in- or output. Because of that, these tasks always get the status UP-TO-DATE when I call them. An example: task backupFile(type: Copy) << { //Both parameters are read from the gradle.properties file from file(adjusting_file.replaceAll("\"", "")) into file(backupDestinationDirectory + "/main/") println "[INFO] Main file backed up" } Which results in the following output: :gradle backupFile :backupFile UP-TO-DATE Is there a way to force a(ny) task to execute, regardless of anything ? If there is, is it also possible to toggle task

build.gradle in the project vs. build.gradle in the app

我们两清 提交于 2019-12-04 06:09:55
I started a project in Android Studio, with IntelliJ. The project includes two files called build.gradle . One is under the folder app , and one is under the main folder which is my project name, say MyProject . Why the need for two? What is the difference between the two build.gradle s? Android Studio project consists of modules, libraries, manifest files and Gradle build files. Each project contains one top-level Gradle build file. This file is named build.gradle and can be found in the top level directory. This file usually contains common config for all modules, common functions.. Example:

Update Android built tool To 18.0

对着背影说爱祢 提交于 2019-12-04 05:34:00
I used to use Android Built-Tools 17 to build a project, now the tools I have updated to 18.0, Now I change build.gradle : android { compileSdkVersion 18 buildToolsVersion "18.0.1" } when I run this, it was wrong, Gradle: Execution failed for task ':HandyHis:compileDebugAidl'. failed to find Build Tools revision 18.0.0 What should I do? Look in the SDK Manager what is your highest Android SDK Build-tools version, and copy this version number in your project "build.gradle" file in the android/buildToolsversion property (for me, version was "18.1.1"). Hope it help! 来源: https://stackoverflow.com

Android resource compilation failed after the update

 ̄綄美尐妖づ 提交于 2019-12-04 05:03:30
After the updating the android studio... my project is crashed with the error below Android resource compilation failed Output: C:\Users\aliya\Desktop\EventsToday\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1668: error: <item> inner element must either be a resource reference or empty. C:\Users\aliya\Desktop\EventsToday\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1669: error: <item> inner element must either be a resource reference or empty. C:\Users\aliya\Desktop\EventsToday\app\build\intermediates\incremental

New error after update to gradle-tool to 3.1.0-beta3 or 3.2.0-alpha03

耗尽温柔 提交于 2019-12-04 04:30:00
Just a normal project with "prod" and "mock" flavors in app/build.gradle: sourceSets { main.java.srcDirs += "blabla bla" test.java.srcDirs += "blabla bla" androidTest.java.srcDirs += "blabla bla" prodDebug.java.srcDirs += "blabla bla" mockDebug.java.srcDirs += "blabla bla" prod.java.srcDirs += "blabla bla" testProd.java.srcDirs += "blabla bla" androidTestProd.java.srcDirs += "blabla bla" mock.java.srcDirs += "blabla bla" testMock.java.srcDirs += "blabla bla" androidTestMock.java.srcDirs += "blabla bla" } click "run" in Android Studio : something goes wrong: Error:org.gradle.api.GradleException

How to set proxy server for gradle?

不羁岁月 提交于 2019-12-04 04:24:05
I need to set a proxy server to be able to use gradle from my company's network to download project dependencies.I tried setting the proxy for shell, but it didn't work, so i assume it is because of the commands, gradle using to download these dependencies, does not use http_proxy environment variable. Which commands (like wget , curl ) does gradle use when downloading project dependencies? How can i check these commands? I tried both --info and --debug options, but it only says for each file something like; Download https://jcenter.bintray.com/com/android/tools/lint/lint/25.1.0/lint-25.1.0

IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoIcsImpl;

。_饼干妹妹 提交于 2019-12-04 04:13:39
I'm using Android Studio + gradle on MyProject + Facebook api as a library. See below settings. I've tried removing all references of support-v4 (either r7 or 18.0.0) and replace them with support-v13, but the message with v4 was still present. I've also noticed that support-v4-r7 appears in External libraries, even though it's not referenced at all, anywhere. Would that be the problem ? MyProject build.gradle: buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.5.+' } } apply plugin: 'android' repositories { mavenCentral() maven { url

Gradle task to change a boolean in build config

本秂侑毒 提交于 2019-12-04 04:12:00
I would like to create a very simple task which change a boolean in my gradle config. I work on an Android application which can be run with several profiles, and for each build a need to specify if in my code the app must fake the bluetooth or not. My gradle (relevant code) : def fakeBluetooth = "true" buildTypes { debug { minifyEnabled false signingConfig android.signingConfigs.debug buildConfigField "boolean", "fakeBluetooth", fakeBluetooth } release { minifyEnabled true signingConfig android.signingConfigs.release buildConfigField "boolean", "fakeBluetooth", fakeBluetooth } } task

Manifest merger failed: Attribute application@appComponentFactory

孤者浪人 提交于 2019-12-04 04:05:20
So all good but I'm trying to add this library https://github.com/wdullaer/MaterialDateTimePicker with this implementation 'com.wdullaer:materialdatetimepicker:4.0.1' And suddenly when I sync my Graddle it give me this error Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory). Suggestion: add 'tools:replace="android