build.gradle

How to enable Java 8 language features in Android studio

。_饼干妹妹 提交于 2019-12-05 11:29:23
Now release with Android Studio 2.4 Preview 4, it is now support Java 8 language features . Jack is no longer required, and need to disable Jack to use the improved Java 8 support built into the default toolchain. Now we need to disable Jack and switch to the default toolchain. How enable Java 8 features to use in android studio project? Enable Java 8 Support : To start using supported Java 8 language features, update the Android plugin to 2.4.0-alpha4 (or higher) and add the following to your module’s build.gradle file: android { ... compileOptions { sourceCompatibility JavaVersion.VERSION_1

Android Annotations could not find AndroidManifest.xml

淺唱寂寞╮ 提交于 2019-12-05 10:47:06
I've checked a few different questions, but none of them provided a solution which worked for me. I'm developing a project with Android Annotations, and when I attempt to build my project it fails with the following error (Project_Location is simply my local project folder): error: Could not find the AndroidManifest.xml file in specified path : [/Project_Location/mobile/build/intermediates/manifests/full/debug/AndroidManifest.xml] Here is my mobile build.gradle file: apply plugin: 'com.android.application' ext.androidAnnotationsVersion = '3.3.2'; ext.eventBusVersion = '2.4.0'; buildscript {

set applicationIdSuffix depending on productFlavor

有些话、适合烂在心里 提交于 2019-12-05 10:41:59
We have 2 productFlavors ( testServer, liveServer ) and 2 build types ( debug, release). Due to existing API keys, I have to append package names based on buildType + productFlavor. For example something like: buildTypes { debug { applicationIdSuffix '.dbg' + (testServer ? '.test' : '.live') } release { applicationidSuffix '' + (testServer ? '.test') } } is this possible? how? productFlavors { testServer { applicationId = "com.example.my.pkg.test" } liveServer { applicationId = "com.example.my.pkg.live" } } buildTypes { debug { applicationIdSuffix ".debug" } } For more information, take a look

How do I download my Gradle project external dependencies to a specific folder?

夙愿已清 提交于 2019-12-05 10:31:56
I want to download my dependencies to a specific folder in my build as part of my build process e.g. build/lib . I can't find documentation which shows how to do this, I'm sure there is a straightforward way to do it that I'm missing. My current(shortened) build.gradle is the following. The project compiles and executes test correctly. apply plugin: 'java' apply plugin: 'maven-publish' repositories { mavenCentral() } dependencies { compile( 'aopalliance:aopalliance:1.0', 'log4j:log4j:1.2.17', 'batik:batik-svg-dom:1.6-1') } } I dont know if you tried this, but see if this works task copyToLib

Could not find com.android.tools.build:gradle:3.0.0 [duplicate]

故事扮演 提交于 2019-12-05 10:06:45
问题 This question already has answers here : Could not find com.android.tools.build:gradle:3.0.0-alpha1 in circle ci (13 answers) Closed 2 years ago . When I try to build may Android project from command line, I get following error messages: A problem occurred configuring project ':mylib'. Could not resolve all files for configuration ':mylib:classpath'. Could not find com.android.tools.build:gradle:3.0.0. Searched in the following locations: https://jcenter.bintray.com/com/android/tools/build

Gradle duplicate entry error: META-INF/MANIFEST.MF (Or how to delete a file from jar)

故事扮演 提交于 2019-12-05 09:40:10
I've cloned a github repository because I wanted to study the code, but when I tried to build it in Android Studio, I ran into some trouble. After adding the google maven repository (as prompted by Android Studio) and updating both the Gradle Plugin Version and the Grade Version (to 3.5.2 and to 5.4.1, respectively), the build fails because of the following error: Cause: duplicate entry: META-INF/MANIFEST.MF And this, to be more specific: Caused by: java.util.zip.ZipException: duplicate entry: META-INF/MANIFEST.MF Here is my project level build.gradle file: buildscript { repositories { jcenter

I get only app-release-unaligned.apk when I press generate signed apk

人走茶凉 提交于 2019-12-05 08:48:29
I always get "app-release-unaligned.apk". I can't get "app-release.apk". But before I've updated Android SDK, I can get both "app-release.apk" and "app-release-unaligned.apk" after pressing Build->Generate Signed Apk... System Mac OS. Android Studio 1.5.1. Android SDK Tools 25.1.1. Android SDK Platform-tools 23.1. Android SDK Build-tools 23.0.3. I found the similar problem on Android Developer Tools Google Plus UPD1 I've used cmd to align my apk. Because I could not publish my application to google play. zipalign -v 4 your_project_name-unaligned.apk your_project_name.apk . app-release.apk file

Intellij Idea log GradleConnectionException: Could not execute build using Gradle installation while building

五迷三道 提交于 2019-12-05 08:40:16
I use Intellij Idea 13.1.1 and I get GradleConnectionException while building: Error:org.gradle.tooling.GradleConnectionException: Could not execute build using Gradle installation 'C:\Users\<USER_NAME>\.gradle\wrapper\dists\gradle-1.10-all\6vpvhqu0efs1fqmqr2decq1v12\gradle-1.10'.: Could not execute build using Gradle installation 'C:\Users\<USER_NAME>\.gradle\wrapper\dists\gradle-1.10-all\6vpvhqu0efs1fqmqr2decq1v12\gradle-1.10'. I've seen similar question here and googled it. But it didn't help me. In the end I found Idea's buld log and this is the exception with more details from there

Failed to find: com.android.support:support-v4:22.2.0

做~自己de王妃 提交于 2019-12-05 07:27:56
I am trying to do an application but there seems to be some error with the gradle files now. It was working fine until I upgraded the support libraries. I was working with api 21 which worked fine, but then i upgraded to api22 and changed the gradle files accordingly.. Now this error shows up. Error:Failed to find: com.android.support:support-v4:22.2.0 This is my current gradle file : apply plugin: 'com.android.application' android { compileSdkVersion 22 buildToolsVersion "22.0.1" defaultConfig { applicationId "com.example.sampleapp" minSdkVersion 12 targetSdkVersion 22 versionCode 1

Build gradle : Could not find method packagingOptions() for arguments root Project “fasterDev”

女生的网名这么多〃 提交于 2019-12-05 07:22:29
I am using single build.gradle file in application. Regarding version 1.6 it's working properly. but I want to use this for location update with module. apply plugin: 'com.android.application' ... dependencies { compile 'com.google.android.gms:play-services:fp9.0.0' } Here is my build.gradle. build.gradle buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:2.1.0' } } apply plugin: 'android' dependencies { compile fileTree(dir: 'libs', include: '*.jar') } android { compileSdkVersion 15 buildToolsVersion "21.1.2" sourceSets { main { manifest