android-gradle

What is the purpose of Gradle?

感情迁移 提交于 2019-11-28 17:30:21
I could use a little help understanding the concepts behind Gradle(plugin v 0.7) in the context of Android Studio 0.4.0. I have not used Gradle before and it's causing me nothing but problems. I'm not seeing its purpose/benefit because I don't know enough about it. Some specific questions I have What are these dependencies? I'm making a simple app with a navigation drawer, targeted to API 11+ where it should be natively supported. What dependencies could I be using? What is a Gradle wrapper? What changes, if any, does it make to the completed application? Why does Gradle need to be online

Error:Unexpected lock protocol found in lock file. Expected 3, found 0

拜拜、爱过 提交于 2019-11-28 17:10:28
After upgrading Android Studio to 1.3, I can't compile my project anymore. I am getting Unexpected lock protocol found in lock file. Expected 3, found 0. . I have tried with deleting my .gradle folder but that does not solve the problem. Anything else I can do? I have solved it by deleting the folder c: \ users \ [myusername] \ .gradle \ caches \ 2.14.1 After reopening Android studio it was all fine okay here's very lightweight solution with steps: Ctrl+Alt+Shift+S or File->Project Structure Select Project from left panel Now check your Gradle Version at right panel In my case my Gradle

Android Studio: Unregistered VCS root detected

大城市里の小女人 提交于 2019-11-28 17:09:00
Unregistered VCS root detected The directory /Users/*****/AndroidStudioProjects/Signin/google-services is under Git, but is not registered in the Settings. Add root Configure Ignore How to resolve this? Please help. Press "add root" when the warning message appears. This will make idea register the "unregistered vcs root", and you can use the git features of IDEA/Android studio. Nothing bad will happen if you do not press "add root", but I suspect you will get the same warning on each startup of android studio/IDEA. You are able to ignore that warning if you are not interested in using Android

Unable to see dependency tree with gradlew OR gradle

笑着哭i 提交于 2019-11-28 16:57:24
I'm running the latest release of gradle (1.12). In the project's root directory, I run the following command, which as described in this answer by @CommonsWare should give the dependency tree: When I run it, this happens: $ gradle -q dependencies ------------------------------------------------------------ Root project ------------------------------------------------------------ No configurations The project in question is an Android gradle project created from scratch using the new project wizard built in with Android Studio. My top-level build.gradle file looks like this: buildscript {

Jacoco and Unit Tests Code Coverage with android-gradle-plugin >= 1.1

柔情痞子 提交于 2019-11-28 16:51:02
I recently started integrating android-gradle-plugin 1.1.0 in one of my projects. The project uses robolectric 2.4 to run unit tests. It's a multi module project with very complex dependencies (Some modules depend on other modules). Something like that: --> application-module (dependsOn: module1, module2, module-core) --> module1 (dependsOn: module-core) --> module2 (dependsOn: module-core) --> module-core (dependsOn: module3, module4) --> module3 (library dependencies) --> module4 (library dependencies) For a more cleared picture please see jacoco-example project. I tried to integrate JaCoCo

DexException: Cannot merge new index 65536 into a non-jumbo instruction

只愿长相守 提交于 2019-11-28 16:36:40
For some unknown reason my app suddenly won't build from Android Studio. I'm keep getting > com.android.ide.common.internal.LoggedErrorException: Failed to run command: /home/martynas/android-sdk/build-tools/19.1.0/dx --dex --num-threads=4 --output ... ... ... Error Code: 2 Output: UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Cannot merge new index 65536 into a non-jumbo instruction! While the same application is built successfully from command line. I've checked method references count and it's way below the dreaded 64k. I'm using AS 0.8.11 now. Haresh Chhelana Try to add

How to manage different support library versions for 3rd party deps with gradle?

▼魔方 西西 提交于 2019-11-28 16:31:26
I have a bunch of third party libs that I include in my base application. I cannot control the support library those 3rd party modules include. This makes it hard to have the same version of the android support library in my application. I know using gradle when I can exclude certain libraries from each dependency: compile('com.test:lib1:1.0.0') { exclude group: 'com.android.support' } However there are a ton of support libraries and excluding them all for each one of my 3rd party libraries seems like overkill. Is there a better way? Reading this blog post: https://www.devsbedevin.com/android

It is currently in use by another Gradle instance

大城市里の小女人 提交于 2019-11-28 16:29:07
I'm new to Gradle build system. I want to do some basic functions on it. I'm running/building it in command line. I am referring User guide . And, doing some simple tasks. When I start to run simple tasks, it was build successfully. But, After some times, it is showing "It is currently in use by another Gradle instance" and becomes BUILD FAILED . I'm using a terminal for run the task. I didn't run anything at that time. If I closed the terminal which generate the error, this problem would be solved. But, I know that it is not the solution for that. Why is this error coming frequently? How to

Gradle error: Write access is allowed from event dispatch thread only in Android Studio

二次信任 提交于 2019-11-28 16:08:16
After updating Android Studio to version 2.2 (on Windows 10) and somehow next morning I received such error when gradle built on any project: Write access is allowed from event dispatch thread only Despite that gradlew -build command worked and completed successfully. I tried typical Android dev's of WTF repairing set: clean build, invalidate caches, removing build folders, removing .gradle folder, tried different gradle settings, even reinstalling Android Studio and nothing helped. I've created this question only to share my experience with community, because I wasted two hours on it. Beloo

What's the difference between buildscript and allprojects in build.gradle?

守給你的承諾、 提交于 2019-11-28 15:50:43
On a multi-project gradle build, can someone tell me what exactly is the difference between the "allprojects" section and the "buildscript" one? Both have a repositories and dependencies task. Is allprojects for my project? What about buildscript ? buildscript { repositories { ... } dependencies { ... } } and allprojects(subprojects) { repositories { ... } dependencies { ... } } AndroidGuy The " buildscript " configuration section is for gradle itself (i.e. changes to how gradle is able to perform the build). So this section will usually include the Android Gradle plugin. The " allprojects "