plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

[Bug]: Alarm Manager: java.lang.IncompatibleClassChangeError and java.lang.VerifyError

Open desmeit opened this issue 3 years ago • 0 comments

Platform

Android 12

Plugin

Alarm Manager

Version

2.0.6

Flutter SDK

2.10.5

Steps to reproduce

I have embedded it as in the example and entered the settings for Android. Unfortunately I get the following problems in Crashlytics:

Code Sample

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
  ...

  FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError;

  if (Platform.isAndroid) {

    await AndroidAlarmManager.initialize();
    final int helloAlarmID = 0;
    await AndroidAlarmManager.periodic(
        const Duration(minutes: 15), helloAlarmID, callbackDispatcher);
  }

Logs

In Crashlytics I get the following errors:

Fatal Exception: java.lang.IncompatibleClassChangeError
Superclass androidx.core.app.h of dev.fluttercommunity.plus.androidalarmmanager.AlarmService is declared final (declaration of 'dev.fluttercommunity.plus.androidalarmmanager.AlarmService' appears in /data/app/de.njai.iam-CRzLQSRmiverIzGMNowGPA==/base.apk)

and

Fatal Exception: java.lang.VerifyError
Superclass androidx.core.app.h of dev.fluttercommunity.plus.androidalarmmanager.AlarmService is declared final (declaration of 'dev.fluttercommunity.plus.androidalarmmanager.AlarmService' appears in /data/app/~~LnojrGCTegyAkSKQaAEPSg==/de.njai.iam-pBWMDU_kP_Vtv-SFnKV1qQ==/base.apk)

Flutter Doctor

[✓] Flutter (Channel stable, 2.10.5, on macOS 11.6.5 20G527 darwin-x64, locale de-DE)
    • Flutter version 2.10.5 at /Users/XXX/development/tools/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5464c5bac7 (3 months ago), 2022-04-18 09:55:37 -0700
    • Engine revision 57d3bac3dd
    • Dart version 2.16.2
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/XXX/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = /Users/XXX/Library/Android/sdk
    • ANDROID_SDK_ROOT = /Users/XXX/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)

[✓] VS Code (version 1.68.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.44.0

[✓] Connected device (2 available)
    • SM J530F (mobile) • 52034239f4dca4ed • android-arm    • Android 9 (API 28)
    • Chrome (web)      • chrome           • web-javascript • Google Chrome 103.0.5060.53

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

desmeit avatar Jul 05 '22 09:07 desmeit