我正在使用 Ionic 的后台模式插件:( https://github.com/katzer/cordova-plugin-background-mode ),一旦我在 Android 设备上锁定屏幕,应用程序就会崩溃,我得到以下信息:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.catapult.fitup, PID: 10870
java.lang.NoSuchMethodError: No static method metafactory(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite; in class Ljava/lang/invoke/LambdaMetafactory; or its super classes (declaration of 'java.lang.invoke.LambdaMetafactory' appears in /apex/com.android.runtime/javalib/core-oj.jar)
at de.appplant.cordova.plugin.background.BackgroundModeExt.clearKeyguardFlags(BackgroundModeExt.java:387)
我还添加了
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
到 build.gradle 文件!
有任何想法吗?