Skip to content

[iOS] NSInternalInconsistencyException Crash #20

@MPinto16

Description

@MPinto16

Our app is experiencing a crash on iOS devices, which appears to be related to the flutter_eco_mode package. The crash occurs when data is being sent through a method channel, leading to an NSInternalInconsistencyException.

Crash Details

We cannot reproduce the issue directly, but it has been reported multiple times on Crashlytics with the following stack trace:

Fatal Exception: NSInternalInconsistencyException
0  CoreFoundation                 0x8408c __exceptionPreprocess
1  libobjc.A.dylib                0x172e4 objc_exception_throw
2  Foundation                     0x8222fc -[NSMutableDictionary(NSMutableDictionary) initWithContentsOfFile:]
3  Flutter                        0x5d9658 WriteValueOfType(void const*, __CFData*, FlutterStandardCodecObjcType, void const*) + 341 (FlutterStandardCodec.mm:341)
4  Flutter                        0x5d92e0 -[FlutterStandardWriter writeValue:] + 351 (FlutterStandardCodec.mm:351)
5  Flutter                        0x5da528 -[FlutterStandardMethodCodec encodeSuccessEnvelope:] + 95 (FlutterStandardCodec.mm:95)
6  Flutter                        0x5d5ef8 invocation function for block in SetStreamHandlerMessageHandlerOnChannel(NSObject<FlutterStreamHandler>*, NSString*, NSObject<FlutterBinaryMessenger>*, NSObject<FlutterMethodCodec>*, NSObject<FlutterTaskQueue>*) + 398 (FlutterChannels.mm:398)
7  flutter_eco_mode               0x4364 thunk for @escaping @callee_unowned @convention(block) (@unowned Swift.AnyObject?) -> () (<compiler-generated>)
8  flutter_eco_mode               0x4cb8 closure #1 in BatteryStateStreamHandler.batteryStateChanged(_:) + 196 (FlutterEcoModePlugin.swift:196)
9  flutter_eco_mode               0x4764 thunk for @escaping @callee_guaranteed () -> () (<compiler-generated>)
10 libdispatch.dylib              0x2370 _dispatch_call_block_and_release
11 libdispatch.dylib              0x40d0 _dispatch_client_callout
12 libdispatch.dylib              0x129e0 _dispatch_main_queue_drain
13 libdispatch.dylib              0x125fc _dispatch_main_queue_callback_4CF
14 CoreFoundation                 0x56f64 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
15 CoreFoundation                 0x54188 __CFRunLoopRun
16 CoreFoundation                 0x535b8 CFRunLoopRunSpecific
17 GraphicsServices               0x11c4 GSEventRunModal
18 UIKitCore                      0x3de2c0 -[UIApplication _run]
19 UIKitCore                      0x48cddc UIApplicationMain
20 UIKitCore                      0x7b9b20 block_destroy_helper.23
21 Runner                         0x8aa0 main (AppDelegate.swift)
22 ???                            0x1bc5e0d34 (Manquant)
        

Additional Context

Flutter Version: 3.24.4
flutter_eco_mode Version: 0.0.3
iOS Version: The crash has been observed from iOS 16 until 18.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions