Home > Software design >  Flutter app crashed when trying to access location service
Flutter app crashed when trying to access location service

Time:04-07

my app is crashed when i am trying to access location service. i'm using location: ^4.3.0

await location.serviceEnabled() when i am using this code, i got an error msg,

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSTaggedPointerString containsObject:]: unrecognized selector sent to instance 0x96e6353890a4571d'
*** First throw call stack:
(0x182f6705c 0x19b481f54 0x18304401c 0x182efc484 0x182efb5c0 0x100b6f764 0x100b6f8b0 0x1036f2a60 0x103403d7c 0x10370d070 0x1036a71d4 0x1036a99fc 0x182f7c278 0x182f00c50 0x182efb44c 0x182ed9c68 0x182eed3c8 0x19e6fe38c 0x1858930bc 0x185610be8 0x10050e11c 0x100811a24)
libc  abi: terminating with uncaught exception of type NSException
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00000001b98e79c4 libsystem_kernel.dylib`__pthread_kill   8
libsystem_kernel.dylib`__pthread_kill:
->  0x1b98e79c4 < 8>:  b.lo   0x1b98e79e4               ; < 40>
    0x1b98e79c8 < 12>: pacibsp 
    0x1b98e79cc < 16>: stp    x29, x30, [sp, #-0x10]!
    0x1b98e79d0 < 20>: mov    x29, sp
Target 0: (Runner) stopped.```

CodePudding user response:

Have you added NSLocationAlwaysUsageDescription or NSLocationWhenInUseUsageDescription in the info.plist ?

CodePudding user response:

Did you add the required permissions and usage declarations as per the Readme?

Did you try to use it on a not-supported platform?

Especially with iOS you really MUST have everything declared properly, otherwise iOS will not let you access that information.

  • Related