我刚刚开始从Java转换到Kotlin。我有一个问题:当我思考类似于:XXClass::class.java或其他东西的时候。他们的不是在JAR中工作,而是在IDE中工作得很好。
我使用gradle :module:build或gradle :module:jar生成JAR文件。生成之后,它总是告诉我KotlinReflectionNotSupportedError: Kotlin reflection implementation is not found at runtime. Make sure you have kotlin-reflect.jar in the classpath。但
我是Android开发的新手,也是个新手。当我输出我的应用程序时,我得到了很多错误,而这些错误目前还停留在这个错误上。不知道怎么解决这个问题。如果你们能帮我的话,会有很大帮助的!
获取此错误:
FAILURE: Build failed with an exception.
* Where:
Build file 'F:\GAMES\quiz\android\app\build.gradle' line: 88
* What went wrong:
A problem occurred evaluating project ':app'.
> Coul
更新新的大黄蜂安卓工作室后,我创建了一个新项目,并看到build.gradle随着新表单的变化而改变
plugins {
id 'com.android.application' version '7.1.0' apply false
id 'com.android.library' version '7.1.0' apply false
id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
}
我正在写一个自定义插件在buildSrc使用Android Studio北极福克斯安装由brew。经过一些测试后,导入的自动完成功能出现了问题。在app/build.gradle.kts中,我可以使用import com.android.build.api.dsl.*,但在buildSrc中,这引发了Unresolved reference on android命名空间。 根build.gradle.kts // Top-level build file where you can add configuration options common to all sub-projects/mo
我刚刚在我的Android项目中启用了Kotlin,我偶然发现了一个警告。在第二个构建(构建->重建项目)之后,此警告将显示在消息下面:
Warning:Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
~/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.2.10/85fe1811f3e586d0cc53aba1394d80
我的项目结构如下:
parent
client (用Kotlin编写,但编译成JS)
server (用科特林写)
model (用科特林写)
client模块依赖于model。因此,当我将client编译到JS时,也应该使用它来编译model。就目前而言,我有以下的Gradle配置,它们没有完成所需的任务:
project/parent.gradle
group 'com.vchernogorov.tycher'
version '1.0-SNAPSHOT'
buildscript {
ex
我试着让前卫去工作,但我对格莱多来说还是新的。我的构建gradle.kts有一个错误(未解决的引用:pro卫士),我无法创建一个Pro卫士任务:
plugins {
id("com.github.johnrengelman.shadow") version "5.2.0"
java
kotlin("jvm") version "1.3.61"
}
group = "*...*"
version = "*...*"
repositories {
mavenCentr
您好,我正要将我的应用程序部署为APK。当我对我的手机进行调试时,一切都正常。我已经准备好把它构建成APK了。结果发生了这样的事情。这个错误一直出现,我不知道该怎么办。
Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.5 0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.3.5 0/kotlin-gradle-pl
我尝试运行一个测试类,并在下面发现了这个构建错误。它仅在尝试运行测试时出现,而不是在构建和运行应用程序时出现。对如何解决这个问题有什么建议吗?我根本没有在我的应用程序中使用kotlin。 org.gradle.api.internal.tasks.TaskDependencyResolveException: Could not determine the dependencies of task ':app:preDebugAndroidTestBuild'.
at org.gradle.api.internal.tasks.CachingTaskDependenc
我正在构建一个使用协同机制的库模块。
我的图书馆做了以下工作:
从app模块获取配置
创建实现CoroutineScope (ContentListingFragment)的片段
ContentListingFragment处理它从网络中获取数据的所有过程,并显示它们
从应用程序模块:我们应该能够从ContentListingFragment获得一个实例并将它添加到一个容器中
问题:当我构建应用程序时,我会收到以下错误:
Supertypes of the following classes cannot be resolved. Please make sure you
当我使用Kotlin Gradle插件并同时使用Kotlin BOM时,似乎插件版本优先于kotlin-stdlib,我如何让插件不管理我的依赖? plugins {
kotlin("jvm") version "1.2.50"
}
dependencies {
implementation(platform("some-bom:0.3")) // this has API dependency to kotlin-bom 1.3.50
implementation(kotlin("stdlib
我在Kotlin启动了一个新的应用程序,但是当Android完成构建新项目时,等等。是说cand下载正确版本的Kotlin:
下面是构建级:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.1.4-eap-77'
repositories {
google()
jcenter()
}
我试图使用React-Native构建一个Android应用程序。在添加Facebook登录功能时,我遇到了一个奇怪的问题,出现了以下错误:
> Task :app:lint
w: Runtime JAR files in the classpath have the version 1.3, which is older than the API version 1.4. Consider using the runtime of version 1.4, or pass '-api-version 1.3' explicitly to restrict the ava
我已经创建了一个maven存储库,并将其上传到Github。当我将它作为依赖项添加到示例项目中时,gradle同步成功完成。但当我尝试运行这个应用程序时,它崩溃了,并显示了一个java.lang.NoClassDefFoundError。 存储库链接:https://github.com/rjain90/sdk 示例项目代码: 项目build.gradle // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
我想使用来自protoc-gen-grpc-kotlin的protoc gen-grpc-kotlin-1.0.0,我得到了 Execution failed for task ':generateProto'.
> Could not resolve all files for configuration ':protobufToolsLocator_grpckt'.
> Could not find protoc-gen-grpc-kotlin-1.0.0-windows-x86_64.exe (io.grpc:protoc-gen-gr
由于一个现有项目的问题,我创建了一个新项目。
我试图在一个新项目中添加一个依赖项,但它与我迄今为止所做的gradle不同。
我还查看了开发人员文档,但它似乎还没有为新的gradle更新。
幸运的是,应用程序级别的梯度似乎是一样的。
前级(项目)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.5.21"
def nav_version
我正在建设一个Kotlin图书馆和几个web服务,它们都是图书馆的消费者。库定义了数据库模型,然后web服务都可以访问和操作这些模型。
下面是我的库的build.gradle文件:
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.4.10'
}
group 'org.bioround'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
jcenter()
}
dependencies {
在我的项目中添加hilt依赖项时,我面临着问题
插件
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-kapt'
id 'realm-android'
id 'androidx.navigation.safeargs.kotlin'
id 'kotlin-parcelize'
}
依赖关系
//Dependency injection