{"_id":"590a04f8ed80861900cbc7a8","parentDoc":null,"version":{"_id":"590a04f2ed80861900cbc737","project":"55b2d5baa74a380d00e290c4","__v":4,"createdAt":"2017-05-03T16:27:30.085Z","releaseDate":"2017-05-03T16:27:30.085Z","categories":["590a04f3ed80861900cbc738","590a04f3ed80861900cbc739","590a04f3ed80861900cbc73a","590a04f3ed80861900cbc73b","590a04f3ed80861900cbc73c","590a04f3ed80861900cbc73d","590a04f3ed80861900cbc73e","590a04f3ed80861900cbc73f","590a04f3ed80861900cbc740","590a04f3ed80861900cbc741","590a04f3ed80861900cbc742","590a04f3ed80861900cbc743","590a04f3ed80861900cbc744","590a04f3ed80861900cbc745","590a04f3ed80861900cbc746","590a04f3ed80861900cbc747","590a04f3ed80861900cbc748","590a04f3ed80861900cbc749","590a04f3ed80861900cbc74a","590a04f3ed80861900cbc74b","590a04f3ed80861900cbc74c","590a04f3ed80861900cbc74d","59124949de13f61900336a7a","5914b04e7c2c552d008b7104","5914b47242c6a22300b9dc20"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"7.0.0","version":"7"},"category":{"_id":"590a04f3ed80861900cbc74c","__v":0,"version":"590a04f2ed80861900cbc737","project":"55b2d5baa74a380d00e290c4","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-01-05T19:32:59.974Z","from_sync":false,"order":22,"slug":"troubleshooting","title":"Troubleshooting"},"user":"55b2d5626862a10d00887af9","project":"55b2d5baa74a380d00e290c4","__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-02-25T01:41:09.728Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"# Points to Remember\n* Buddybuild uses linux machines for building Android code. That means that case sensitivity with regards to file paths/file names are fully enforced, and you might notice build failures that you are not able to reproduce locally because you're either using a mac or a windows system.\n\n# Common Errors\n## A problem occurred evaluating project\n\nThere are a few possible causes for the issue:\n\n###build.gradle refers to a file that's not in the repo\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"* What went wrong:\\n     A problem occurred evaluating project ':app'.\\n     > /Users/buddybuild/workspace/signing.properties (No such file or directory)\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nIf you get an error like this, it means the build.gradle refers to a file that is not checked into the repo. To resolve this error, you can use an 'if' condition to avoid the error by checking if the file exists or not:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"if (file(\\\"signing.properties\\\").exists()) {\\n\\tfile('signing.properties').foo;\\n}\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n###The file path is platform dependent\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"* What went wrong:\\n     A problem occurred evaluating project ':app'.\\n     > Cannot convert URL 'C:/Users/Win7/Desktop/keystore.jks' to a file.\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nIf you get an error like this, it typically occurs when your development environment is Windows. All you need to do is to switch to a relative path:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"signingConfigs {\\n  config {\\n    keyAlias 'myalias'\\n    keyPassword 'mykeypassword'\\n    storeFile file('../keystore.jks')\\n    storePassword 'mystorepassword'\\n  }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n##    org.gradle.api.tasks.Sync.getInputs()Lorg/gradle/api/internal/TaskInputsInternal;\n\nThis error generally indicates that the gradle wrapper is misconfigured, please follow the following steps:\n\n\n### 1. Make sure you are using gradle wrapper\n\nA gradle wrapper consists of the following files/directories:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"├── gradlew\\n├── gradle\\n│   └── wrapper\\n│       ├── gradle-wrapper.jar\\n│       └── gradle-wrapper.properties\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\nIf you don't, the following is how to generate a gradle wrapper, and you should commit this into your repository.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"gradle wrapper --gradle-version <gradle_version>\",\n      \"language\": \"text\",\n      \"name\": \"Generating a gradle wrapper\"\n    }\n  ]\n}\n[/block]\n### 2. If you are using gradle wrapper, make sure it matches your gradle plugin\n\nYou can read more about it here: https://developer.android.com/studio/releases/gradle-plugin.html#updating-gradle\n\nFor example, if your gradle plugin version is 2.2.3, make sure the gradle wrapper version is 2.14.1+\n\n### 3. Make sure the gradle-wrapper.jar file is checked in\n\nWe see this fairly frequently, please make sure the gradle-wrapper.jar file is checked in.\n\n## Other Errors\n\n###  Multiple dex files define <x>\n\nThis is almost always due to dependencies dragging in different versions of a shared dependency (quite frequently noticed with com.google.android.gms).\nTo resolve this the following is an example of how to force com.google.android.gms to a specific versionset:\n\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"configurations.all {\\n    resolutionStrategy {\\n        eachDependency { DependencyResolveDetails details ->\\n            if (details.requested.group == 'com.google.android.gms' && details.requested.name.indexOf('play-services') > -1) {\\n                println details.requested.name\\n                details.useVersion('10.0.0')\\n            }\\n        }\\n    }\\n}\",\n      \"language\": \"groovy\"\n    }\n  ]\n}\n[/block]\n### error: Annotation processor '__gen.AnnotationProcessorWrapper.*$AnnotationProcessor' not found\n\nThis is generally caused by some breaking changes introduced with gradle 3.4+ whereby it requires certain changes when using annotation processors with kotlin code.\n\nMore specifically, this is generally caused by a missing \"apply plugin: 'kotlin-kapt'\" at the top of your build.gradle file as indicated in the documentation below:\nhttps://kotlinlang.org/docs/reference/kapt.html\n\nIf you are unable to reproduce this, your issues might be a result of Buddybuild upgrading your version of gradle to a specific version based off your com.android.tools.build version.\n\n### fatal error: '*.h' file not found\nIf this is an ndk build, there can be two reasons behind that error.\n1. The NDK installed on our android boxes is not compatible with your build.\n2. The file path you are referencing in your include is not properly cased to the physical path on the back. You can get away with this on case-insensitive file systems, but you can't get away with this on linux boxes used by Buddybuild.\n\n### com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/common/base/FinalizableReference.class\n\nhttps://stackoverflow.com/questions/44536567/java-util-zip-zipexception-duplicate-entry-com-google-common-base-finalizabler\n\nThis was a bug with google playServices version 11.0.0. Please upgrade to 11.0.1 or greater.","excerpt":"","slug":"android-troubleshooting","type":"basic","title":"Common Android build errors"}

Common Android build errors


# Points to Remember * Buddybuild uses linux machines for building Android code. That means that case sensitivity with regards to file paths/file names are fully enforced, and you might notice build failures that you are not able to reproduce locally because you're either using a mac or a windows system. # Common Errors ## A problem occurred evaluating project There are a few possible causes for the issue: ###build.gradle refers to a file that's not in the repo [block:code] { "codes": [ { "code": "* What went wrong:\n A problem occurred evaluating project ':app'.\n > /Users/buddybuild/workspace/signing.properties (No such file or directory)", "language": "text" } ] } [/block] If you get an error like this, it means the build.gradle refers to a file that is not checked into the repo. To resolve this error, you can use an 'if' condition to avoid the error by checking if the file exists or not: [block:code] { "codes": [ { "code": "if (file(\"signing.properties\").exists()) {\n\tfile('signing.properties').foo;\n}", "language": "text" } ] } [/block] ###The file path is platform dependent [block:code] { "codes": [ { "code": "* What went wrong:\n A problem occurred evaluating project ':app'.\n > Cannot convert URL 'C:/Users/Win7/Desktop/keystore.jks' to a file.", "language": "text" } ] } [/block] If you get an error like this, it typically occurs when your development environment is Windows. All you need to do is to switch to a relative path: [block:code] { "codes": [ { "code": "signingConfigs {\n config {\n keyAlias 'myalias'\n keyPassword 'mykeypassword'\n storeFile file('../keystore.jks')\n storePassword 'mystorepassword'\n }\n}", "language": "json" } ] } [/block] ## org.gradle.api.tasks.Sync.getInputs()Lorg/gradle/api/internal/TaskInputsInternal; This error generally indicates that the gradle wrapper is misconfigured, please follow the following steps: ### 1. Make sure you are using gradle wrapper A gradle wrapper consists of the following files/directories: [block:code] { "codes": [ { "code": "├── gradlew\n├── gradle\n│   └── wrapper\n│   ├── gradle-wrapper.jar\n│   └── gradle-wrapper.properties", "language": "shell" } ] } [/block] If you don't, the following is how to generate a gradle wrapper, and you should commit this into your repository. [block:code] { "codes": [ { "code": "gradle wrapper --gradle-version <gradle_version>", "language": "text", "name": "Generating a gradle wrapper" } ] } [/block] ### 2. If you are using gradle wrapper, make sure it matches your gradle plugin You can read more about it here: https://developer.android.com/studio/releases/gradle-plugin.html#updating-gradle For example, if your gradle plugin version is 2.2.3, make sure the gradle wrapper version is 2.14.1+ ### 3. Make sure the gradle-wrapper.jar file is checked in We see this fairly frequently, please make sure the gradle-wrapper.jar file is checked in. ## Other Errors ### Multiple dex files define <x> This is almost always due to dependencies dragging in different versions of a shared dependency (quite frequently noticed with com.google.android.gms). To resolve this the following is an example of how to force com.google.android.gms to a specific versionset: [block:code] { "codes": [ { "code": "configurations.all {\n resolutionStrategy {\n eachDependency { DependencyResolveDetails details ->\n if (details.requested.group == 'com.google.android.gms' && details.requested.name.indexOf('play-services') > -1) {\n println details.requested.name\n details.useVersion('10.0.0')\n }\n }\n }\n}", "language": "groovy" } ] } [/block] ### error: Annotation processor '__gen.AnnotationProcessorWrapper.*$AnnotationProcessor' not found This is generally caused by some breaking changes introduced with gradle 3.4+ whereby it requires certain changes when using annotation processors with kotlin code. More specifically, this is generally caused by a missing "apply plugin: 'kotlin-kapt'" at the top of your build.gradle file as indicated in the documentation below: https://kotlinlang.org/docs/reference/kapt.html If you are unable to reproduce this, your issues might be a result of Buddybuild upgrading your version of gradle to a specific version based off your com.android.tools.build version. ### fatal error: '*.h' file not found If this is an ndk build, there can be two reasons behind that error. 1. The NDK installed on our android boxes is not compatible with your build. 2. The file path you are referencing in your include is not properly cased to the physical path on the back. You can get away with this on case-insensitive file systems, but you can't get away with this on linux boxes used by Buddybuild. ### com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/common/base/FinalizableReference.class https://stackoverflow.com/questions/44536567/java-util-zip-zipexception-duplicate-entry-com-google-common-base-finalizabler This was a bug with google playServices version 11.0.0. Please upgrade to 11.0.1 or greater.