gradle

Kotlin not able to convert gradle's Action class to a lambda

大兔子大兔子 提交于 2020-02-02 12:06:09
问题 So, while this is quite a kotlin-dsl for gradle specific issue, I think it overall applies to the kotlin language itself, so I am not going to use that tag. In the gradle API, the class Action<T> is defined as: @HasImplicitReceiver public interface Action<T> { /** * Performs this action against the given object. * * @param t The object to perform the action on. */ void execute(T t); } So ideally, this should work in kotlin (because it is a class with a SAM): val x : Action<String> = { println

Build fails after 2 times build of the application in flutter

久未见 提交于 2020-02-02 11:37:26
问题 After building my flutter application in VS code, I successfully run the app, everything works fine. But after 2 or more times of restart of the application, whenever I run my code again, the build gets failed. This is the error pops up. Target debug_android_application failed: FileSystemException: Cannot copy file to 'J:\flutter_projects\webdoc\build\app\intermediates\flutter\debug\flutter_assets\assets\images\background.png', path = 'J:\flutter_projects\webdoc\assets\images\background.png'

Could not resolve com.android.tools.build:gradle:3.2.1

一个人想着一个人 提交于 2020-02-02 11:08:32
问题 There is long time I had not developed any Android application (about 5 months) and now I have came back with nativescript. When I have created my first app using nativescript, I encountered this issue: Executing before-shouldPrepare hook from C:\Data\ProjectFiles\NativeScript\HeavenlyMinutes\hooks\before-shouldPrepare\nativescript-dev-webpack.js Skipping prepare. Building project... Gradle build... FAILURE: Build failed with an exception. What went wrong: A problem occurred configuring root

Could not resolve com.android.tools.build:gradle:3.2.1

☆樱花仙子☆ 提交于 2020-02-02 11:07:27
问题 There is long time I had not developed any Android application (about 5 months) and now I have came back with nativescript. When I have created my first app using nativescript, I encountered this issue: Executing before-shouldPrepare hook from C:\Data\ProjectFiles\NativeScript\HeavenlyMinutes\hooks\before-shouldPrepare\nativescript-dev-webpack.js Skipping prepare. Building project... Gradle build... FAILURE: Build failed with an exception. What went wrong: A problem occurred configuring root

Gradle + RoboBinding with AspectJ + Lombok are not compatible together

北城以北 提交于 2020-02-02 09:28:47
问题 I want to integrate in Android project on Gradle following libraries: Lombok RoboBinding with AspectJ Dagger In order to use RoboBinding with AspectJ and android tools 1.1.0 I compiled aspectj-plugin with this fix. All libraries are using some compile time annotation processing. I found that Lombok isn't compatible with AspectJ. I noticed that annotation processor from RoboBinding is using apt whereas lombok works only with provided (Dagger works with both). I found also Lombok and AspectJ

Kotlin internal members not accessible from alternative test source set in Gradle

…衆ロ難τιáo~ 提交于 2020-02-02 02:44:06
问题 Following https://docs.gradle.org/current/userguide/java_testing.html#sec:configuring_java_integration_tests and https://www.michael-bull.com/blog/2016/06/04/separating-integration-and-unit-tests-with-gradle we are attempting to separate our integration tests from plain unit tests. The problem we have is internal members in Kotlin are not accessible from such tests. As per Kotlin doco there is a visibility exception for test source sets. The internal visibility modifier means that the member

gradle入门

被刻印的时光 ゝ 提交于 2020-02-01 19:11:23
了解Groovy语言 说到gradle就不得不谈Groovy语言,gradle中所有的配置使用的是Groovy语言 Groovy语言是一门jvm语言,最终编译成class文件后在jvm上运行,java语言的特性Groovy都支持,可以混写java和Groovy,但是不能混写java和kotlin,kotlin和java可以互相调用,但是不可以混写 说了这么多,那Groovy语言就得比java多点啥,要不用它干啥啊 Groovy优势在于增强了java的一些功能,如文件读写,xml解析,用Groovy几行代码就能搞定,而java就需要几十行 def声明变量、定义函数 def i = 1 def str = "hello world" def d = 3.14 声明变量可以不加类型,编译时会自动判断类型,结尾也可以不加分号 def demoName(){ "hello world" } 最后一行就等于return了,可以不加return String demoName(){ "hello world" } 指定返回值类型就可以不加def了 字符串分为三种 单引号不会对字符串中$进行转义,原样输出 双引号会转义$,输出变量的值 三引号字符(''')支持换行,原样输出 Groovy的数据类型主要包括三种 java中基本数据类型 增强的List、Map、Range容器 闭包

Spring boot + Gradle + Eclipse打war包发布总结

可紊 提交于 2020-02-01 09:29:27
首先感谢两位博主的分享 http://lib.csdn.net/article/git/55444?knId=767 https://my.oschina.net/alexnine/blog/540651 buildscript { ext { springBootVersion = '1.5.2.RELEASE' } repositories { maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } jcenter() } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") } } group 'com.gzkit' version '1.0.1-SNAPSHOT' apply plugin: 'java' apply plugin: 'eclipse'apply plugin: 'eclipse-wtp' apply plugin: 'org.springframework.boot' apply plugin: 'war' compileJava { options.encoding = 'UTF-8' options.compilerArgs <

AndroidStudio2.3.2升级后工程打开失败解决

与世无争的帅哥 提交于 2020-02-01 08:41:49
前言 由于课程需要,进入Android开发学习,本人技术渣渣,慢慢学习,老师给了2.2.0版本的Android Studio,最近一直在提醒更新,便趁着没课的周五更新一波,结果之前的工程打不开,要么就是报错,很无奈,就上网搜,每到这个时候就很痛苦,因为好多时候搜到的跟我自己的情况不一样,因此,我决定也开一个博客,总结自己遇到的问题和解决方法,分享给跟我类似的人,这篇博文综合了 Android Studio下项目编译出错could not find com.android.tools.buildgradle:2.2.2 和另一篇文章虽然很好但有一点不清楚 AndroidStudio2.3升级的后遗症解决 ,在这,我将根据自身经验来一个更详尽的介绍 步骤 下载gradle:前往 gradle-3.4-all 可下载目前最新的版本 将压缩包放在自己的gradle路径下,然后直接解压到当前文件夹即可 修改项目试图下的gradle-wrapper.properties文件,改为 distributionUrl=https://services.gradle.org/distributions/gradle-3.4-all.zip 即可,即把最后面的名字改为压缩包的名字 然后在刚才解压的文件夹下找到如下目录,这几个版本号后面会用 然后修改项目中build.gradle(project:项目名

AndroidStudio相关经验记录

烂漫一生 提交于 2020-02-01 08:29:50
1、初次打开Gradle工程特别慢,一直提示下载更新Gradle   解决办法: 打开Gradle工程子目录:“\gradle\wrapper” 下的 “gradle-wrapper.properties” 文件,找到其中的文件 “distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip” ,用下载工具Download下来,然后放到 “C:\Users\Administrator\.gradle\wrapper\dists\gradle-2.14.1-all\4cj8p00t3e5ni9e8iofg8ghvk7” 目录下,重新打开Gradle工程就好了!后面的那个目录名是随机生成的,可能不一样。 2、关于CMake和NDK   从Android studio2.2 版本开始,默认C++构建工具是CMake,研究了一下方法确实比NDK更方便。不过,在测试发现,如果使用旧版本的NDK时,会报错:“CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage” 3、关于Gradle 参考一篇博文:《 Gradle从入门到实战 - Groovy基础 》,对于语法中的问题多查文档: http://www.groovy-lang