build.gradle

zip.ZipException: duplicate entry: annotations/Beta.class

纵饮孤独 提交于 2019-11-28 08:45:34
问题 I have been struggling for more that a day to fix the duplicate entry given when running my android project. Error: Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'.> java.util.zip.ZipException: duplicate entry: com/google/common/annotations/Beta.class I've tried to exclude various modules as well as enable multiDex, and have hit a wall, please help me solve this problem: part of code: compile(project(path: ':k_endpoint', configuration: 'android-endpoints')) { exclude

Error:Could not find property 'assembleDebug' on project ':app'

孤街浪徒 提交于 2019-11-28 08:09:13
I am using 'com.android.tools.build:gradle:2.2.0-alpha6' and Android Studio 2.2 Preview 6. The build runs perfectly fine on Gradle 2.1.0, but to enable instant run it asks me to update Gradle plugin. On updating Gradle plugin, the build shows "Error:Could not find property 'assembleDebug' on project ':app'" . I already tried cleaning .gradle and .idea and reloading the project, but nothing works. Please help. find which task is depending on assembleDebug task changing the following did the trick for me at least: from: task findbugs(type: FindBugs, dependsOn: assembleDebug) to: task findbugs

unknown property 'LibraryVariants' in build.gradle

佐手、 提交于 2019-11-28 07:20:00
问题 I have the error below in build.gradle at this line: apply plugin: 'com.google.gms.google-services' Error:(56, 0) Could not get unknown property 'LibraryVariants' for object of type com.android.build.gradle.LibraryExtension. It happened after I installed Firebase. How to solve this? 回答1: Add the following to the @project level gradle file: classpath 'com.android.tools.build:gradle:1.3.0' classpath 'com.google.gms:google-services:3.0.0' Add the following to the @app level gradle file: //

Android Studio 3.0: buildToolsVersion not found in gradle files

笑着哭i 提交于 2019-11-28 07:16:17
I recently installed new stable version of Android Studio (v3.0). Then created a new project and there was not any problem. But saw there is no buildToolsVersion field in the app-level build.gradle file. Even I searched all project files ( Ctrl Shift F ), but didn't find anything! What does this mean? And how can I determine what is the version of Build Tools in my app module? build.gradle (Project): // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools

Gradle DSL method not found: 'destination()' after update to Gradle 5.2.1

。_饼干妹妹 提交于 2019-11-28 07:09:53
问题 After updating to Gradle 5.2.1 my build is failing with this error: Gradle DSL method not found: 'destination()' I figured out that this error has something todo with my analysis.gradle My analysis.gradle looks like that apply plugin: 'checkstyle' apply plugin: 'pmd' apply plugin: 'jacoco' jacoco { toolVersion = "0.7.7.201606060606" } check.dependsOn 'checkstyle', 'pmd', 'lint' task checkstyle(type: Checkstyle) { println "----- checkstyle -----" configFile file(projectDir.getAbsolutePath() +

Android Studio Build/Clean

冷暖自知 提交于 2019-11-28 06:45:59
In an attempt to compile external jars, I have to use the terminal and do a clean. However, when I go into the root directory of my project and execute gradlew clean I get the following message: -bash: gradlew: command not found Here's a screenshot of my application folder's home directory. Let me know if you need anything else, I'm not sure why this is happening. gradlew is not in your global path. To execute the 'clean' task (or any task for that matter) using the gradle wrapper (gradlew) in your project directory in your terminal, specify the current directory with the './': ./gradlew clean

Gradle 4.0 Unable to find a matching configuration

别等时光非礼了梦想. 提交于 2019-11-28 06:43:14
I am trying to open my existing project in new Android Studio 3.0 canary 2. I updated Gradle according to instructions , changed names for dependency configurations but I continue to get next error: Unable to resolve dependency for ':app@productionRelease/compileClasspath': Could not resolve project : abChat. And in another window: Error:Could not resolve all dependencies for configuration ':bankOK:betaNewApiInnerTestRuntimeClasspath'. > Unable to find a matching configuration in project :abChat: - Configuration 'debugApiElements': - Required apiLvl 'ProductFlavorAttr{name=newApi}' but no

What's the difference between “minifyEnabled” and “useProguard” in the Android Plugin for Gradle?

旧巷老猫 提交于 2019-11-28 06:42:36
I see that the Android Plugin for Gradle has a minifyEnabled property as well as a useProguard property, as follows: android { buildTypes { debug { minifyEnabled true useProguard false } release { minifyEnabled true useProguard true } } } What's the difference between these two properties? Or, rather, what's the meaning of each? Quoting from tools.android.com : Built-in shrinker Version 2.0 of Android Plugin for Gradle ships with an experimental built-in code shrinker, which can be used instead of ProGuard. The built-in shrinker supports fast incremental runs and is meant to speed up iteration

Error converting bytecode to dex: Cause: java.lang.RuntimeException: Exception parsing classes - Android studio 2.0 beta 6

佐手、 提交于 2019-11-28 06:22:51
I updated to the last version of Android studio 2.0 Beta 6 with the gradle : dependencies { classpath 'com.android.tools.build:gradle:2.0.0-beta6' } The app works perfectly fine on emulator and devices I tested every thing and it works fine. I got many errors only when I try to Generate Signed APK, I got some errors in dependencies, all of them solved when i excluded vector drawable, vector animate drawable and Support-v4 library Now i dont have any dependencies error. now my gradle.build for the app module looks like this: apply plugin: 'com.android.application' android { configurations { /

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

天大地大妈咪最大 提交于 2019-11-28 06:16:07
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? cmcginty Add the javadoc or sources classifies as dependencies: dependencies { compile "commons-codec:commons-codec:1.10:sources" compile "commons-codec:commons-codec:1.10:javadoc" } Paul Podgorsek I guess your question is related to a dev workspace, here are links explaining how to add the required configuration in Gradle using the IDEs' plugins: For Eclipse : apply plugin: 'java' apply plugin: 'eclipse' eclipse { classpath { downloadJavadoc = true