build.gradle

Configuration with name 'compileClasspath' not found

夙愿已清 提交于 2019-12-03 11:17:06
When I migrate to com.android.tools.build:gradle:3.0.0-beta3 and Gradle 4.1, I am seeing the following error: Caused by: org.gradle.api.artifacts.UnknownConfigurationException: Configuration with name 'compileClasspath' not found. at org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer.createNotFoundException(DefaultConfigurationContainer.java:123) at org.gradle.api.internal.DefaultNamedDomainObjectCollection.getByName(DefaultNamedDomainObjectCollection.java:229) at org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer.getByName

Error: failed to find target with hash string 'android-21'

限于喜欢 提交于 2019-12-03 11:11:07
I want to change my compileSdkVersion from 23 to 21.So I have made following changes in the build.gradle but I am getting following error.How can I resolve this? failed to find target with hash string 'android-21' apply plugin: 'com.android.application' android { compileSdkVersion 21 buildToolsVersion "21.1.2" defaultConfig { applicationId "com.example.shalabh.fly" minSdkVersion 14 targetSdkVersion 21 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile

Shadow Plugin Gradle: What does mergeServiceFiles() do?

醉酒当歌 提交于 2019-12-03 10:38:30
In my build.gradle file I need to add the line: shadowJar { mergeServiceFiles() } Otherwise the jar does not run properly. I wonder what this line does exactly? I use the Gradle plugin in Eclipse Luna. I create the jar on one Java project which depends on another one. Opal mergeServiceFiles is declared exactly here and its implementation is as follows: /** * Syntactic sugar for merging service files in JARs * @return */ public ShadowJar mergeServiceFiles() { try { transform(ServiceFileTransformer.class); } catch (IllegalAccessException e) { } catch (InstantiationException e) { } return this; }

Executing commands with Gradle?

假如想象 提交于 2019-12-03 10:34:34
I am trying to execute a command with gradle with the below task: task stopServer(dependsOn: war, type: Exec) << { commandLine 'pkill -9 tomcat' } When I run it I get the following error: * What went wrong: Execution failed for task ':stopServer'. > execCommand == null! And when my task is like this: task stopServer(dependsOn: war) << { exec { commandLine 'pkill -9 tomcat' } } I get this error: * What went wrong: Execution failed for task ':stopServer'. > A problem occurred starting process 'command 'pkill -9 tomcat'' Can you tell me where I am going wrong in each of these approaches? If

use latest snapshot version from the remote repo

南楼画角 提交于 2019-12-03 10:28:01
For now, I should to specify version explicitly: dependencies { compile 'projGroup:projName:0.1-SNAPSHOT' } What's I've tried, but it doesn't work: compile "projGroup:projName:0.+-SNAPSHOT" compile "projGroup:projName:+" How can I tell gradle to use latest snapsot version from the remote maven repo? Verified with Gradle 2.2.1: Override default 24h module caching in Gradle: configurations.all { resolutionStrategy.cacheChangingModulesFor 0, 'seconds' } Then, latest.integration will work with each Maven snapshot: dependencies { compile 'projGroup:projName:latest.integration' } compile "projGroup

Module … is not backed by gradle

别来无恙 提交于 2019-12-03 10:20:58
问题 I'm using IntelliJ IDEA Pro 13.1.2. Never used any versions below 13. When trying to run build.gradle from IDE I get the message: Module is not backed by gradle I can run this script from the command line just fine. The "root" directory has both .gradle and gradle sub-directories and, in general its structure is very similar to another module from the same project where I can run its build from IDE without problems. Any suggestions on further troubleshooting? 回答1: If you didn't set up the IDE

How to make Grade release build fail using Lint Option StopShip?

ぃ、小莉子 提交于 2019-12-03 10:10:47
问题 I've read a lot about the StopShip Android Lint Check and Gradle support for it http://tools.android.com/tips/lint-checks http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Lint-support http://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.LintOptions.html#com.android.build.gradle.internal.dsl.LintOptions:checkReleaseBuilds Android lint enable checks with gradle gradle build fails on lint task http://developer.android.com/tools/help/lint.html

Android Studio - How to make modules inside a subdirectory?

旧时模样 提交于 2019-12-03 08:35:50
问题 Suppose that I had 3 modules: mod1, mod2 and mod3. In normal case, the file system hierarchy should be: [android_root_dir] build.gradle # list this file just to make it clear. ----mod1 ----mod2 ----mod3 But what I want is: [android_root_dir] build.gradle # list this file just to make it clear. ----modules ----mod1 ----mod2 ----mod3 how to do it in Android Studio 1.1.0? PS: I find this article but it does not seem to work, or it works for earlier versions of AS, not 1.1.0: How can I move a

Spring Boot multi module project with Gradle doesn't build

☆樱花仙子☆ 提交于 2019-12-03 07:01:26
问题 I'm working on a Spring Boot app with multiple modules and we're using Gradle to build it. Unfortunately I can't get the Gradle configuration right. The project structure is this: parent | + build.gradle | + settings.gradle | + core | | | + build.gradle | + apis | | | + build.gradle | + services | | | + build.gradle | + data | | | + build.gradle When I try to build the project, I get compilation errors like error: cannot find symbol saying, that the classes from data used in services aren't

How to exclude certain files from Android Studio gradle builds?

那年仲夏 提交于 2019-12-03 06:22:32
I am using Android Studio with Google Drive, which makes hidden system files visible (such as Icon and desktop.ini ), causing errors, as described here . Rather than run scripts to delete these files, I'd like to instruct gradle 2.14 to ignore them. In an attempt to figure out how to exclude files, I created files named "excludeme.txt" in the directories \app\src\main\res\values and in \app\src\main\java\com\hfad\stopwatch\ . I unsuccessfully tried various modifications to the two build.gradle files in my project. None successfully excluded the file. Specifically, I made the following