Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails on Flutter 1.0 with iOS device #6

Open
RyanRamchandar opened this issue Jan 4, 2019 · 5 comments
Open

Fails on Flutter 1.0 with iOS device #6

RyanRamchandar opened this issue Jan 4, 2019 · 5 comments

Comments

@RyanRamchandar
Copy link

I get the following error when using version great_circle_distance: ^1.0.1

final d1 = GreatCircleDistance.fromDegrees(
          latitude1: lat1,
          longitude1: lon1,
          latitude2: lat2,
          longitude2: lon2,
        ).haversineDistance();

Output

Launching lib/main.dart on iPhone XS in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: B28XY4K8AM
Starting Xcode build...
Xcode build done.                                            6.0s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
    The use of Swift 3 @objc inference in Swift 4 mode is deprecated. Please address deprecated @objc inference warnings, test your code with “Use of deprecated Swift 3 @objc inference” logging enabled, and then disable inference by changing the "Swift 3 @objc Inference" build setting to "Default" for the "Runner" target.
    The use of Swift 3 @objc inference in Swift 4 mode is deprecated. Please address deprecated @objc inference warnings, test your code with “Use of deprecated Swift 3 @objc inference” logging enabled, and then disable inference by changing the "Swift 3 @objc Inference" build setting to "Default" for the "Runner" target.
    === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===

    Compiler message:
    file:///Users/r/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/great_circle_distance-1.0.1/lib/src/great_circle_distance_base.dart:61:68: Error: Getter not found: 'PI'.
        double _radiansFromDegrees(final double degrees) => degrees * (PI / 180.0);
                                                                       ^^
    file:///Users/r/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/great_circle_distance-1.0.1/lib/src/great_circle_distance_base.dart:61:68: Error: The getter 'PI' isn't defined for the class '#lib1::GreatCircleDistance'.
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'PI'.
        double _radiansFromDegrees(final double degrees) => degrees * (PI / 180.0);
                                                                       ^^
    file:///Users/r/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/great_circle_distance-1.0.1/lib/src/formula/spherical_lawofcosines.dart:10:49: Error: Getter not found: 'PI'.
            if (distance < 0) distance = distance + PI;
                                                    ^^

Could not build the precompiled application for the device.

Error launching application on iPhone XS.

Flutter doctor

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.0.0, on Mac OS X 10.14.2 18C54, locale en-CA)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.2)
[✓] VS Code (version 1.30.1)
[✓] Connected device (1 available)

• No issues found!

Dart version

$ flutter --version
Flutter 1.0.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 5391447fae (5 weeks ago) • 2018-11-29 19:41:26 -0800
Engine • revision 7375a0f414
Tools • Dart 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

@sunojvijayan
Copy link

Same issue here. Did you solve it?

@RyanRamchandar
Copy link
Author

Unfortunately no. I had to find an alternative solution for the time being.

@sunojvijayan
Copy link

Unfortunately no. I had to find an alternative solution for the time being.

Thanks

@metacomgd
Copy link

Look at the PR's; The renaming of PI -> pi. For some reason the Travis build fails, but it's more to do with the Travis setup than the nature of the PR.

@BoniWPy
Copy link

BoniWPy commented Jan 17, 2020

me too, faced same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants