- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
我的 kotlin android 应用程序出现以下错误
Android issues: (3 errors)
Program type already present: kotlinx.coroutines.experimental.EventLoopBase Message{kind=ERROR, text=Program type already present: kotlinx.coroutines.experimental.EventLoopBase, sources=[Unknown source file], tool name=Optional.of(D8)}
Program type already present: kotlinx.coroutines.experimental.internal.LockFreeLinkedListNode Message{kind=ERROR, text=Program type already present: kotlinx.coroutines.experimental.internal.LockFreeLinkedListNode, sources=[Unknown source file], tool name=Optional.of(D8)}
Program type already present: kotlinx.coroutines.experimental.internal.LockFreeMPSCQueueCore Message{kind=ERROR, text=Program type already present: kotlinx.coroutines.experimental.internal.LockFreeMPSCQueueCore, sources=[Unknown source file], tool name=Optional.of(D8)}
Java compiler: (4 errors)
Caused by: com.android.builder.dexing.DexArchiveBuilderException: Failed to process /home/deepak/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core/0.25.0/5664ba2d20c6dcc88c912cc9666baa7f03203bcd/kotlinx-coroutines-core-0.25.0.jar
Caused by: com.android.builder.dexing.DexArchiveBuilderException: Error while dexing.
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
Caused by: com.android.tools.r8.utils.AbortException
下面是我的依赖和kotlin实验协程
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.0-rc01'
implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
implementation 'org.jetbrains.anko:anko:0.10.5'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:0.25.0'
implementation 'com.android.support:design:28.0.0-rc01'
}
kotlin {
experimental {
coroutines "enable"
}
}
最佳答案
这是一个 bug在 kotlinx.coroutines
0.25.0.
版本 0.25.0 以 multi-release JAR 的形式发布并且这样的 JAR 打破了除了最新的 alpha 版本之外的所有 Android 工具。此更改已在 0.25.3 版本中恢复,因此更新 kotlinx.coroutines
版本并使缓存无效就足以解决此问题。
关于android - 程序类型已经存在 : kotlinx. coroutines.experimental.EventLoopBase,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52096747/
我的 kotlin android 应用程序出现以下错误 Android issues: (3 errors) Program type already present: kotlinx.corout
我是一名优秀的程序员,十分优秀!