Flutter-geolocator: Property 'speedAccuracy' not found on object of type 'CLLocation *'

Created on 4 Nov 2020  ·  9Comments  ·  Source: Baseflow/flutter-geolocator

🐛 Bug Report

LocationManager.m

if (@available(iOS 10.0, *)) { speedAccuracy = location.speedAccuracy; }

Expected behavior

Reproduction steps

Configuration

Version: 6.1.4

Platform:

  • [ ] :iphone: iOS
  • [ ] :robot: Android
ios

Most helpful comment

Thanks @mvanbeusekom for your support!

All 9 comments

@viirak, not sure what your problem is, the information you are providing not very helpful.

According to Apple's documentation the speedAccuracy property is available since iOS 10.0+ (hence the if statement). I have tested the plugin on several versions of iOS and all seem to work. Also code compiles fine. Can you provide more information?

I have the same bug after updating lib:

geolocator: ^6.1.4 geocoding: ^1.0.5

Flutter version:

Channel stable, 1.22.3

and the problem is:

`Running Xcode build...
Xcode build done. 24,5s
Failed to build iOS app
Error output from Xcode build:

* BUILD FAILED *

Xcode's output:

/Library/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/geolocator-6.1.4/ios/Classes/Utils/LocationMapper.m:20:34: error: property 'speedAccuracy' not found on object of type 'CLLocation *'
speedAccuracy = location.speedAccuracy;
^
1 error generated.
note: Using new build system
note: Planning build
note: Constructing build description
warning: Mapping architecture armv7 to i386. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'in_app_purchase' from project 'Pods')
warning: Mapping architecture arm64 to x86_64. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'in_app_purchase' from project 'Pods')

Could not build the application for the simulator.
Error launching application on iPhone 11 Pro Max.`

Thanks

I installed the latest package i.e geolocator: ^6.1.4.
I was able to use it to get my current position on the android device but once I ran the iOS simulator, I got the following error:

_Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
lib/main.dart:1
Xcode build done. 12.7s
Failed to build iOS app
Error output from Xcode build:

* BUILD FAILED *
Xcode's output:

/Users/mac/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/geolocator-6.1.4/ios/Classes/Utils/LocationMapper.m:20:34: error: property 'speedAccuracy' not found on object of type 'CLLocation *'
speedAccuracy = location.speedAccuracy;
^
1 error generated.
note: Using new build system
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone 11 Pro Max.
Exited (sigterm)_

This is my environment;
_Flutter 1.22.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 8874f21e79 (6 days ago) • 2020-10-29 14:14:35 -0700
Engine • revision a1440ca392
Tools • Dart 2.10.3_

I am a bit puzzled here, can I ask which version of Xcode do you have installed?

My xcode version is Version 11.3.1 (11C504)

I am on "Version 12.1 (12A7403)", I will try downgrading and see if that is the problem.

I can confirm that this issue is related to the version of Xcode. I have installed version 11.3.1 and also now receive this issue. When compiling on Xcode version 12.1 this issue does not occur.

I will try to figure out if there is a workaround for this, please bare with me. For now possible workarounds are:

  • downgrade to version 6.1.3 of the geolocator plugin
  • or upgrade your Xcode to version 12.1

@viirak, @retuner87, @GwamakaCharles, I have just released a hotfix (version 6.1.4+1) of the geolocator plugin which should fix this issue. Simply run a flutter pug update command (or update the version of the geolocator in your pubspec.yaml) to use this version.

Thank you for reporting.

Thanks @mvanbeusekom for your support!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joesnarky picture joesnarky  ·  3Comments

seakmengc picture seakmengc  ·  3Comments

shrishti08 picture shrishti08  ·  3Comments

prasant10050 picture prasant10050  ·  6Comments

BigWillieStyle picture BigWillieStyle  ·  6Comments