您好,我刚刚将Android Studio更新到3.2 canary 2,我的项目编译良好,但我有一个运行时异常。
下面是崩溃的原因:
FATAL EXCEPTION: main
Process: fr.myApp, PID: 12658
java.lang.VerifyError: Rejecting class kotlin.reflect.jvm.internal.KClassImpl that attempts to sub-class erroneous class kotlin.reflect.jvm.internal.KDeclarationContainerImpl (decl
假设我们有一个kotlin类定义为:
package foo
class Bar internal constructor() {
//...
}
当我尝试从测试方法中插入该对象时,例如:
package foo
class TestBar {
@Test
fun testingBar() {
Bar() //<----- error
}
}
我得到了以下错误:
Cannot access '<init>': it is internal in 'Bar'
Bar和TestBar都在同一个Andr
在几乎没有任何更改的情况下重新启动我的项目之后,我突然得到了这个错误日志:
Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors
e: C:/Users/Gerald/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.5.31/43331609c7de8
我正面临着这种幻象的错误。我已经尝试过很多方法来解决这个问题,但都没有用。我不知道是什么导致了这个问题。这是我在构建日志中的错误:
e: /Users/galihlarasprakoso/Projects/Android/surat-kaleng/app/build/generated/data_binding_base_class_source_out/debug/dataBindingGenBaseClassesDebug/out/galihlprakoso/com/SuratKaleng/databinding/ActivityLoginBinding.java:17: error: c
无法提供类型为kolin lambda的(Int) -> Unit。然而,可以提供() -> Unit :-例如:-
@Module
class LambdaModule {
@Provides
fun getIntArgLambda(): (Int) -> Unit = {}
@Provides
fun getNoArgLambda(): () -> Unit = {}
@Provides
fun getRecyclerViewAdater(intLambda: (Int) -> Unit, noArg: () ->
我在Dagger 2中使用了Kotlin。问题是,当我在实现Dagger时犯了错误(例如,类解析器的@Inject小姐),IDE没有具体显示错误在哪里。Insead编译器错误总是相同的:
Execution failed for task ':app:kaptDebugKotlin'. Internal compiler error. See log for more details
带有故意错误的类(注释@Inject):
class LoginPresenter //@Inject
constructor(private val request: LoginR
我试图在我的项目中添加空间,即Java + Kotlin,但是当我试图编译该项目时,它在:app:kaptDebugKotlin上失败,有以下错误:
e: java.lang.IllegalStateException: failed to analyze: java.lang.IllegalArgumentException: void cannot be converted to an Element
at org.jetbrains.kotlin.analyzer.AnalysisResult.throwIfError(AnalysisResult.kt:57)
今天,我更新到大黄蜂android版本,我创建了新的项目,我导入了一些库,包括匕首柄。在build.gradle (模块)中插入:
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-android'
id 'kotlin-kapt'
id 'dagger.hilt.android.plugin'
id 'androidx.navigation.
在将kotlin版本更新到1.2.21之后,我无法构建我的项目。我寻找了很长一段时间的解决方案,但没有任何成功。我之前的kotlin版本是1.1.2-4,它工作得很棒。不久前,我试图将kotlin更新到较新的版本(不同于/低于1.2.21),但也没有成功。在那之后,我决定让它保持原样,但现在我必须更新kotlin,因为我想使用最近版本的新功能。
下面是我的错误:
Error:com.android.builder.dexing.DexArchiveBuilderException: Failed to process /Users/damiankwasniak/Workspace/foodtr
最近,我把我的颤振升级到2.9.0-0.1,升级到2.16.0,但是有问题和问题:我可以创建和运行新的项目,但是我的旧颤振项目不能构建和显示这些错误!此外,我还创建了新项目,并将旧的项目文件移到新的项目文件中,但错误仍然存在:
e: Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors
e: /Users/systemName/.gradle/caches/t
我为android应用程序编写kotlin代码已经有一段时间了,但我决定也开始为我的应用程序编写测试代码。不过,我在使用Hilt时遇到了一些问题。我尝试的是: import android.app.Application
open class AbstractApplication: Application() @HiltAndroidApp
class IgmeApplication : IgmeAbstractApplication() {
@Inject
lateinit var authenticatio