FAQ Database Discussion Community


Application not starting from expected class in manifest

java,android,android-studio,android-manifest,build.gradle
I'm totally new with Android Studio and I'm trying to port a working project I had in Eclipse ADT. It's an app (ArchPanoViewer) which depends on two libraries: Zxing _which is "captureActivity" in the _ and PanoramaGL "lib_panorama". The scope of the app is to show a dialog window at...

How can I solve “Local path doesn't exist.” error in Android Studio?

java,android,android-studio,build.gradle
I created a new project in Android Studio 1.1 and I built successfully. After that, I added a jar libraries and updated build.gradle file dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:21.0.3' compile files('libs/commons-logging-1.1.1.jar') compile files('libs/google-api-client-1.18.0-rc.jar') compile files('libs/google-api-client-android-1.18.0-rc.jar') compile files('libs/google-api-client-appengine-1.18.0-rc.jar') compile files('libs/google-api-client-gson-1.18.0-rc.jar')...

Is there a way to tell Gradle to include dependencies Javadocs in generated Javadocs?

java,groovy,gradle,javadoc,build.gradle
I have a Java project that I am managing with Gradle. Such project will be composed by multiple small libraries, which are developed independently one another, and a "leaf" project whose goal is just to depend on the latest stable version of each library, package everything in a fat Jar...

Calling Ant Macrodef from Gradle

ant,gradle,build.gradle,macrodef
I can't seem to find a way to list and/or call an Ant Macrodef from within my Gradle script. The Gradle User Guide talks about Macrodefs but does not provide an example anywehere. Could anyone tell me how to accomplish this? At the moment I import the Ant build by...

Using both Application and Distribution plugin in gradle

gradle,build.gradle
When using the distributions plugin I had the following code in order to set up the folder structure in the distribution output. Now however I have to use the 'application' plugin. 1. Can these two plugins be used together? (complains about tasks with identical names) 2. If not, how does...

Gradle Build Failure

android,android-gradle,release,build.gradle
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...

Gradle | Spring boot dependencies are not excluding

spring,gradle,log4j,spring-boot,build.gradle
I'm trying to get log4j to work in a project that I'm working on. I added the relevant log4j dependencies in build.gradle and excluded the Spring boot starter logging so it can work. This worked fine when I used Maven as the build tool, but once I switched to Gradle...

Generate JAXB episode file with Gradle anttask

ant,gradle,jaxb,build.gradle
I set up a gradle task to generate java classes from XSD files: ant.taskdef(name: 'xjc', classname: 'com.sun.tools.xjc.XJCTask', classpath: configurations.jaxb.asPath) ant.jaxbTargetDir = jaxbTargetDir ant.xjc(destdir: '${jaxbTargetDir}', package: 'com.example') { schema(dir:'/home/bruckwald/proj/schema/xsd', includes: '*.xsd') } How can I pass the argument -episode my.episode to the ant task so that the episode file will be...

spring boot using logback-test.xml instead of logback.xml

gradle,spring-boot,slf4j,logback,build.gradle
I have a gradle project and the structure looks like this > > main (one project) > shared (another project) > api >> shared2 (another project) main project depends on both shared and shared2 projects. Both shared and shared2 projects have a logback-test.xml in their src/test/resources folder and the main...

MultiDex issue - Execution failed for task ':app:dexDebug'

android,google-api,google-calendar,android-gradle,build.gradle
I face a problem while adding a line for Google Calendar API to build.gradle. Here is the error: UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]:65536 at com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:502) at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:277) at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:491) at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:168) at...

multiple maven repositories for gradle

maven,gradle,build.gradle
If I have multiple maven repositories specified in a gradle build, I am expecting that if gradle cannot find a dependency in one of the repositories it should just try the other ones. Instead, it fails on the first repository (internal company nexus repo) for a dependency that does not...

Gradle task to change a boolean in build config

android,android-gradle,build.gradle
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....

Gradle error: Could not find org.apache.httpcomponents:httpclient-android:4.3.5.1

maven,android-studio,gradle,android-gradle,build.gradle
I'm trying do use the Apache httpclient for Android in my Gradle project and I don't understand why I get this error when running ./gradle build: Could not find org.apache.httpcomponents:httpclient-android:4.3.5.1. My top-level build.gradle contains: // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript {...

Design Support Library v22.2 “UNEXPECTED-TOP-LEVEL EXCEPTION”

android,gradle,android-support-library,build.gradle,android-design-library
I decided to use some cool stuff Google just released in their support design library. Everythyng goes fine when I import the library and when I sync the project with Gradle files. But it gives me an error when I compile the project. I don't know if i have too...

How to download javadocs and sources for jar using Gradle 2.0?

gradle,build.gradle
I am using Gradle 2.0. What should I write in build.gradle so that the javadocs and sources are also downloaded along with the jars?

How do I specify default values for gradle custom task inputs

gradle,build.gradle
I've got a custom gradle task that looks a bit like this: task foo(type:FooTask) { in file('foo.in') out file('foo.out') } class FooTask extends DefaultTask { @InputFile File in @OutputFile File out @TaskAction def doTheFoo() { // Do stuff with in and write to out } } This is great, but...

Gradle :app:preDexDebug error Android Studio Project

android,android-studio,android-gradle,build.gradle
I'm writing an app with Android platform, In my app im using some external jars, due to some errors connected with version of common codecs in android SDK I had to change one of functions in external jar like here Apache Commons Codec with Android: could not find method and...

How to access .java files from a directory outside of a package in android-studio?

android,android-studio,gradle,build.gradle
I try to solve this problem for hours now and didn't find a solution on the internet. my project looks like this: I want to access the files in the marked directory in the de.MayerhoferSimon.Vertretungsplan package. (yes, I know packages should be lowercase.) Is this possible and when yes, how?...

~/.gradle/gradle.properties file not being read

gradle,build.gradle
There is a similar question here: Gradle properties not being read from ~/.gradle/gradle.properties but it does not solve my problem. It seems to me that gradle is NOT reading my ~/.gradle/gradle.properties file. I have a gradle.properties file in ~/.gradle, and it has properties needed to sign artifacts before uploading to...

android gradle build set class attribute value

android,android-studio,android-gradle,build.gradle
I want to set attribute values in my Application class from the build.gradle file like for example: MyApplication.URL = "someurl.com" that should be determined per build, I tried : productFlavors { myApp { qualified.package.path.MyApplication.URL = "someurl.com" } } but it failed...

Best practice for buildscript tag in build.gradle of library projects

android,android-gradle,build.gradle,android-library
I'm wondering what is the best / intended way of defining build script repositories and dependencies for Android library projects. Out in the wild (like Github) most of the repos define the following in there build.gradle buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.0.0' } } But if...

Why does gradle task block on executing python script that spawns a process?

python,gradle,build.gradle,gradlew
I encountered an issue running a python script from a gradle task. Short version Why does a gradle task that executes a python script, where the python scripts spawns a process, seems to block? Long version Background info I created three python scripts. start.py: Spawns 2 processes, which are not...

How to make dependency transitive in Gradle

maven,javamail,android-gradle,build.gradle,gmail-api
I have downloaded javax.mail-api-1.5.3.jar file copied into app/libs folder and then right click , add as library. Then following line appears under dependency compile files('libs/javax.mail-api-1.5.3.jar') I want to make this dependency transitive.Because I have mention javax.mail-api library dependencies in pom.xml file like follows. <dependencies> <dependency> <groupId>javax.mail</groupId> <artifactId>javax.mail-api</artifactId> <version>1.5.3</version> <scope>test</scope>...

How to fix this gradle app:dexDebug error?

android,build.gradle
im using android studio,now in my app i have this error when i run my app Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.internal.LoggedErrorException: Failed to run command: /home/noob/android-sdk-linux/build-tools/21.1.2/dx --dex --no-optimize --output /home/noob/Desktop/NavigationDrawer/app/build/intermediates/dex/debug --input- list=/home/noob/Desktop/NavigationDrawer/app/build/intermediates/tmp/dex/debu g/inputList.txt Error Code: 2 Output: UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException:...

Gradle: Common Zip task for every subproject

gradle,build.gradle,multi-project
I have a multi-project gradle build, where all subprojects of root project have common zip task. They should zip some source, depending of the subproject's settings. First, I configured it in parent build.gradle: subprojects { subproject -> apply plugin: 'java' ... task submission(type: Zip) { destinationDir = subproject.buildDir archiveName =...

Android Studio: link to external module?

android,gradle,android-studio,build.gradle
I am using Android Studio 1.0.1, loving it so far. The only issue that I have is I would like to make my project depend on an external module. If I add a module to my project, the entire module source gets copied. This obviously jeopardise the very concept of...

Findbugs android gradle plugin

android,android-gradle,build.gradle,findbugs,gradlew
I have an android project. I want to introduce findbugs in my project as a gradle plugin. I tried to edit the project's build.gradle as below. buildscript { repositories { mavenCentral() maven { url 'https://maven.fabric.io/public' } } dependencies { classpath 'com.android.tools.build:gradle:1.0.0+' classpath 'io.fabric.tools:gradle:1.+' } } apply plugin: "java" apply plugin:...

How to compile JAR for the SuperSLiM library?

android,xamarin,android-gradle,build.gradle,superslim
I'm an android newbie, and would like to create a jar file for this library: https://github.com/TonicArtos/SuperSLiM I've read some other online answers which say that the gradle build file has to be modified, which I tried to do, but not sure if I did it correctly: How to create a...

gradle multiple jars from multiple folders

gradle,build.gradle
i have a project layout like sample/                A/                   src/                      main/                         java/                            A.java     ...

Issue with gradle flavor with folder name for custom src folder

android,android-gradle,build.gradle
I am having a requirement where i am having 4 flavor and each of this flavor there are group of two flavor have common source code while they are different only by one specific parameter defined in buildConfigField. Issuse i am facing is that while i am creating build for...

Gradle with Flavors configuration

android,android-studio,gradle,build.gradle
I read a lot of posts here e couldn't find a way to do it, what i want is define the "res" for debug per flavor, like: + src + main + java + res + flavor1 + release + res + debug + res + flavor2 + release +...

Gradle Multiple Maven Repo

gradle,build.gradle
I added a dependency to my build.gradle: spring-data-neo4j It requires neo4j-cypher-dsl-2.0.1.jar/pom, which is only located in the repo: https://repo1.maven.org/maven2/. However as per the output below gradle never looks at this repo for the artifact. How can I get gradle to search this repo as well. //build.gradle buildscript { repositories {...

Error:Configuration with name 'default' not found when trying to import project as library into Android Studio

android,android-studio,android-gradle,build.gradle,build-error
I checked all the other threads about this topic but couldn't find an answer. I am trying to import the Twoway View Project as a library into Android Studio. Both projects run fine on their own but I always get the same Gradle Error: Error:Configuration with name 'default' not found...

Gradle resolve ext properties in depedencies for multi-project

gradle,build.gradle,multi-project
I have the following multi-project structure (only the important parts are shown): - project - build.gradle (file) - settings.gradle (file) + module1 (dir) + module2 (dir) build.gradle: ext { groovyMajorVersion = 2.4 groovyMinorVersion = 3 } subprojects { dependencies { testCompile 'org.codehaus.groovy:groovy-all:${groovyMajorVersion}.${groovyMinorVersion}' testCompile 'org.spockframework:spock-core:1.0-groovy-${groovyMajorVersion}' } } settings.gradle: include 'module1', 'module2'...

Android - Only execute Gradle task on release build variant

android,android-gradle,build.gradle
I am trying to configure my build.gradle file to only execute a gradle task when the release build variant is selected. So far, my task always gets executed, whether it is in my debug or release build types or signing configs. I have tried adding my task inside an applicationsVariants...

Unable to build, nor clean a naked single activity project in a newly installed Android studio

android,android-studio,android-gradle,build.gradle
I've recently installed the newest stable version of Android Studio, on my Ubuntu 14.04 LTS. SDK been configured properly. I created a single 'Activity' project from the blank Activity template, and made no changes to it. When trying to build, or clean I get sporadically the followi: Failed to complete...

Error:(19, 0) Gradle DSL method not found: 'android()'

android,build.gradle
Android Studio is giving this error while compiling the project. I have searched and found that this may happen because of android Block in top of the build.gradle.But in my build.gradle it may be not the problam. here is my gradle files. build.gradle // Top-level build file where you can...

Gradle error : Could not find method maybeCreate() for arguments [victims] on configuration container

gradle,build.gradle
I am getting error while configuring victims plugin in build.gradle. Gradle version is 2.0. buildscript { repositories { mavenRepo url: "http://xxxxx.xxx.xxx.xxx/content/groups/public/" } dependencies { classpath 'com.xxxx.xxx.crm:gradle-plugins:1.3.5' } } apply plugin: 'victims' victims { fingerprint = 'fatal' updates = 'auto' } Error is : Could not find method maybeCreate() for arguments...

gradle this tasks reference

gradle,build.gradle
I would like to move some extra code to closure and call it in the scope of task, how to do it? I have something like, and it works fine task AwesomeTest(type: Test) { filter { setIncludePatterns(filtered as String[]) } } but would like to have something like (of course...

exclude specific version of jar or module file?

android,android-studio,gradle,android-gradle,build.gradle
/* * there is duplicate rocon_app_manager_msgs: v0.6.9 and 0.7.8 * common_tools must have v0.7.8 * robot_remocon must have 0.6.9. * so here is a solution, that robot_remocon compile: * exclude rocon_app_manager_msgs v0.7.8 only for this project. */ compile 'org.ros.rosjava_messages:rocon_app_manager_msgs:[0.6,0.7)' compile project(':common_tools') i want to exclude specific version of rocon_app_manager_msgs, 0.7.8v...

Changed build.gradle now can't install app delete faild internal error

java,android,gradle,android-gradle,build.gradle
I changed my gradles compileSdkVersion from 21 to 22 and forgot about it, a day later I plugged my phone in and wanted to debug my app, after trying to install once i get this message: Installation failed since the device possibly has stale dexed jars that don't match the...

Error:(10, 0) gradle method not found classpath()

android,facebook,gradle,android-gradle,build.gradle
Hello i'm newbie with Android studio , i imported facebook as, and first i got this error Error:(111) Cannot call getBootClasspath() before setTargetInfo() is called. and i followed the right answer here. i.e i changed my depencies from dependencies { compile 'com.android.support:support-v4:[21,22)' compile 'com.parse.bolts:bolts-android:1.1.4' } to dependencies { classpath 'com.android.tools.build:gradle:1.1.3'...

build.gradle file error in Android Studio can't applied main & dependencies

android,android-studio,build.gradle
I have problem with Android Studio in build.gradel after I convert Eclipse project to Android Studio project. I spend more that 2 hours without hope to find solution !! build.gradel code: apply plugin: 'android' dependencies { compile fileTree(dir: 'libs', include: '*.jar') } android { compileSdkVersion 19 buildToolsVersion "17.0.0" sourceSets {...

Cannot resolve symbol 'AndroidJUnit4'

android,gradle,dependencies,build.gradle,android-uiautomator
Obviously I need the correct import statment to solve this problem. According to the docs for AndroidJUnit4, this should be import android.support.test.runner.AndroidJUnit4; When I do that, Android Studio highlights runner in red and complains "Cannot resolve symbol 'runner'". Background I got to this point by following the tutorials on the...

Why do packages from library module does not exist upon compilation, even when Android Studio shows no errors in code?

java,android,android-studio,android-gradle,build.gradle
I have a library module (AndEngine) inside my libs/AndEngine folder. The code from that compiles fine. In my root settings.gradle file I have this : include ':app:libs:AndEngine' include ':app' And then in my app's build.gradle file I have this in dependencies: compile project('libs:AndEngine') INside my app's code, all of the...

AAR class library stored in bintray doesn't link to the extended class

android,android-gradle,build.gradle,aar,bintray
I created an Android library made by a class named WordUtils2 which extends the Java class WordUtils. The entire project can be found in github here: https://github.com/dequadelisonz/WordUtils2 I also published the generated aar file into BinTray so to be able to use it through Gradle in other Android projects. The...

Android Studio - Upgrading to Java 7

java,android,build.gradle
I have the following snippet to put into my build.gradle file to use Java 7, but I have 3 seperate build.gradle files and I'm unsure which one to use. The 3 are listed below 1) Project: project name 2) Module Library 3) Module Sample Snippet to put in build.gradle android...

Build failed after updating SDK tools and plays services libraries

android,gradle,android-gradle,build.gradle
Hi I've currently updated my SDK tools as well as the other components of my SDK except for the M-preview and the sample files which is currently I won't be using. Now problem is after updating the libraries and syncing the gradle it gives me this error: error: Attribute "track"...

Error: Could not find or load main class cucumber.api.cli.Main

java,intellij-idea,gradle,cucumber,build.gradle
I try to run this gradle task task runCucumber(type: JavaExec) { main = "cucumber.api.cli.Main" args += ['-f', 'html:build/reports/cucumber/', '-f', 'json:build/reports/cucumber/report.json', '--glue', 'com.waze.testing.cucumber', 'src/main/resources/features' , '--tags', '[email protected]', '--tags', '[email protected]', '--tags', '@advil'] systemProperties['http.keepAlive'] = 'false' systemProperties['http.maxRedirects'] = '20' ignoreExitValue = true } and get this error: Error: Could not find or load...

Use Ant task from salesforce-ant.jar in gradle script

ant,gradle,task,build.gradle,build.xml
I have the following task definition in build.xml <taskdef resource="com/salesforce/antlib.xml" uri="antlib:com.salesforce"> <classpath> <pathelement location="${env.ANT_HOME}/lib/ant-salesforce.jar" /> </classpath> </taskdef> I want to import its in gradle script. I used following task definition in build.gradle // ant-salesforce.jar in buil folder repositories { flatDir { dirs '.' } } configurations { antSf } dependencies...

Gradle. Can't build simple Android Project

android,gradle,android-gradle,build.gradle
I have starting to learn a Gradle and try to make a first build.gradle file println 'Build start.' buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.4' } } println 'Current gradle version : '+gradle.gradleVersion apply plugin: 'android' dependencies { compile fileTree(dir: 'libs', include: '*.jar') } android { compileSdkVersion...

Task is always up to date

gradle,build.gradle
I've got a gradle build with a task like the following task createFolders { file(rootFolder).mkDirs() } Note that in the real system there are about 15 folders getting created during this task. This task always reports as UP-TO-DATE when I run the task, even if I run it directly after...

How to use flavors with different app names in Android studio?

android,android-studio,android-gradle,build.gradle,android-productflavors
In my app-level build.gradle I have the following flavors: productFlavors { originalFlavour{ } freeFlavour{ } } The thing is building both flavors I get the same App Name. Instead I would like to have different app names for each flavors. Just adding a suffix would be useful. Hope someone could...

Gradle multi-project build

spring,gradle,build.gradle
I have the following project structure: my-project +my-project-data +my-project-service +my-project-example Where each of these my-project-data, my-project-service, my-project-examples are defined as sub project to my-project in settings.gradle file. Of course, my-project-services has a dependency to my-project-data. And my-project-examples has a dependencies to my-project-data and my-project service. In the project my-project-examples I...

Install gradle on Mac

osx,build,gradle,build.gradle
It took me more than 2 seconds to find a direct answer so I'm posting it here so others will find it fast enough: How do I install gradle for Mac?...

How to import barcodescanner project from GitHub to Eclipse

java,android,eclipse,android-gradle,build.gradle
I found this project in GitHub ClickHere: I want to import it from GitHub to eclipse. I downloaded zip and unzip. I already had gradle and grdale plugin in eclipse. I create local.properties file in root directory of project barcodescanner-master with path to android-sdk. In cmd from root directory of...

gradle maven plugin - how to customise maven upload's archive name

maven,gradle,maven-plugin,build.gradle
In a gradle script, I am able to customise the name of a built WAR archive by adding the following line: war.archiveName = "${war.baseName}##${war.version}.${war.extension}" This line would cause a generated WAR to be named something like this: project-name##1.0.1.war instead of project-name-1.0.1.war However, when the WAR file is then uploaded to...

How to make Android Studio 1.1 call generateDebugTestSources instead of assembleDebugTest during “Make” instruction?

android,gradle,android-gradle,build.gradle
I have a project with 1,000+ tests running fine with Robolectric. After switching to Android Studio 1.1 when I go to "Run" -> "All Tests" during the "Make" instruction Android Studio calls Gradle's assembleDebugTest instead of generateDebugTestSources .. In my case this makes the build system to start dexing and...

How can we remove the current date from gradle generated .html and .xml file while running JMeter script from build.gradle file?

gradle,jmeter,build.gradle
I am running my JMeter script from build.gradle file. After executing it is generating the html and xml report files with the script name. My problem is that current date is also present with the script name. Please tell me how to remove the current date from output files. Gradle-...

mockito in gradle not working for java project

java,intellij-idea,gradle,mockito,build.gradle
I have a basic java project and I want to run tests using Mockito (since I use it at work and it's easy). So I referred to this link and added the following to my build.gradle dependencies { testCompile 'junit:junit:4.11' testCompile "org.mockito:mockito-core:1.+" } Even though I think mavenCentral() should be...

How can I use gradle Integration for eclipse and how can I create build.gradle in eclipse

android,gradle,build.gradle,gradle-eclipse
I downloaded the gradle plugin from eclipse market place. but can't able to create built.gradle in my project. For downloading the plugin I use this link http://dist.springsource.com/release/TOOLS/update/e4.4/. From this link I specifically select Core/Eclipse integration for gradle and downloaded the plugin. After that I don't know how to use built.gradle...

Android tests build error: Multiple dex files define Landroid/support/test/BuildConfig

java,android,android-gradle,build.gradle,android-espresso
I'm trying to add Espresso 2 to my project (which also has lots of other dependencies), but I'm hitting this error when trying to run tests: UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define Landroid/support/test/BuildConfig; at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596) at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554) at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535) ... The non-test build works fine. Does anybody have...

Android studio gradle flavor dimensions build varients not working correctly

android-studio,gradle,android-gradle,build.gradle,android-productflavors
I have two dimensions of an app, call then green and blue. There will only be these two dimensions but an unlimited number of product flavors. This is the way I'm setting it up in gradle flavorDimensions "green", "blue" productFlavors { one { applicationId "com.app.green.one" versionCode 1 versionName "1.0.0.1"; flavorDimension...

Gradle exception while building GraniteDS project

java,gradle,build.gradle,graniteds
Good day, everyone. I'm trying to build GraniteDS project locally: https://github.com/graniteds/graniteds but when I try to build it I'm facing: org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'graniteds-master'. at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:76) at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl$1.run(DefaultScriptPluginFactory.java:148) at...

Android Studio - No resource found that matches the given name

android,android-resources,build.gradle
I am developing an app in Android Studio, I used the Android Asset Studio to make the launcher icon, and then I tried to Copy/Paste the new icon to overwrite the default one (like I always did in Eclipse) and nothing happens, so what I did was changing the name...

Understanding different variants of declaring a task in Gradle

android-studio,gradle,task,android-gradle,build.gradle
There are two different variants of declaring a task in Gradle. 1. task myTask() {} 2. task task3 << {} To test how they behave, I´ve created a sample android project apply plugin: 'com.android.application' android { compileSdkVersion 22 buildToolsVersion "21.1.2" defaultConfig { applicationId "com.android.gradletest" minSdkVersion 15 targetSdkVersion 22 versionCode 1...

determine if it is jenkins environment inside gradle

jenkins,gradle,jenkins-plugins,build.gradle
I am just wondering is it possible that I can tell whether I am in a Jenkins environment inside gradle? I just want to do something like if (jenkins){ //do something }else{ //do other } ...

'export' is not recognized as an internal or external command,

java,gradle,javafx,javafx-8,build.gradle
I am trying to run the convertJavaFXToAndroid from the Ensemble8 sample from the dalvik sdk, but unfortunately it throws an error saying: C:\dalvik-sdk\samples\Ensemble8>convertJavaFXToAndroid.bat C:\dalvik-sdk\samples\Ensemble8>#!/bin/bash '#!' is not recognized as an internal or external command, operable program or batch file. C:\dalvik-sdk\samples\Ensemble8># Modify the line below, point the ANDROID_SDK t o the...

How to define a function at android.defaultConfig level?

android,groovy,android-gradle,build.gradle,buildconfig
In my Android project in build.gradle use the following instructions to create build config fields. android { defaultConfig { if (project.hasProperty('serverOnePath')) { buildConfigField "String", "SERVER_ONE_PATH", "\"${serverOnePath}\"" } if (project.hasProperty('serverTwoPath')) { buildConfigField "String", "SERVER_TWO_PATH", "\"${serverTwoPath}\"" } } } The properties therefore must be defined in gradle.properties as such: serverOnePath=http://example1.com/path serverTwoPath=http://example2.com/path I...

NoClassDefFound after Gradle and Android Studio upgrade

android,android-studio,noclassdeffounderror,build.gradle,android-multidex
Since I upgraded Android Studio, I was kinda forced to moving on Gradle's version, buildToolsVersion, and java's version to 7. And my problem is that I can actually run the project on Android Lollipop perfectly, but I lost compatibility backwards, I'm not able to run application on devices prior API...

How do I get different icons for the two versions of my GPS app generated via gradle build variants?

java,android,android-studio,build.gradle
I want to have ONE Android Studio (AS) 1.1.0 project create TWO APK files: one for pay version and one for free version of my Google Play Store (GPS) app. Using gradle build variants ("flavors"). I'm VERY close. I have uploaded from one AS project both versions--free and pay. The...

Depend gradle build on google maps only

android,google-maps,gradle,build.gradle
My project depends on maps. So I have compile 'com.google.android.gms:play-services-maps:7.0.0' in my build.gradle file. But gradle downloads all the play services, including fitness, games, wallet, etc. How to depend just on map and it's dependencies, but not the whole play-services?

gradle execute task after build

gradle,build.gradle
I am using the build in gradle. My build.gradle file like this: project('a'){ apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'application' buildDir = 'build' [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' repositories { mavenCentral() } dependencies { compile 'org.slf4j:slf4j-api:1.7.7' } } When I input the gradle build in the command, I want...

Gradle retrofit failed to resolve

android,android-studio,gradle,build.gradle
This is my first time trying to use gradle with an android project. I would like to add retrofit to my project but it keeps telling me. Failed to resolve: com.squareup.retrofit:retrofit:1.9.0 Failed to resolve: com.squareup.okhttp:2.2.0 However google play services works perfectly. My gradle file is as follows: apply plugin: 'com.android.application'...

Aidl is missing error

android,android-gradle,build.gradle
I want to try out android m preview in my app. I have downloaded the latest build tools and the m platform. I have included this in my build.gradle file (of module app) : compileSdkVersion 'android-MNC' buildToolsVersion '23.0.0 rc2' In the project build.gradle file, I have included this in my...

Using War plugin but without creating an archive

gradle,war,build.gradle
I'm trying to get Gradle to handle the deployment of a very large Web application. In the past when we used Ant, instead of creating a very large .war file, we would simply assemble all the code in one folder--libraries, .jsp's etc--and then scp them to the deployment destination. This...

How to add Android Studio plugin as dependency in Gradle?

android-studio,gradle,testng,android-gradle,build.gradle
I installed the TestNG plugin through Android Studio. On my filesystem the following files were installed: C:\Program Files\Android\Android Studio\plugins\testng\lib\testng.jar C:\Program Files\Android\Android Studio\plugins\testng\lib\testng-plugin.jar C:\Program Files\Android\Android Studio\plugins\testng\lib\resources_en.jar C:\Program Files\Android\Android Studio\gradle\gradle-2.2.1\lib\plugins\testng-6.3.1.jar I added the the TestNG dependency to the build.gradle of my Module--not "Project": dependencies { compile fileTree(dir:...

UNEXPECTED TOP-LEVEL EXCEPTION when adding play-services

android,google-play-services,build.gradle
I have a project where I need to use the Google play service libary. But when I add it to my dependencies i get the following error: UNEXPECTED TOP-LEVEL EXCEPTION Error:Execution failed for task ':app:dexDebug'. com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\Eclipse\adt-bundle-windows-x86_64-20140702\sdk\build-tools\21.1.2\dx.bat --dex --no-optimize --output C:\Users\Reigstad\Documents\secret-tyrion-android\Tyrion\app\build\intermediates\dex\debug...

Android Studio : UNEXPECTED TOP-LEVEL EXCEPTION:

java,android,android-studio,android-gradle,build.gradle
How Can I solve this error Error:Execution failed for task ':app:dexDebug'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2 App Build.gradle apply plugin: 'com.android.application' android { compileSdkVersion 22 buildToolsVersion "22.0.1" packagingOptions { exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/ASL2.0' exclude 'META-INF/NOTICE' exclude...

Gradle get file collection of parent directories

java,gradle,build.gradle
I'm trying to configure a task that will generate a single report from a collection of binary junit test results, but I'm unable to create a FileCollection containing the paths in which all the result files are located. My task is defined like this task aggregateTestREports(type: org.gradle.api.tasks.tests.TestSupport) { destinationDir =...

Android Studio Multiple dex files define Lcom/abc/xyz/BuildConfig

android,android-studio,android-gradle,build.gradle
i am newbie to Android Studio, every time when try to Run my app, face the exception Error:Execution failed for task ':abc:dexDebug'. com.android.ide.common.internal.LoggedErrorException: Failed to run command: /home/nik/Installs/adt-bundle-linux-x86_64-20140702/sdk/build-tools/21.1.2/dx --dex --no-optimize --output /home/nik/workspace/androidstudio/abc/build/intermediates/dex/debug --input-list=/home/nik/workspace/androidstudio/abc/build/intermediates/tmp/dex/debug/inputList.txt Error Code: 2 Output: UNEXPECTED TOP-LEVEL EXCEPTION:...

Add Classpath in Manifest file of jar in gradle

gradle,build.gradle,gradlew
Below is my gradle script and I need to add the data in MANIFEST.MF of jar file in below format I tried the below method but not able to achieve it. i need it in below way. I am using the gradle 2.3 apply plugin: 'java' sourceCompatibility = 1.7 jar.doFirst...

Gradle Compilation Errors when adding 'com.amazonaws:aws-java-sdk:1.10.1'

java,amazon-web-services,android-studio,build.gradle
I am running Android Studio and my app has been running perfect until I do the following. When I add "compile 'com.amazonaws:aws-java-sdk:1.10.1'" to my gradle file, I get the following warnings when I do a project re-build. Warning:Dependency commons-logging:commons-logging:1.1.3 is ignored for debug as it may be conflicting with the...

Java XMPP clint with smack 4.1 NoClassDefFoundError:

eclipse,maven,gradle,build.gradle,smack
I am trying to write XMPP Clint using smack 4.1.1. I have added smack jar files into build path. I am using eclipse IDE to write the code. However, when I am trying to run application I get NoClassDefFoundErrors. I fixed some of these errors adding xpp3, jxmpp and minidns...

Warning about an Android Library project gradle dependencies

android,android-studio,gradle,android-gradle,build.gradle
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...

How can I get a project in netbeans using the gradle plugin to find native libraries?

java,netbeans,gradle,build.gradle,jogl
I am trying to figure out gradle and the netbeans plugin. I have easily been able to put together simple projects, but when trying to convert a project that uses JOGL to gradle I have run into problems. I can get it to compile, but when I try to get...

Compiler doesn't see new method name - build issue but run time error. “java.lang.IllegalStateException: Could not find a method”

android,methods,runtime-error,android-gradle,build.gradle
I created a new Activity class from an existing class by creating it in the usual way and then cut and pasted code from my ScanActivity.class because the new class was going to be very similar. The new class is SenderActivity2.class. I also changed the XML onClick handler to have...

Gradle build error with Simpleframework

gradle,dependencies,android-gradle,build.gradle,simple-framework
I upload my library module to jcenter and I use this module with my application project. I try to build my application it returns an error. I searched this issue and This issue is due to be aware of what simpleframework. I have to use this library both My library...

GVM installed gradle is not recognized in Linux terminal

gradle,build.gradle,griffon
Recently installed gradle via gvm and $ gradle build throws the following error message. If 'gradle' is not a typo you can use command-not-found to lookup the package that contains it, like this: cnf gradle Obviously, class path issues, So I have tried echo $GRADLE_HOME outputs /home/karthikeyan/.gvm/gradle/current But the actual...

Issue building project on Android Studio - support-v4

android,gradle,android-gradle,build.gradle
I'm having trouble running and building apk's on my Android studio Project, I'm searching and searching but can't find any suitable solution for my problem. Gradle console stacktrace: trouble writing output: D:\android-sdk-windows\Shairlook-Def-git\app\build\intermediates\pre-dexed\debug\internal_impl-22.0.0-f0c61aa475a654ffa9a9c544ec7d938bf31cfae2.jar (El sistema no puede encontrar la ruta especificada) FAILED FAILURE: Build failed with an exception. * What went...

Get resource file in multi-module Google AppEngine

java,google-app-engine,build.gradle
I'm following this doc: https://cloud.google.com/appengine/docs/java/config/appconfig#Static_Files_and_Resource_Files to setup a specific resources files location like so: appengine-web.xml: <resource-files> <include path="/resources/*" /> </resource-files> Now, I need to get the resource file outside of a servlet context. So, I'm trying to get the file with: InputStream jsonResource = new FileInputStream("default/WEB-INF/resources/" + resourceName); This runs...

Failed to resolve com.melnykov:floatingactionbutton:1.3.0 in gradle

android,android-studio,gradle,android-gradle,build.gradle
I apologize if I am missing something obvious, but I recently converted my project from Eclipse to Android Studio (and Gradle) and am trying to add support for Floating Action Buttons using Melnykov's library, but Gradle cannot resolve it. I thought it was a simple matter of adding compile 'com.melnykov:floatingactionbutton:1.3.0'...

Build Failure on Android Studio

android,compilation,compiler-errors,android-gradle,build.gradle
After updating all the Google support libraries to the latest versions, from v21 to v22.2.0 and Play Services to v7.5, my project no longer builds successfully. The log i get is as follows: app:preDexDebug AGPBI: {"kind":"simple","text":"Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar ","sources":[{}]} AGPBI: {"kind":"simple","text":"Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar ","sources":[{}]} AGPBI: {"kind":"simple","text":"Picked up JAVA_TOOL_OPTIONS:...

Maven site in gradle

gradle,build.gradle
Is there a plugin in gradle which can generate maven site similar thing? It would be great if it was compatible with current maven site apt format file.

ProcessException: ExecException: Process 'command ' /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Content/Home/bin/java

java,android,android-studio,android-gradle,build.gradle
I am getting exception: Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2 after i updated the Google Play services to 7.5.0 as: compile 'com.google.android.gms:play-services:7.5.0' but if i change it back to: compile 'com.google.android.gms:play-services:7.0.0' everything is working fine, i am also facing...

How can I add something to the productFlavors which I can read from java code

android,android-gradle,build.gradle,android-productflavors
I was trying to build multiple apks with different channel names, and I need to read the channel name in my java code. So I'm trying to work with productFlavors, currently what I'm trying to do is add the following code to my build.gradle productFlavors { GooglePlay { } Amazon...

Android studio add unwanted permission after running application on real device

android,android-studio,build.gradle,android-permissions
After running application on device application required unwanted location permission that is not mention in manifest file. while when i am running same code from my friend Android studio than its run normal without extra permission required. manifest file <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="21" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission...

Gradle does nothing on distZip task from distribution plugin

gradle,build.gradle
I have a Problem with the distribution Plugin of Gradle. I just want to use the plugin to bundle all my files together (jar's, shell-scripts, ...). Here my build.gradle: apply plugin: 'eclipse' apply plugin: 'maven-publish' apply plugin: 'distribution' sourceCompatibility = 1.7 targetCompatibility = 1.7 publishing { ... } repositories {...