build.gradle

Execution failed for task: ':app:preDexDebug'

随声附和 提交于 2019-12-01 00:36:37
问题 I am experiencing that famous ':app:preDexDebug'-error. First of all: Cleaning the project or rebuilding it works without errors. Under default settings I set the project bytecode version to 1.7 and under SDK Location in the project structure the JDK location seems to be correct, too. After a while of researching I still did not find the solution for this problem. The error occurs when I try to run the project under Android Studio. Like mentioned before, cleaning, rebuilding and syncing with

DexArchiveMergerException: Unable to merge dex

淺唱寂寞╮ 提交于 2019-12-01 00:31:25
Just after updating Android studio 3.0 yesterday from 2.3.3 version, I am facing issue related to DexMergerException. Someone else also posted question-related to this . But in this question, I want to analyze the stack trace to find the related solution(since i am newbiew here..). I am unable to resolve it even after excluding group that might be using it. Since I am not aware of which component colliding with HttpCore so I'd use this code to exclude httpCore: implementation ('com.android.volley:volley:1.0.0') { exclude group: 'org.apache.httpcomponents' } Please check the Terminal logcat

Execution failed for task ':app:dexDebug' Android Studio

六眼飞鱼酱① 提交于 2019-11-30 23:36:06
问题 The application was able to execute before updating my android studio,this is the error I am getting: Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_25\bin\java.exe'' finished with non-zero exit value 1 回答1: If you have support-v4 and support-v7 (with different version) in build.gradle then add this line into your build.gradle at top. configurations

could not get unknown property for 'applicationVariants' for BuildType_Decorated

痞子三分冷 提交于 2019-11-30 22:59:20
问题 I have imported the module in my project and its correctly imported. But i am getting this error. i have imported the Scanner control app module (By zebra). I have searched for many alternated solutions, but it's not working out. Error:(36, 0) Could not get unknown property 'applicationVariants' for BuildType_Decorated{name=release, debuggable=false, testCoverageEnabled=false, jniDebuggable=false, pseudoLocalesEnabled=false, renderscriptDebuggable=false, renderscriptOptimLevel=3,

Error after upgrade Google Play Services to 11.0.0 version

隐身守侯 提交于 2019-11-30 22:39:59
问题 I have a strange issue. After uploading Google Play Services library from version 10.2.6 to version 11.0.0, when i try to compile I get this error: Error:Execution failed for task ':app:processDebugGoogleServices'. Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 11.0.0.

How to configure the order of libraries in the classpath for Android Studio?

▼魔方 西西 提交于 2019-11-30 22:06:24
问题 I would like to change the order of libraries in the classpath for Android Studio. I am trying to run unit tests with JUnit 4 from within the IDE . This works following the instruction in these slides. I wonder if it is possible to configure the order of the libraries - other then suggested in the slides - via the Run Configuration of Android Studio? The first attempt was to change the order of dependencies in the Project Structure dialog in the Dependency tab of the project module as show in

Gradle 3.0.0 alpha variant output issue

会有一股神秘感。 提交于 2019-11-30 21:36:55
I want to have a different versionCode for debug build type rather than the one in release build type. This used to work by using the configuration from below in Gradle Android plugin v2.3.2 (Gradle v3.3), but doesn't have any effect now in v3.0.0-alpha5 (Gradle v4.1-milestone-1). Any ideas as to what changed in the newest Gradle plugin that makes it ignore the variant.mergedFlavor.versionCode attribute? buildTypes { debug { applicationIdSuffix ".debug" versionNameSuffix "-" + buildTime() android.applicationVariants.all { variant -> if (variant.buildType.name != buildTypes.debug.name) return

Using Proguard to remove unused classes in Google Play Services library

╄→гoц情女王★ 提交于 2019-11-30 20:25:30
I'm trying to get rid of unused classes from Google Play Services library. I've created brand new android project with single empty activity. The project does not use anything from Google Play Services library. So I would expect, that when I build release (which includes running proguard in my configuration) I will see no difference in binary size comparing building with/without play-services dependency. But actually, I see ~700 KB difference in apk size. I've found relatively complex solution, using gradle script , which involves repacking play-services.jar file. Also, this solution requires

How to build a runnable ShadowJar with a gradle script Kotlin build file?

99封情书 提交于 2019-11-30 19:38:12
Simplest possible Kotlin hello world for gradle script Kotlin : thufir@dur:~/github/gradleScriptKotlin$ thufir@dur:~/github/gradleScriptKotlin$ gradle clean shadowJar;java -jar build/libs/gradleScriptKotlin.jar > Task :compileKotlin Using Kotlin incremental compilation > Task :shadowJar A problem was found with the configuration of task ':shadowJar'. Registering invalid inputs and outputs via TaskInputs and TaskOutputs methods has been deprecated and is scheduled to be removed in Gradle 5.0. - No value has been specified for property 'mainClassName'. The SimpleWorkResult type has been

How do I import a class in gradle outside of build.gradle in a apply from: file

喜夏-厌秋 提交于 2019-11-30 19:29:18
I am having a wired issue I am using gradle 1.9 I cannot seem to import a class from outside build.gradle The following works build.gradle buildscript { repositories { mavenLocal() } dependencies { classpath(group: 'com.foo', name: 'gradle-local-eureka', version: '1.0-SNAPSHOT') } } import com.foo.my.awesome.package.AwesomeService The following errors out build.gradle buildscript { repositories { mavenLocal() } dependencies { classpath(group: 'com.foo', name: 'gradle-local-eureka', version: '1.0-SNAPSHOT') } } apply from: file('gradle/foo.gradle') foo.gradle import com.foo.my.awesome.package