在执行以下代码以创建ActorSystem时尝试在Android上使用Akka,会引发异常
final ActorSystem system = ActorSystem.create("OrderManagement");
出现以下错误:
java.lang.VerifyError: Verifier rejected class akka.actor.-$$Lambda$yUalsA_HmePIyyKfKknCvUTHge4: scala.Option akka.actor.-$$Lambda$yUalsA_HmePIyyKfKknCvUTHge4.apply() failed to verify: scala.Option akka.actor.-$$Lambda$yUalsA_HmePIyyKfKknCvUTHge4.apply(): [0x4] returning 'Reference: java.lang.Object', but expected from declaration 'Reference: scala.Option' (declaration of 'akka.actor.-$$Lambda$yUalsA_HmePIyyKfKknCvUTHge4' appears in /data/app/com.goldenhorn.vi-HeeWMjjueyCMy6_-AdqGKQ==/split_lib_dependencies_apk.apk)
at akka.actor.ActorSystem$.<init>(ActorSystem.scala:151)
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion **28**
defaultConfig {
applicationId "com.mypackage.whatever"
minSdkVersion **26**
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
}
dependencies {
implementation "android.arch.work:work-runtime:1.0.0-beta03"
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation "androidx.constraintlayout:constraintlayout:1.1.3"
implementation 'com.typesafe.akka:akka-actor_2.12:2.5.20'
implementation 'org.projectlombok:lombok:1.18.4'
compileOnly "org.projectlombok:lombok:1.18.4"
annotationProcessor 'org.projectlombok:lombok:1.18.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
build.properties
android.useAndroidX = true
android.enableJetifier = true
手机版本:
'com.android.tools.build:gradle:3.3.0'
想知道,如果有人遇到这样的问题
JK