build.gradle

What is the syntax for writing comments in build.gradle file?

谁都会走 提交于 2019-12-03 02:08:14
问题 Looking down this build.gradle file apply plugin: 'com.android.application' android { compileSdkVersion 21 buildToolsVersion "21.1.2" defaultConfig { applicationId "package.myapp" minSdkVersion 19 targetSdkVersion 21 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.nineoldandroids:library:2.4.0' }

ext in buildscript can not be recognised by Gradle Kotlin DSL

只谈情不闲聊 提交于 2019-12-03 01:24:21
In these days, I am trying to write some codes to experience the Spring reactive features and kotlin extension in Spring 5, and I also prepared a gradle Kotlin DSL build.gradle.kt to configure the gradle build. The build.gradle.kt is converted from Spring Boot template codes generated by http://start.spring.io . But the ext in the buildscript can not be detected by Gradle. buildscript { ext { } } The ext will cause Gradle build error. To make the variables in classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") and compile("org.jetbrains.kotlin:kotlin-stdlib-jre8:

IntelliJ IDEA and Gradle - Cannot be applied to '(groovy.lang.Closure)'

回眸只為那壹抹淺笑 提交于 2019-12-03 00:53:40
I have a Gradle file which, whenever I load open it in IntelliJ IDEA 14.1.5, shows IDE errors for the entire file. Namely all the errors seem to be either: java.lang.String errors or groovy.lang.Closure errors I've tried clearing the file's contents and only writing the top line: group 'com.me.blah' but even that results in an error. For context's sake - this is an individual module in a larger SpringBoot project. This module is a set of simple static files (with Gradle for CSS compilation, static analysis, etc), while the rest are Java modules, and are not having Gradle issues. Can anyone

Module … is not backed by gradle

。_饼干妹妹 提交于 2019-12-03 00:52:24
I'm using IntelliJ IDEA Pro 13.1.2. Never used any versions below 13. When trying to run build.gradle from IDE I get the message: Module is not backed by gradle I can run this script from the command line just fine. The "root" directory has both .gradle and gradle sub-directories and, in general its structure is very similar to another module from the same project where I can run its build from IDE without problems. Any suggestions on further troubleshooting? If you didn't set up the IDE project via "Import Project" and then pointing to a Gradle project, you may have to link the IDE project to

Appcompat error with firebase library implementation

醉酒当歌 提交于 2019-12-03 00:47:41
问题 Hello I had a little question about adding dependency for firebase. when I add this line: implementation 'com.google.firebase: firebase-core: 17.0.0' to my buil.gradle I see an error line at the line: implementation 'com.android.support:appcompat -v7: 28.0.0 . I searched but not yet a solution. Thank you for helping me. 回答1: Firebase migrated to AndroidX in the latest release. So no more supports for the old support libraries. You have to either downgrade firebase, implementation 'com.google

Android Studio - Gradle Manifest Merging Failed

断了今生、忘了曾经 提交于 2019-12-03 00:36:16
I am building a demo app using actionbar sherlock in android studio and i was facing problem , mentioned in following link :- Previous Problem now after following the replies posted on above link i did some changes and now i am facing this Gradle: Execution failed for task ':SherlockTest:processDebugManifest'. > Manifest merging failed. See console for more info. my application manifest file is :- <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.sherlocktest" android:versionCode="1" android:versionName="1.0" >

Unable to delete directory in Android Studio

若如初见. 提交于 2019-12-02 23:13:46
Today I updated my Android Studio to 2.0 and when I run my project is gives me this error Error:Execution failed for task ':app:clean'. > Unable to delete directory: /media/dev1/08782A6D782A5A281/workspace/gengold/GenGold/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.3/jars This is my build.gradle apply plugin: 'com.android.application' android { compileSdkVersion 21 buildToolsVersion "21.1.2" defaultConfig { applicationId "com.mobile.gengold" minSdkVersion 15 targetSdkVersion 21 } buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile(

Android Studio - How to make modules inside a subdirectory?

霸气de小男生 提交于 2019-12-02 22:35:05
Suppose that I had 3 modules: mod1, mod2 and mod3. In normal case, the file system hierarchy should be: [android_root_dir] build.gradle # list this file just to make it clear. ----mod1 ----mod2 ----mod3 But what I want is: [android_root_dir] build.gradle # list this file just to make it clear. ----modules ----mod1 ----mod2 ----mod3 how to do it in Android Studio 1.1.0? PS: I find this article but it does not seem to work, or it works for earlier versions of AS, not 1.1.0: How can I move a module inside a subdirectory? You can do it: root build.gradle settings.gradle modules mod1 build.gradle

Android plugin 1.3 error

﹥>﹥吖頭↗ 提交于 2019-12-02 22:25:41
This is error I got when updated my SDK and Build tool to Android M Android Build Tools Found incompatible Build Tools and Android plugin versions: * Module 'app' is using Android plugin 1.2.3 and Build Tools 23.0.0 rc1 Please use Android plugin 1.3 or newer, or an older Build Tools version. Otherwise the project won't build. when classpath 'com.android.tools.build:gradle:1.2.3' changed to 1.3 I got another error. Error:Could not find com.android.tools.build:gradle:1.3. Searched in the following locations: file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/android/tools

How do I extend gradle's clean task to delete a file?

空扰寡人 提交于 2019-12-02 21:38:08
So far i've added the following to my build.gradle apply plugin: 'base' clean << { delete '${rootDir}/api-library/auto-generated-classes/' println '${rootDir}/api-library/auto-generated-classes/' } However not only is my file not deleted, but the print statement shows that ${rootDir} is not being converted to the root directory of my project. Why won't this work, what concepts am I missing? mushfek0001 You just need to use double quotes. Also, drop the << and use doFirst instead if you are planning to do the deletion during execution. Something like this: clean.doFirst { delete "${rootDir}/api