小编Jul*_*ies的帖子

无法添加 ProgressIndicators(应用程序崩溃)

当我使用任何类型的进度指示器(例如)CircularProgressIndicator()LinearProgressIndicator()我的应用程序崩溃时:

java.lang.NoSuchMethodError: No virtual method at(Ljava/lang/Object;I)
  Landroidx/compose/animation/core/KeyframesSpec$KeyframeEntity; in class
  Landroidx/compose/animation/core/KeyframesSpec$KeyframesSpecConfig; or its super classes
  (declaration of 'androidx.compose.animation.core.KeyframesSpec$KeyframesSpecConfig' appears in
  /data/app/~~rlFP4ThDS2yjsD1Xsh1cWQ==/es.jvbabi.vplanplus-6LDitHOwZpwGZt8Ywx6lFQ==/base.apk)
    at androidx.compose.material3.ProgressIndicatorKt$CircularProgressIndicator$endAngle$1.invoke(ProgressIndicator.kt:302)
    at androidx.compose.material3.ProgressIndicatorKt$CircularProgressIndicator$endAngle$1.invoke(ProgressIndicator.kt:300)
Run Code Online (Sandbox Code Playgroud)

这些是我与此问题相关的依赖项:

implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
implementation("androidx.activity:activity-compose:1.8.0")
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.material3:material3")
Run Code Online (Sandbox Code Playgroud)

无论我把它们放在哪里,它们都会导致应用程序崩溃。

android gradle kotlin android-jetpack-compose

32
推荐指数
3
解决办法
3963
查看次数

Spring Initializr 项目导致不支持的类文件主要版本 64

当我使用Spring 初始化创建新项目时,Gradle 不会构建该项目。我使用 IntelliJ IDEA。

错误信息是

* Exception is:
org.gradle.cache.CacheOpenException: Could not open init generic class cache for initialization script '/tmp/ijmapper.gradle' (/home/julius/.gradle/caches/7.6.1/scripts/dnnmnny7cynyzgkf00s30jlld).
    at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:91)
    ... 166+ more
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 64
Run Code Online (Sandbox Code Playgroud)

我用这个表查了一下,它是java 20。问题是,我没有选择Java-20,我选择了Java-17。最重要的是,我还无法在我的 Linux 机器上安装 Java-20。

java spring gradle kotlin spring-initializr

21
推荐指数
2
解决办法
3万
查看次数

“不明确的间接导出”错误 JavaScript/TypeScript

我收到此错误: Syntax Error: ambiguous indirect export 在 Firefox 中。可惜谷歌搜不到任何东西……

  • 这是我的导入:
<script type="module">
    import {someFunctionINeed} from "./js/functions.js";
    ...
</script>
Run Code Online (Sandbox Code Playgroud)
  • 这是我的导出:
export function someFunctionINeed(cname) { ... }
Run Code Online (Sandbox Code Playgroud)
  • 我的编译器选项tsconfig.json
"compilerOptions": {
    "module": "commonjs",
    "target": "es5",
    "sourceMap": true,
    "watch": true,
    "removeComments": true
}
Run Code Online (Sandbox Code Playgroud)
  • 以及可能与以下内容相关的内容package.json
"type": "module"
Run Code Online (Sandbox Code Playgroud)

我错过了什么?

html javascript module typescript

12
推荐指数
1
解决办法
2万
查看次数

kotlin 中的 HTTP GET 请求

我需要一个 kotlin 中的 HTTP GET 请求的示例。我有一个数据库,并且已经使用 API 来将信息获取到服务器。作为最终结果,我需要在 android 布局中的“editText”内呈现 API json。建议?我已经有这个代码:

fun fetchJson(){
    val url = "http://localhost:8080/matematica3/naoAutomatica/get"
    val request = Request.Builder().url(url).build()
    val client = OkHttpClient()

    client.newCall(request).enqueue(object : Callback {
        override fun onResponse(call: Call, response: Response) {
            val body = response.body?.string()
            println(body)
        }
        override fun onFailure(call: Call, e: IOException) {
            println("Falhou")
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

web-services kotlin okhttp

5
推荐指数
1
解决办法
9042
查看次数