build.gradle

Issue in gradle 2.1.0 : Application launches with delay of 5-6 seconds

走远了吗. 提交于 2019-12-10 18:31:59
问题 I have an application which was working fine with gradle 1.5.0. Application use to launch instantly after gradle build. But when I changed the gradle to gradle 2.1.0 it launches with a delay of 5-6 seconds for first time after gradle build. I have tested with some of my other apps also in those apps also same issue persists. Then I changed the gradle version back to gradle 1.5.0 then again my app started working fine without any delay. So, it seems like there is an issue with gradle 2.1.0.

How does Gradle's configurations hierarchy work?

…衆ロ難τιáo~ 提交于 2019-12-10 18:28:08
问题 I know there are four basic configurations, compile, runtime, testCompile, and testRuntime. If I put in a dependency like this: runtime group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.3' This means this dependency is available under runtime and compile, correct? But what about testCompile and testRuntime? Is it available for these configurations as well? If I add my own configuration, do I have to specify where it exists in the hierarchy? What happens if I don't? The

Gradle project refresh failed - Protocol family unavailable

江枫思渺然 提交于 2019-12-10 17:56:39
问题 This morning I've updated from SVN my Android project, added some new lines of code and tested: everything work fine. A couple of minutes later I've tried to run again the application on my device but now Android Studio tells me: Gradle 'iSfa' project refres failed Error: protocol family unavailable The content of build.gradle is: apply plugin: 'com.android.application' android { compileSdkVersion 19 buildToolsVersion '19.1.0' packagingOptions { exclude 'LICENSE' exclude 'NOTICE' exclude

Task with name 'mockableAndroidJar' not found in project ':app'

匆匆过客 提交于 2019-12-10 17:55:35
问题 after changing gradle android plugin version to 3.2.1 classpath 'com.android.tools.build:gradle:3.2.1' I received such build error: Task with name 'mockableAndroidJar' not found in project ':app'. Invalidate cache and restart doesn't help 回答1: Happened to me too, fixed by upgrading Android Studio to version 3.2.1 Seems like they've changed the gradle task name from mockableAndroidJar to createMockableJar 来源: https://stackoverflow.com/questions/53048368/task-with-name-mockableandroidjar-not

Executing gradle build tasks in custom tasks

╄→гoц情女王★ 提交于 2019-12-10 17:54:55
问题 I have a custom task in gradle Called release and I want this task to execute the clean and build tasks: task release { //do something clean build } I know it is possible to call tasks from command line like gradle build release But I want to know wether it is possible to execute build tasks within custom tasks? 回答1: You can simply use 'finalizedBy' feature either by configure it inside 'release' task: task release { finalizedBy clean, build // Do some stuff } or configure it after 'release'

Could not find method implementation() for arguments

南楼画角 提交于 2019-12-10 17:25:20
问题 I try to run my app, but gradle doesn`t want to compose it. Can you tell me what should I do ? Error:(36, 0) Could not find method implementation() for arguments [com.google.firebase:firebase-appindexing:11.6.2] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. My app build.gradle file minSdkVersion 14 targetSdkVersion 22 signingConfig signingConfigs.config } buildTypes { release { debuggable false minifyEnabled false proguardFiles

Gradle sync failed: Plugin with id 'com.google.android.gms:play-services' not found

倾然丶 夕夏残阳落幕 提交于 2019-12-10 16:39:54
问题 In one of my projects I need to use GoogleMaps and Firebase for notifications but the libraries of the service and the Firebase in place do not want to work. buildscript { repositories { google() maven { url 'https://maven.google.com/' name 'Google' } } dependencies { classpath 'com.google.android.gms:play-services:8.4.0' classpath 'com.android.tools.build:gradle:3.0.1' } } allprojects { repositories { jcenter() } } buildscript { repositories { maven { url 'https://maven.fabric.io/public' } }

Deploying multiple build variants at a time - Android studio gradle

最后都变了- 提交于 2019-12-10 15:57:50
问题 I recently discovered this awesome feature about gradle productFlavors. I currently have 3 variants (staging, sandbox and production) and I can deploy one of the variants at a time using build variant panel. Is there a way I can deploy all variants at a time? 回答1: Yes, In Android Studio, open the "Gradle Tasks" tab, which is usually on the right. You will see many tasks that start with 'assemble', double click on one of those. For example, double clicking on 'assembleRelease' will create all

Gradle dependency json-simple error

心已入冬 提交于 2019-12-10 14:53:23
问题 I'm fairly new to Gradle so I'm trying to build a Java project and not sure about the dependencies. I have never gotten Gradle configured to be able to do my tests or now a jar file to compile and run. My build.gradle : apply plugin: 'java' apply plugin: 'maven' repositories { jcenter() } dependencies { compile 'org.slf4j:slf4j-api:1.7.25' compile 'org.json:json:20160212' testCompile 'junit:junit:4.12' } And this is what I get on the console stating that it doesn't see my import: error:

Gradle Autoincrement and Rename APK I/O Error

好久不见. 提交于 2019-12-10 14:46:25
问题 I'm trying to do an auto increment for the build number in Android Studio. Followed this link, and it worksfine. Now I want to rename the apk using the versionName. I also did that successfully, as I can see in my app\build\outputs\apk directory, that the file is there. The problem The generated apk and the part where Android Studio you see the "local path" don't have the same file name. The generated apk's name: MyAppsName-v1.0-64-debug.apk The "local path" it's looking for: ..\app\build