build.gradle

Warning about an Android Library project gradle dependencies

眉间皱痕 提交于 2019-12-25 04:17:44
问题 I am building an Android Library project using Android Studio. The type of the module is 'com.android.library' in gradle.build file. This module has a number of dependencies: dependencies { compile 'com.squareup.retrofit:retrofit:1.9.0' compile 'com.squareup.okhttp:okhttp:2.3.0' } The module builds result in a .aar file. I want the user of the .aar file to be notified/warned about .aar dependencies so his project doesn't successfully builds till these dependencies are set inside his project.

Gradle Kotlin: Could not find net.sf.saxon:saxon-HE:9.9.0-2

穿精又带淫゛_ 提交于 2019-12-25 02:46:11
问题 Saxon doesn't seem to be where gradle is trying to send it: Not Found For request 'GET /artifact/net/sf/saxon/saxon-HE/9.9.0-2/saxon-HE-9.9.0-2.pom' The actual URL is, or looks to be, ../artifact/net.sf.saxon/.. rather than ..artifact/net/saxon.. which causes a problem. How do I tell the kotlin-gradle-dsl , specifically, which repo to look in and how to look in that repo? kotlin build file: // https://mvnrepository.com/artifact/net.sf.saxon/Saxon-HE compile group: 'net.sf.saxon', name: 'Saxon

Separate androidTest sourceSet for different buildType NOT build flavor

会有一股神秘感。 提交于 2019-12-25 02:33:16
问题 I have android library project and in it I have defined 3 build types: debug, release and integration. I would like to have additinal androidTest (instrumentation test) directory and additional source directory for integration build type. I have successfully added source directory: ' my-project/src/integration ' but have failed to add androidTestIntegration directory, android studio is not detecting it in Android project view. Project build.gradle file: android { ... debug { ... } release { .

How to edit external library for android studio 3.1.2?

感情迁移 提交于 2019-12-25 02:26:12
问题 I'm trying to edit a external library base of answers in here, but it's not working on android studio 3.1.2(which it's the version i'm using). Base on what people said, i should get library from github, import module. I want to change digits of this Elegant Button library. So what i did was I've downloaded this library with download/zip, then File > new > Import Module and did some configuration and decencies and still it's not working. looks like these method won't work with new version of

Could not find method srcDirs() for arguments on SourceSet container of type org.gradle.api.internal.tasks.DefaultSourceSetContainer

橙三吉。 提交于 2019-12-24 21:05:59
问题 I'm trying to compile my Kotlin app and set of Kotlin libraries to JavaScript. I've got that working well, but when I try to run it, it can't find kotlin.js. To remedy this, I tried changing my build.gradle to be more like this example on GitHub. In mine, I defined source sets like this: (which works but doesn't output kotlin.js ) sourceSets { main { kotlin { srcDirs 'src/main/kotlin' } } } to something like this: (which doesn't even sync) sourceSets { main.kotlin.srcDirs += "src/main/kotlin"

Best way to add dependency for Wire using Gradle in Android Studio

杀马特。学长 韩版系。学妹 提交于 2019-12-24 19:28:11
问题 I'm using Square's Wire library for my Android app, using Android Studio with Gradle. I originally added the wire-runtime-1.2.0.jar into a libs folder in my module, and added the dependency to Gradle like this in my build.gradle file: dependencies { compile fileTree(dir: 'libs', include: '*.jar') } That worked fine. I'm new to Gradle and Android Studio, but based on the way I'm depending on the Google Support and Play Services libraries, I thought I might be able to remove the wire-runtime-1

Gradle - Dependency Substitution not working in a plugin

痴心易碎 提交于 2019-12-24 16:06:57
问题 I'm having some trouble with Gradle plugins. I'm trying to do dependency substitution inside a plugin, and the result is different than when I'm doing the substitution in the build.gradle file. I have Project1 which is dependent on Project2. In Project2, I have a class named AClass which I'm using in Project1. I then want to substitute the module org.example:Project2:1.0 with the project :Project2 . So, in build.gradle , I put the following code: task updateDependency { configurations.all {

Gradle builds but does not run android project

有些话、适合烂在心里 提交于 2019-12-24 15:21:34
问题 If I do Clean Project or Build Project everything works fine. But if I try to run the android app, then I get the errors. Also the App-Engine portion runs fine. So only the android portion causes problems My app is an AppEngine Connected Android Project, with Endpoints Gradle file apply plugin: 'com.android.application' 

android {
 compileSdkVersion 23
 buildToolsVersion "23.0.0" 

 defaultConfig { 
 applicationId "com.mycompany.app.android"
 minSdkVersion 14 
 targetSdkVersion 23


Pass list of Strings to gradle task property without using parentheses

一个人想着一个人 提交于 2019-12-24 13:26:34
问题 I have a build.gradle like so, with a tiny little custom task: task ListOfStrings(type: ExampleTask, description: 'Prove we can pass string list without parentheses') { TheList ('one', 'two', 'three') // this works but it's not beautiful } public class ExampleTask extends DefaultTask { public void TheList(String... theStrings) { theStrings.each { println it } } } In the test.testLogging block is events : and we can pass a comma-separated list of strings without parentheses . test { outputs

How to configure UglifyJS with Gradle?

为君一笑 提交于 2019-12-24 13:23:43
问题 Are there any ready-to-use Gradle plugins to use for UglifyJs? We are trying to configure Uglify something similar to what has been done here, but the owner of that project seems to have his own private artifactory to which he points to, thereby getting access to UglifyAntTask, which is a github-hosted project not following Gradle/Maven etc. (basically non-managed) JAR. We tried downloading this JAR to our project and tried configuring using the options suggested in gradle page as follows: