在Android北极福克斯金丝雀8中创建一个新项目时,这是应用程序级别的build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle
这是关于corda的github问题的的副本。
我正在尝试包含对其中一个的外部依赖项。
此依赖项调用ClassLoader.defineClass,它随java.lang.ClassFormatError: Illegal UTF8 string in constant pool in class file org/apache/xerces/impl/xpath/regex/ParserForXMLSchema一起退出。该异常与提到的异常相同,该异常表明它是由冲突的依赖项引起的,并且是在使用类星体时。
在运行项目的依赖报告后,我不仅可以看到外部库和Corda之间的一些冲突,而且还可以看到Co
Gradle项目中的非常简单,我正在寻找一种将其抽象为外部构建脚本的方法,以便可以重用它。
我有一个可行的解决方案(下面),但这感觉有点像一个黑客,因为kotlin插件并不是以这种方式发挥作用的。
当您使用时,从外部脚本中应用任何非标准插件是很麻烦的。
apply plugin: 'kotlin'将导致Plugin with id 'kotlin' not found.
简单的(嗯,通常)解决方法是通过插件的完全限定的类名来应用,即
apply plugin: org.jetbrains.kotlin.gradle.plugin.KotlinPluginWrap
我使用创建了一个kotlin/gradle项目。正如所述的,如果我试图添加kapt,比如:
plugins {
kotlin("plugin.jpa") version "1.2.71"
id("org.springframework.boot") version "2.1.6.RELEASE"
id("io.spring.dependency-management") version "1.0.7.RELEASE"
kotlin("jvm") ver
今天,我将我的安卓工作室升级为3.2,当我试图构建gradle时。我的错误越来越少。有人能帮我吗?
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':app'.
at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:94)
at org.gradle.config
我正在使用颤振的建筑申请。最近,我增加了火基分析,但现在我正在经历一个致命的问题。我不知道是什么原因造成的。
我已经查过了,但没有一个回答对我有帮助。任何指点都会很感激。
如果你需要更多的信息,请告诉我。
日志:
java.lang.IllegalAccessError: Class com.google.firebase.iid.zzb extended by class com.google.firebase.messaging.FirebaseMessagingService is inaccessible (declaration of 'com.google.firebase
我正在尝试设置一个多项目的gradle/kotlin构建,并得到以下错误:
Could not determine the dependencies of task ':compileKotlin'.
> Could not resolve all files for configuration ':kotlinCompilerClasspath'.
> Cannot resolve external dependency org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.10 becaus
我想要创建一个库,我的项目中的其他模块可以依赖,但只用于测试。我阅读了大量的Gradle文档,但无法找到如何实现它。这是我的项目结构:
gradle-example:
app:
src/main/kotlin ...
src/test/kotlin <- this is supposed to use 'com.example.SomeTestUtil'
testlib:
src/test/kotlin/com.example.SomeTestUtil
settings.gradle.kts:
rootProject.name = "
我最近更新为gradle Version5.0-RC-4,当运行./gradlew assemble (或任何其他任务)时,我现在得到以下消息:
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
当我使用./gradlew assemble --warning-mode all时,我得到:
> Conf
我已经将kotlin插件安装到我的安卓工作室project.The代码中,符合一个问题。当我从java类调用它时,它也会执行。它给了我一个警告:“一些附加在这个项目上的Kotlin库不支持format.Please更新库或插件”。println()函数在IDE中也不被识别。
test.kt
fun foo(){
println("ad")
}
public class iTar{
public fun printAll( vararg a: String ){
for(item in a)println(item)
}
}
Build
有人知道如何在创建模块时模板build.gradle文件吗?现在,我遇到的问题是,我希望模块的build.gradle只包含少量信息,因为我将在顶级build.gradle文件中设置共享配置。我还有一个buildSrc文件夹设置来集中版本控制。
顶级build.gradle文件:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
j
我创建了一个gradle插件来统一应用程序的各个模块之间的一些设置。错误的摘要如下:
org.gradle.api.plugins.InvalidPluginException: An exception occurred applying plugin request [id: 'common.plugin']
Caused by: org.gradle.api.UnknownDomainObjectException: Extension of type 'LibraryExtension' does not exist. Currently registe
An exception occurred applying plugin request [id: 'org.jetbrains.kotlin.jvm', version: '1.3.40-eap-40']
> Failed to apply plugin [id 'org.jetbrains.kotlin.jvm']
> Cannot add extension with name 'kotlin', as there is an extension already registered with that
我试图在我的build.gradle.kts中声明一些存储库,但是每当我执行gradle bootRun时,我都会得到一个无法消除的脚本编译错误。
* What went wrong: Script compilation error:
Line 13: url "https://plugins.gradle.org/m2/"
^ Unexpected tokens (use ';' to separate expressions on the same line)
我正在使用kotlin,但是当我在我的项目中同步它时,请告诉我以下错误:
Error:Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.2-3.
Searched in the following locations:
file:/D:/android-studio/gradle/m2repository/org/jetbrains/kotlin/kotlin-gradle-plugin/1.1.2-3/kotlin-gradle-plugin-1.1.2-3.pom
file:/D:/android-st
我尝试在库模块中使用Kotlin,而不是在app模块中使用它。app模块只使用Java,不使用库中的任何Kotlin类。Gradle不会编译hoever:
Error:(2, 1) A problem occurred evaluating project ':<Library>'.
> Plugin with id 'kotlin-android' not found.
我做了一些更改以包括Kotlin:
{库根目录}/ build.gradle
buildscript {
ext.kotlin_version = '1.1.3-2&