【发布时间】:2019-06-26 16:15:05
【问题描述】:
我有一个使用 jdk 8 并启用 Jack Options 的 android 应用程序模块。然后我将其转换为 Android 库模块。然后我必须从构建 gradle 中删除 Jack Options。现在,当我尝试构建 AAR 文件时,Lambda 表达式给了我以下错误。
Error:(59, 25) error: cannot find symbol method metafactory(Lookup,String,MethodType,MethodType,MethodHandle,MethodType)
给出这个错误的代码是,
Runnable r= () -> {
appManager.startApp(definition,identifier);
};
我的构建 Gradle 是
Apply plugin: 'com.android.library'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
minSdkVersion 18
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
这个问题的原因是什么?
【问题讨论】:
-
你找到解决办法了吗??
-
@chamthabeysinghe 你找到解决方案了吗?
标签: java android lambda android-service