Tag: gradle

Kotlin未解决的参考:来自gradle上的println

在kotlin函数之前放置println语句将返回崩溃。 堆栈跟踪: thufir@dur:~/NetBeansProjects/kotlin$ thufir@dur:~/NetBeansProjects/kotlin$ gradle clean build –stacktrace w: Classpath entry points to a non-existent location: e: /home/thufir/NetBeansProjects/kotlin/src/main/kotlin/example.kt: (14, 5): Unresolved reference: println > Task :compileKotlin Using Kotlin incremental compilation FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':compileKotlin'. > Compilation error. See log for more details * Try: […]

将Kotlin添加到现有Java项目会打破Android Studio gradle消息错误

我是Gradle和Android的新手,但是因为我已经把Kotlin添加到了我的项目中,所以我在Android Studio中遇到一个错误,我需要通过Gradle控制台,默认情况下不会给我任何好的堆栈跟踪或路径。 在现在出现错误的Gradle消息视图中,我只能得到 错误:执行任务':app:kaptDebugKotlin'失败。 内部编译器错误。 查看日志了解更多详情 这是预期的功能,因为它似乎在jetbrains示例项目中工作正常。 我的项目Gradle文件 buildscript { ext.kotlin_version = '1.1.4-2' repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.3.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() } } task clean(type: Delete) { delete […]

无法让dokka在gradle / android项目上生成kotlin文档

我正在关注https://github.com/Kotlin/dokka中的gradle插件部分。 我也尝试了https://github.com/JetBrains/kotlin-examples/tree/master/gradle/dokka-gradle-example中的dokka-gradle-example示例。 我使用的版本是: android: '23.1.1' dokka: '0.9.6' gradle-android-plugin: '1.5.0' kotlin: '1.0.0-rc-1036' 但我也尝试过从0.9到0.9.7的Dokka版本。 输出的相关部分是: … :app:dokka FAILED :app:dokka (Thread[Daemon worker Thread 9,5,main]) completed. Took 0.766 secs. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:dokka'. > com.intellij.mock.MockComponentManager.getPicoContainer()Lorg/picocontainer/MutablePicoContainer; * Try: Run with –debug option to get more log output. * Exception […]

Gradle 3.0.0-alpha1与kotlin-android插件1.1.2-3不兼容?

我安装Android Studio 3.0 Canary 1并使用kotlin创建新项目。 并得到这个错误: 错误:无法找到方法'com.android.build.gradle.internal.variant.BaseVariantData.getOutputs()Ljava / util / List;'。 这种意外错误的可能原因包括: Gradle的依赖关系缓存可能已损坏(有时发生在网络连接超时之后)。重新下载依赖项并同步项目(需要网络) Gradle构建过程(守护进程)的状态可能已损坏。 停止所有的Gradle守护进程可能会解决这个问题。 停止Gradle构建过程(需要重新启动) 您的项目可能使用与项目中的其他插件或项目请求的Gradle版本不兼容的第三方插件。 在损坏的Gradle进程的情况下,您也可以尝试关闭IDE,然后杀死所有的Java进程。 如果我从build.gradle中删除kotlin-android插件,那么它将成功构建。 构建gradle: buildscript { ext.kotlin_version = '1.1.2-3' repositories { maven { url 'https://maven.google.com' } jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.0.0-alpha1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual […]

使用Gradle在Kotlin服务器和客户端项目之间共享代码

我想使用一个单独的shared项目来共享服务器(JVM)和客户端(JS)之间的一些代码。 我见过使用Maven的解决方案 ,但我不知道如何将其转换为Gradle项目。 另外, 官方指南中没有任何共享项目的例子。 那么,如何使用这样的设置最小的build.gradle ?

由于app:compileDebugKotlin,Jenkins gradle构建失败

我尝试使用gradle-plugin在Jenkins中构建我的apk,但是由于这个问题,它一直在失败 内部编译器错误 该项目是在Kotlin写的 在Jenkins中,我使用了成功的svn签出后的默认gradle包装器 。 错误: > FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:compileDebugKotlin'. > Internal compiler error. See log for more details * Try: Run with –info or –debug option to get more log output. * Exception is: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugKotlin'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100) […]

Spring Boot:添加@Transactional会产生java.lang.ClassNotFoundException:org.aspectj.util.PartialOrder $ PartialComparable

用Kotlin和Gradle 3.0 Spring Boot 1.4.2。 当我们尝试将@Transactional添加到控制器方法时,生成的jar无法启动,出现错误: 2016-12-14 15:22:57.055 ERROR 4666 — [ main] osboot.SpringApplication : Application startup failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'personService': Unsatisfied dependency expressed through field 'registrator': Error creating bean with name 'personRegistrator' defined in file [/home/voksiv/projects/svc-bereg/build/classes/main/com/beget/bereg/services/internal/person/commands/PersonRegistrator.class]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/aspectj/util/PartialOrder$PartialComparable; nested exception is org.springframework.beans.factory.BeanCreationException: Error […]

Spring Boot:Boot Run不能添加addResources = true

在Kotlin上,在Intellij上使用Gradle来运行Spring Boot的任务bootRun,我得到如下错误: BUILD FAILED Total time: 0.085 secs Could not set unknown property 'addResources' for task ':bootRun' of type org.springframework.boot.gradle.tasks.run.BootRun. 我正在使用kotlinVersion ='1.1.4-3',springBootVersion ='2.0.0.M3'和我的bootrun任务看起来像下面在我的gradle.build bootRun { addResources = true } 我的bootRun按预期工作,没有调整bootRun任务

分割所有输出目录gradle

Gradle 4.0昨天出来,我更新了我的项目。 现在我收到以下警告: Gradle现在为每个JVM语言使用单独的输出目录,但是这个版本假设源集合中所有类的单个目录。 这个行为已经被弃用,并计划在Gradle 5.0中被删除 我想为每种语言使用单独的输出目录。 我需要改变以实现目标。 我试过的东西: 随后由gradle构建的gradle clean 删除构建目录,然后运行gradle构建。 删除gradle和build目录然后运行gradle 相关的GitHub 问题 Gradle插件: java的 蚀 理念 org.springframework.boot

IntelliJ运行vs运行jar,带有Social Oauth2的Springboot Kotlin,Multi模块Gradle项目

TL; DR :为什么在通过IntelliJ启动时一切正常,为什么在调用java -jar app.jar时会java -jar app.jar 。 我该如何解决这个问题? 好吧,我有一些后端问题,我试图dockerize。 我有一个使用Spring Boot(1.4.2.RELEASE) 在其页面上的Spring Oauth(2.0.12.RELEASE) 指南之后创建的应用程序。 我遵循Gradle版本,因为我比Graven更喜欢Gradle。 此外,我正在使用Kotlin而不是Java。 一切都很好,我开始通过IntelliJ我的后端静态前端,我可以通过Facebook(和谷歌和Github)登录,我收到一个很好的Principal女巫掌握我需要的信息,我可以修改Spring安全授权和允许端点。 到现在为止还挺好。 现在对于不好的部分,当我运行./gradlew clean build app:bootrun或./gradlew clean build app:jar并通过java -jar运行jar(就像我将在我的Docker容器中),我的后端出现。 我的静态前端弹出。 现在我想通过Facebook登录,我最终在Facebook登录页面,我输入我的凭据,… 什么都没有 ! 我终于回到我的主页,没有登录,没有任何对我意味着什么的日志消息,只是沉默。 我在日志中看到的最后一件事是: Getting user info from: https://graph.facebook.com/me 这个Url会在我的浏览器中给我: { "error": { "message": "An active access token must be used to query information about the […]