Git Product home page Git Product logo

Comments (5)

fnicastri avatar fnicastri commented on July 18, 2024 1

@mehdok
Possible solution is to change:

func registerPlugins(registry: FlutterPluginRegistry) -> () {
    GeneratedPluginRegistrant.register(with: registry)
}

to:

func registerPlugins(registry: FlutterPluginRegistry) -> () {
    if (!registry.hasPlugin("BackgroundLocatorPlugin")) {
        GeneratedPluginRegistrant.register(with: registry)
    } 
}

in AppDelegate.swift

from background_locator.

MazEbeid avatar MazEbeid commented on July 18, 2024 1

@mehdok
Possible solution is to change:

func registerPlugins(registry: FlutterPluginRegistry) -> () {
    GeneratedPluginRegistrant.register(with: registry)
}

to:

func registerPlugins(registry: FlutterPluginRegistry) -> () {
    if (!registry.hasPlugin("BackgroundLocatorPlugin")) {
        GeneratedPluginRegistrant.register(with: registry)
    } 
}

in AppDelegate.swift

This should go in the docs

from background_locator.

juanlabrador avatar juanlabrador commented on July 18, 2024

2020-05-22 17:12:58.518191-0500 Runner[3541:195103] *** Assertion failure in -[FlutterEngine registrarForPlugin:], ../../flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm:673
2020-05-22 17:12:58.519224-0500 Runner[3541:195103] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Duplicate plugin key: BackgroundLocatorPlugin'
*** First throw call stack:
(0x1922cd794 0x191fefbcc 0x1921d082c 0x19260816c 0x104a3541c 0x10464cc70 0x10464d29c 0x10464d4e8 0x10a63355c 0x10a6320c4 0x104abf310 0x104a5611c 0x104aaf92c 0x104a669c8 0x104a68d2c 0x19224c274 0x19224bf90 0x19224b66c 0x19224667c 0x192245ce8 0x19c39038c 0x196374444 0x10464d930 0x1920cd8f0)
libc++abi.dylib: terminating with uncaught exception of type NSException

from background_locator.

fnicastri avatar fnicastri commented on July 18, 2024

Just hit the same issue.
@mehdok To reproduce just run the example and perform an Hot Reload.
xcode output:
image

2020-05-23 20:21:47.538576+0200 Runner[87409:896245] *** Assertion failure in -[FlutterEngine registrarForPlugin:], ../../flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm:673
2020-05-23 20:21:47.571628+0200 Runner[87409:896245] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Duplicate plugin key: BackgroundLocatorPlugin'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff23e3cf0e __exceptionPreprocess + 350
	1   libobjc.A.dylib                     0x00007fff50ba89b2 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff23e3cc88 +[NSException raise:format:arguments:] + 88
	3   Foundation                          0x00007fff258b8bd2 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 191
	4   Flutter                             0x0000000107d9e3a8 -[FlutterEngine registrarForPlugin:] + 320
	5   Runner                              0x0000000107b1f660 +[GeneratedPluginRegistrant registerWithRegistry:] + 80
	6   Runner                              0x0000000107b1f79a $s6Runner15registerPlugins8registryySo21FlutterPluginRegistry_p_tF + 58
	7   Runner                              0x0000000107b1f9ce $s6Runner15registerPlugins8registryySo21FlutterPluginRegistry_p_tFTo + 30
	8   background_locator                  0x0000000109f7ea46 -[BackgroundLocatorPlugin startLocatorService:] + 790
	9   background_locator                  0x0000000109f7d5bf -[BackgroundLocatorPlugin handleMethodCall:result:] + 319
	10  Flutter                             0x0000000107e2bb1f __45-[FlutterMethodChannel setMethodCallHandler:]_block_invoke + 104
	11  Flutter                             0x0000000107dba762 _ZNK7flutter21PlatformMessageRouter21HandlePlatformMessageEN3fml6RefPtrINS_15PlatformMessageEEE + 166
	12  Flutter                             0x0000000107dbe8ba _ZN7flutter15PlatformViewIOS21HandlePlatformMessageEN3fml6RefPtrINS_15PlatformMessageEEE + 38
	13  Flutter                             0x0000000107e257fb _ZNSt3__110__function6__funcIZN7flutter5Shell29OnEngineHandlePlatformMessageEN3fml6RefPtrINS2_15PlatformMessageEEEE4$_32NS_9allocatorIS8_EEFvvEEclEv + 57
	14  Flutter                             0x0000000107dcf3a7 _ZN3fml15MessageLoopImpl10FlushTasksENS_9FlushTypeE + 117
	15  Flutter                             0x0000000107dd42f4 _ZN3fml17MessageLoopDarwin11OnTimerFireEP16__CFRunLoopTimerPS0_ + 26
	16  CoreFoundation                      0x00007fff23da14b4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
	17  CoreFoundation                      0x00007fff23da114e __CFRunLoopDoTimer + 1038
	18  CoreFoundation                      0x00007fff23da07aa __CFRunLoopDoTimers + 282
	19  CoreFoundation                      0x00007fff23d9b3fe __CFRunLoopRun + 1950
	20  CoreFoundation                      0x00007fff23d9a944 CFRunLoopRunSpecific + 404
	21  GraphicsServices                    0x00007fff38ba6c1a GSEventRunModal + 139
	22  UIKitCore                           0x00007fff48c8b9ec UIApplicationMain + 1605
	23  Runner                              0x0000000107b1fd78 main + 72
	24  libdyld.dylib                       0x00007fff51a231fd start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

from background_locator.

juanlabrador avatar juanlabrador commented on July 18, 2024

Thank you! It's help!

from background_locator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.