loup-v / geolocation Goto Github PK
View Code? Open in Web Editor NEWFlutter geolocation plugin for Android and iOS.
License: Apache License 2.0
Flutter geolocation plugin for Android and iOS.
License: Apache License 2.0
E/AndroidRuntime( 9484): java.lang.IllegalArgumentException: Can only use lower 16 bits for requestCode E/AndroidRuntime( 9484): at android.support.v4.app.BaseFragmentActivityApi14.checkForValidRequestCode(BaseFragmentActivityApi14.java:79) E/AndroidRuntime( 9484): at android.support.v4.app.FragmentActivity.validateRequestPermissionsRequestCode(FragmentActivity.java:765) E/AndroidRuntime( 9484): at android.support.v4.app.ActivityCompat.requestPermissions(ActivityCompat.java:505) E/AndroidRuntime( 9484): at io.intheloup.geolocation.location.LocationClient.requestPermission(LocationClient.kt:288) E/AndroidRuntime( 9484): at io.intheloup.geolocation.location.LocationClient.validateServiceStatus(LocationClient.kt:245) E/AndroidRuntime( 9484): at io.intheloup.geolocation.location.LocationClient.requestLocationPermission(LocationClient.kt:71) E/AndroidRuntime( 9484): at io.intheloup.geolocation.LocationChannel$requestLocationPermission$1.doResume(LocationChannel.kt:31) E/AndroidRuntime( 9484): at kotlin.coroutines.experimental.jvm.internal.CoroutineImpl.resume(CoroutineImpl.kt:54) E/AndroidRuntime( 9484): at kotlinx.coroutines.experimental.DispatchedTask$DefaultImpls.run(Dispatched.kt:161) E/AndroidRuntime( 9484): at kotlinx.coroutines.experimental.DispatchedContinuation.run(Dispatched.kt:25) E/AndroidRuntime( 9484): at android.os.Handler.handleCallback(Handler.java:739) E/AndroidRuntime( 9484): at android.os.Handler.dispatchMessage(Handler.java:95) E/AndroidRuntime( 9484): at android.os.Looper.loop(Looper.java:158) E/AndroidRuntime( 9484): at android.app.ActivityThread.main(ActivityThread.java:7229) E/AndroidRuntime( 9484): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime( 9484): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) E/AndroidRuntime( 9484): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
As soon as i add the geolocation to my pubspec the app starts to crash whenever i try to use this plugin - java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/api/Api
I am using:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel dev, v0.4.5-pre.69, on Microsoft Windows [Version 10.0.16299.371], locale pt-PT)
[√] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[√] Android Studio (version 3.1)
[√] VS Code, 32-bit edition (version 1.23.1)
[√] Connected devices (1 available)
• No issues found!
Is there support for detecting when user tries to mock locations in this plugin? I could not find anything related to it in the reference. Is there any plan to add it?
I have republished this packaged aptly named: new_geolocation
I have included most of the items in PR as of today.
Feel free to submit new PRs into my fork for review.
When i call the dependencies cloud_firestore
and geolocation
together my app crashes and i can't figure out why.
If i put only one of them it works fine.
I have been evaluating the popular location permission libraries with flutter to see how it matches with the best practices. Below is what I found with your library. Let me know if there are ways to get this to work that I missed.
iOS Best Practices
So below is my understanding of the best practices. You can see Google Maps and other apps doing the below
If (Location Services Disabled)
A) Show Location Services Dialog
Redirect to Location Services Settings
else if(Location permission denied)
B) Show Dialog saying to enable permission
Redirect to App Settings
else
C) Show Permission dialog
So the library does not support
A. The library does not show the dialog that gives the user the option to enable location services.
B. The library ignores the permission request. It would be good if you had an option to show a dialog and redirect to the app settings.
Summary
I think these are the changes required for users of the library to implement permissions.
Let me know if you need any clarification.
Build fail with the following error:
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
Running 'gradlew assembleDebug'...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:preDebugBuild'.
> Android dependency 'com.android.support:support-v4' has different version for the compile (25.2.0) and runtime (26.1.0) classpath. You should manually set the same version via DependencyResolution
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
Finished with error: Gradle build failed: 1
Flutter
[✓] Flutter (Channel master, v0.5.8-pre.228, on Linux, locale en_US.UTF-8)
• Flutter version 0.5.8-pre.228 at /home/k/flutter
• Framework revision 9e832121d0 (2 hours ago), 2018-08-02 17:07:36 -0700
• Engine revision 4893b0760d
• Dart version 2.0.0-dev.69.5.flutter-8bad5c7b29
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at /home/k/Android/Sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.3
• Java binary at: /home/k/opt/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
• All Android licenses accepted.
[✓] Android Studio (version 3.1)
• Android Studio at /home/k/opt/android-studio
• Flutter plugin version 26.0.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
[✓] IntelliJ IDEA Ultimate Edition (version 2018.2)
• IntelliJ at /home/k/opt/idea-IU-181.4668.68
• Flutter plugin version 26.0.3
• Dart plugin version 182.3569.4
[✓] VS Code (version 1.25.1)
• VS Code at /usr/share/code
• Flutter extension version 2.12.2
[✓] Connected devices (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.0.0 (API 26) (emulator)
• No issues found!
I'm getting this error:
"Missing location permission in AndroidManifest.xml. You need to add one of ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION. See readme for details."
However, I already added ACCESS_COARSE_LOCATION:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.ranky">
<!-- The INTERNET permission is required for development. Specifically,
flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
<!-- The location permission is required for showing close contests to
the user.
-->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
...
I/flutter (15786): The following PlatformException was thrown while invoking
I/flutter (15786): geolocation/location/addLocationUpdatesRequest:
I/flutter (15786): PlatformException(error, Expected BEGIN_OBJECT but was STRING at path $.options, null)```
Hi, I want to create an app like Uber, and I want to get the location updates of the user after each 1 minute even if the app is running in the background is there a way to do this using your library?
I want the solution to work for both Android and Ios.
kindly let me know Thanks.
So I changed my Info.plist
file like explained in the README :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string>I need you I need you I need you right now</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>tplusg</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
But it throws me this error saying it can't find the location usage description values in Info.plist :
[VERBOSE-2:dart_error.cc(16)] Unhandled exception:
Geolocation error: Missing location usage description values in Info.plist. See readme for details.
#0 _JsonCodec.resultErrorFromJson (file:///Users/gaetan/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/geolocation-0.2.1/lib/channel/codec.dart:70:7)
#1 _JsonCodec.resultFromJson (file:///Users/gaetan/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/geolocation-0.2.1/lib/channel/codec.dart:47:33)
#2 _Codec.decodeResult (file:///Users/gaetan/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/geolocation-0.2.1/lib/channel/codec.dart:8:18)
#3 _LocationChannel.isLocationOperational (file:///Users/gaetan/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/geolocation-0.2.1/lib/channel/location_channel.dart:37:19)
<asynchronous suspension>
#4 Geolocation.isLocationOperational (package:geolocation/geolocation.dart:46:24)
#5 _StopsAroundPageState.checkGPS (file:///Users/gaetan/Developer/tplusg/lib/views/tabs/around.da<…>
Am I doing something wrong ?
Plugin doesn't work, i use the forked plugin by shehabic https://github.com/shehabic/geolocation for Dart 2 compatibility
this is the error that return
[VERBOSE-2:shell.cc(184)] Dart Error: Unhandled exception:
NoSuchMethodError: The getter 'last' was called on null.
Receiver: null
Tried calling: last
#0 Object.noSuchMethod (dart:core/runtime/libobject_patch.dart:50:5)
#1 LocationResult.location (file:///Library/flutter/.pub-cache/git/geolocation-5f7e2ec8a00fa0c020791c5b0c1844b2bd320c05/lib/data/location_result.dart:27:38)
#2 LocationResult.dataToString (file:///Library/flutter/.pub-cache/git/geolocation-5f7e2ec8a00fa0c020791c5b0c1844b2bd320c05/lib/data/location_result.dart:31:12)
#3 _MyHomePageState.initGeolocation. (package:sequi/main.dart:77:25)
#4 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#5 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#6 _DelayedData.perform (dart:async/stream_impl.dart:591:14)
#7 _StreamImplEvents.handleNext (dart:async/stream_impl.dart:707:11)
#8 _PendingEvents.schedule. (dart:async/stream_impl.dart<…>
my code is very simple,
// init background geolocation
void initGeolocation() async {
debugPrint('geo');
_geoSubscription = Geolocation.locationUpdates(
accuracy: LocationAccuracy.best,
displacementFilter: 10.0, // in meters
inBackground:
true, // by default, location updates will pause when app is inactive (in background). Set to true
to continue updates in background.
).listen((result) {
debugPrint('result');
debugPrint(result.dataToString());
if (result.isSuccessful) {
// todo with result
_latitude = result.location.latitude;
_longitude = result.location.longitude;
debugPrint(result.dataToString());
}
});
}
"Flutter plugin for location / geolocation / GPS. Supports iOS and Android. Multiple settings for speed, precision, battery optimization, continuous updates in background "
In background here means we can keep updates even the app is not in foreground (closed may be by the system or when click back).
Thank you for making this plugin available!
It would be nice if, when subscribing to locationUpdates(), if both interval and fastestInverval could be passed in and used, rather than the hard-coded values of 5000 and 2500 ms, respectively. This is for the android implementation, I'm not sure if the same applies to iOS.
This could look just like the displacementFilter parameter that is currently passed into that method.
Xcode's output:
↳
/Users/delphix/Documents/Sdk/flutter/.pub-cache/git/geolocation-5f7e2ec8a00fa0c020791c5b0c1844b2bd320c05/ios/Classes/GeolocationPlugin.m:7:9: fatal error: 'geolocation/geolocation-Swift.h' file not found
#import <geolocation/geolocation-Swift.h>
I cloned this git repo and tried to launch but I got this error please help
e: C:\Users\zakbl\Desktop\AndroidStudioProjects\geolocation\android\src\main\kotlin\app\loup\geolocation\GeolocationPlugin.kt: (78, 82): Unresolved reference: binaryMessenger
Finished with error: Gradle task assembleDebug failed with exit code 1
Thanks for the plugin.
I am trying to use it in my app and when I use it and run my app on an iPhone 7 iOS 11.2.5 it throws the following error while running the pod install:
Automatically assigning platform `ios` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile.
I get MissingPluginException when i call Geolocation.enableLocationServices()
flutter: location result: invoke geolocation/location->enableLocationServices []
flutter: ══╡ EXCEPTION CAUGHT BY GEOLOCATION ╞═══════════════════════════════════════════════════════════════
flutter: The following MissingPluginException was thrown while invoking
flutter: geolocation/location/enableLocationServices:
flutter: MissingPluginException(No implementation found for method enableLocationServices on channel
flutter: geolocation/location)
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:154:7)
flutter:
flutter: #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12)
flutter: #2 _invokeChannelMethod (package:geolocation/channel/helper.dart:12:26)
flutter: #3 _LocationChannel.enableLocationServices (package:geolocation/channel/location_channel.dart:60:28)
flutter: #4 Geolocation.enableLocationServices (package:geolocation/geolocation.dart:55:24)
flutter: #5 _MyAppState.enableLocationServices (package:geolocation_example/main.dart:80:17)
flutter: #6 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:779:14)
flutter: #7 _InkResponseState.build. (package:flutter/src/material/ink_well.dart:862:36)
flutter: #8 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
flutter: #9 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:486:11)
flutter: #10 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:264:5)
flutter: #11 BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:199:7)
flutter: #12 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:470:9)
flutter: #13 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:76:12)
flutter: #14 PointerRouter._dispatchEventToRoutes. (package:flutter/src/gestures/pointer_router.dart:117:9)
flutter: #15 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:379:8)
flutter: #16 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:115:18)
flutter: #17 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:101:7)
flutter: #18 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218:19)
flutter: #19 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)
flutter: #20 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
flutter: #21 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
flutter: #22 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
flutter: #26 _invoke1 (dart:ui/hooks.dart:275:10)
flutter: #27 _dispatchPointerDataPacket (dart:ui/hooks.dart:184:5)
I have been evaluating the popular location permission libraries with flutter to see how it matches with the best practices. Below is what I found with your library. Let me know if there are ways to get this to work that I missed.
Android Best Practices
https://developer.android.com/distribute/best-practices/develop/runtime-permissions
https://developer.android.com/training/permissions/requesting
So below is my understanding of the best practices.
if (Location Services Disabled)
A) Show Location Services Dialog
else if (Location Services Enabled)
If(Permission Denied Forever)
B) Show Dialog that says permission denied forever and will show Settings
C) Redirect to app settings
else if(Denied Once && Permission Rational provided)
D) Show Permission Rational
Show Permission Dialog
else
E) Show Permission Dialog
So the library does not support
B. So if permissions are denied forever I would think it would be best to show some sort of dialog before redirecting the user to the settings page. The library does redirect the user to the settings page but let's say I want to show a dialog. I could set openSettingsIfDenied to false but I have no way to discern between denied forever and just denied.
D. The library has no means to show the permission dialog after it was denied once. Which is when the permission rational would be shown. Also android returns when you should show this which the API should expose.
E. I failed this one because if someone denys once they will never see the dialog again.
Summary
I think these are the changes required for users of the library to implement permissions.
Let me know if you need any clarification.
I am building an application for a tutorial that I am writing and I am finding that when I use any of the methods aside from lastKnownLocation()
, I can't get access to the one shot data in the streams using the await for
construct.
From what I can tell based on the documentation, the currentLocation()
method should just be a stream with a single value inside of it and yet when I write something like the block below, the application just sits indefinitely waiting for the stream to complete (I tried adding an onDone and onError to see if there were any problems in that regard).
getLocation() async {
LocationResult location;
Stream<LocationResult> results = Geolocation.currentLocation(
accuracy: LocationAccuracy.best, inBackground: false);
await for (LocationResult data in results) {
location = data;
}
return location;
}
I did a bit of debugging and it seems that the data and location variables stay null the entire time the function is running. Am I just missing something here?
Also, I have a question regarding the lastKnownLocation()
function. Based on the android documentation, it should change with some degree of frequency and yet, even if I turn off the GPS and rebuild the application, the last known location will not change unless I power down the emulator and reboot it. Is this just how it works or is it something else?
=== BUILD TARGET uni_links OF PROJECT Pods WITH CONFIGURATION Release ===
/.pub-cache/hosted/pub.dartlang.org/flutter_webview_plugin-0.1.6/ios/Classes/FlutterWebviewPlugin.m:59:22: warning: incompatible pointer to integer conversion assigning to 'BOOL' (aka 'signed char') from 'id _Nullable' [-Wint-conversion]
_enableAppScheme = call.arguments[@"enableAppScheme"];
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/.pub-cache/hosted/pub.dartlang.org/flutter_webview_plugin-0.1.6/ios/Classes/FlutterWebviewPlugin.m:188:78: warning: values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead [-Wformat]
id data = [FlutterError errorWithCode:[NSString stringWithFormat:@"%ld", error.code]
~~~ ^~~~~~~~~~
%ld (long)
2 warnings generated.
/.pub-cache/hosted/pub.dartlang.org/geolocation-0.2.1/ios/Classes/GeolocationPlugin.m:7:9: fatal error: 'geolocation/geolocation-Swift.h' file not found
#import <geolocation/geolocation-Swift.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
/.pub-cache/hosted/pub.dartlang.org/geolocation-0.2.1/ios/Classes/GeolocationPlugin.m:7:9: fatal error: 'geolocation/geolocation-Swift.h' file not found
#import <geolocation/geolocation-Swift.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
/.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:27:31: warning: 'SFSafariViewController' is only available on iOS 9.0 or newer [-Wunguarded-availability]
- (void)safariViewController:(SFSafariViewController *)controller
^
In module 'SafariServices' imported from /.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:5:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewController.h:27:12: note: 'SFSafariViewController' has been explicitly marked partial here
@interface SFSafariViewController : UIViewController
^
/.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:27:1: note: annotate 'safariViewController:didCompleteInitialLoad:' with an availability attribute to silence this warning
- (void)safariViewController:(SFSafariViewController *)controller
^
/.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:43:40: warning: 'SFSafariViewController' is only available on iOS 9.0 or newer [-Wunguarded-availability]
- (void)safariViewControllerDidFinish:(SFSafariViewController *)controller {
^
In module 'SafariServices' imported from /.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:5:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewController.h:27:12: note: 'SFSafariViewController' has been explicitly marked partial here
@interface SFSafariViewController : UIViewController
^
/.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:43:1: note: annotate 'safariViewControllerDidFinish:' with an availability attribute to silence this warning
- (void)safariViewControllerDidFinish:(SFSafariViewController *)controller {
^
API_AVAILABLE(ios(9.0))
/.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:29:31: warning: comparison between pointer and integer ('NSInteger' (aka 'int') and 'void *')
if (_previousStatusBarStyle != nil) {
~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~
/.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:111:45: warning: comparison between pointer and integer ('NSInteger' (aka 'int') and 'void ')
if (self->_previousStatusBarStyle != nil) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~
/.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:108:18: warning: 'openURL:options:completionHandler:' is only available on iOS 10.0 or newer [-Wunguarded-availability]
[application openURL:url
^~~~~~~~~~~
In module 'UIKit' imported from /NevesSoftware/ns_giftcard2/loyality/ios/Pods/Target Support Files/url_launcher/url_launcher-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:134:1: note: 'openURL:options:completionHandler:' has been explicitly marked partial here
- (void)openURL:(NSURL)url options:(NSDictionary<NSString *, id> *)options completionHandler:(void (^ __nullable)(BOOL success))completion NS_AVAILABLE_IOS(10_0) NS_EXTENSION_UNAVAILABLE_IOS("");
^
/.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:108:18: note: enclose 'openURL:options:completionHandler:' in an@available check to silence this warning
[application openURL:url
^~~~~~~~~~~
/.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:140:3: warning: 'SFSafariViewController' is only available on iOS 9.0 or newer [-Wunguarded-availability]
SFSafariViewController *safari = [[SFSafariViewController alloc] initWithURL:url];
^~~~~~~~~~~~~~~~~~~~~~
In module 'SafariServices' imported from /.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:5:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewController.h:27:12: note: 'SFSafariViewController' has been explicitly marked partial here
@interface SFSafariViewController : UIViewController
^
/.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:140:3: note: enclose 'SFSafariViewController' in an @available check to silence this warning
SFSafariViewController *safari = [[SFSafariViewController alloc] initWithURL:url];
^~~~~~~~~~~~~~~~~~~~~~
/.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:140:38: warning: 'SFSafariViewController' is only available on iOS 9.0 or newer [-Wunguarded-availability]
SFSafariViewController *safari = [[SFSafariViewController alloc] initWithURL:url];
^~~~~~~~~~~~~~~~~~~~~~
In module 'SafariServices' imported from /.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:5:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewController.h:27:12: note: 'SFSafariViewController' has been explicitly marked partial here
@interface SFSafariViewController : UIViewController
^
/.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:140:38: note: enclose 'SFSafariViewController' in an @available check to silence this warning
SFSafariViewController *safari = [[SFSafariViewController alloc] initWithURL:url];
^~~~~~~~~~~~~~~~~~~~~~
7 warnings generated.
/.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:27:31: warning: 'SFSafariViewController' is only available on iOS 9.0 or newer [-Wunguarded-availability]
- (void)safariViewController:(SFSafariViewController *)controller
^
In module 'SafariServices' imported from /.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:5:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewController.h:27:12: note: 'SFSafariViewController' has been explicitly marked partial here
@interface SFSafariViewController : UIViewController
^
/.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:27:1: note: annotate 'safariViewController:didCompleteInitialLoad:' with an availability attribute to silence this warning
- (void)safariViewController:(SFSafariViewController *)controller
^
/.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:43:40: warning: 'SFSafariViewController' is only available on iOS 9.0 or newer [-Wunguarded-availability]
- (void)safariViewControllerDidFinish:(SFSafariViewController *)controller {
^
In module 'SafariServices' imported from /.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:5:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewController.h:27:12: note: 'SFSafariViewController' has been explicitly marked partial here
@interface SFSafariViewController : UIViewController
^
/.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:43:1: note: annotate 'safariViewControllerDidFinish:' with an availability attribute to silence this warning
- (void)safariViewControllerDidFinish:(SFSafariViewController *)controller {
^
API_AVAILABLE(ios(9.0))
/.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:29:31: warning: comparison between pointer and integer ('NSInteger' (aka 'long') and 'void *')
if (_previousStatusBarStyle != nil) {
~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~
/.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:111:45: warning: comparison between pointer and integer ('NSInteger' (aka 'long') and 'void ')
if (self->_previousStatusBarStyle != nil) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~
/.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:108:18: warning: 'openURL:options:completionHandler:' is only available on iOS 10.0 or newer [-Wunguarded-availability]
[application openURL:url
^~~~~~~~~~~
In module 'UIKit' imported from /NevesSoftware/ns_giftcard2/loyality/ios/Pods/Target Support Files/url_launcher/url_launcher-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:134:1: note: 'openURL:options:completionHandler:' has been explicitly marked partial here
- (void)openURL:(NSURL)url options:(NSDictionary<NSString *, id> *)options completionHandler:(void (^ __nullable)(BOOL success))completion NS_AVAILABLE_IOS(10_0) NS_EXTENSION_UNAVAILABLE_IOS("");
^
/.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:108:18: note: enclose 'openURL:options:completionHandler:' in an@available check to silence this warning
[application openURL:url
^~~~~~~~~~~
/.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:140:3: warning: 'SFSafariViewController' is only available on iOS 9.0 or newer [-Wunguarded-availability]
SFSafariViewController *safari = [[SFSafariViewController alloc] initWithURL:url];
^~~~~~~~~~~~~~~~~~~~~~
In module 'SafariServices' imported from /.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:5:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewController.h:27:12: note: 'SFSafariViewController' has been explicitly marked partial here
@interface SFSafariViewController : UIViewController
^
/.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:140:3: note: enclose 'SFSafariViewController' in an @available check to silence this warning
SFSafariViewController *safari = [[SFSafariViewController alloc] initWithURL:url];
^~~~~~~~~~~~~~~~~~~~~~
/.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:140:38: warning: 'SFSafariViewController' is only available on iOS 9.0 or newer [-Wunguarded-availability]
SFSafariViewController *safari = [[SFSafariViewController alloc] initWithURL:url];
^~~~~~~~~~~~~~~~~~~~~~
In module 'SafariServices' imported from /.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:5:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewController.h:27:12: note: 'SFSafariViewController' has been explicitly marked partial here
@interface SFSafariViewController : UIViewController
^
/.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.3/ios/Classes/UrlLauncherPlugin.m:140:38: note: enclose 'SFSafariViewController' in an @available check to silence this warning
SFSafariViewController *safari = [[SFSafariViewController alloc] initWithURL:url];
^~~~~~~~~~~~~~~~~~~~~~
7 warnings generated.
Encountered error while building for device.
philipneves@Philips-MacBook-Pro:~/NevesSoftware/ns_giftcard2/loyality$ flutter run
Launching lib/main.dart on Philip Neves’s iPod in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: HDUGN2FSU6
Running pod install... 2.0s
Starting Xcode build...
Xcode build done. 7.9s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/.pub-cache/hosted/pub.dartlang.org/geolocation-0.2.1/ios/Classes/GeolocationPlugin.m:7:9: fatal error: 'geolocation/geolocation-Swift.h' file not found
#import <geolocation/geolocation-Swift.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Could not build the precompiled application for the device.
If I use firebase_auth
+ geolocation
simultaneously, it crash and dont know what to do. If I use either it runs.
running flutter build ios --release :
=== BUILD TARGET firebase_messaging OF PROJECT Pods WITH CONFIGURATION Release ===
/Users/****/development/flutter/.pub-cache/hosted/pub.dartlang.org/geolocator-0.0.1/ios/Classes/GeolocatorPlugin.m:2:9: fatal error: 'geolocator/geolocator-Swift.h' file not found
#import <geolocator/geolocator-Swift.h>
My doctor output:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel dev, v0.5.5, on Mac OS X 10.13.3 17D102, locale pt-PT)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.io/setup/#android-setup for detailed instructions).
If Android SDK has been installed to a custom location, set $ANDROID_HOME to that location.
[✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
[✗] Android Studio (not installed)
[!] VS Code (version 1.14.2)
[!] Connected devices
! No devices available
hello,
there is severe issue when invoking stream.listen (e.g. in tab_location.dart @~52), it causes such exception, maybe due to an erratic management of id in stream_channel.
regards
Jaco
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.0.1'
}
Crashing when using google-services.
What went wrong:
Failed to capture snapshot of input files for task ':geolocation:compileDebugAidl' property 'importDirs' during up-to-date check.
The library com.google.android.gms:play-services-base is being requested by various other libraries at [[15.0.1,15.0.1]], but resolves to 11.8.0. ...
//////////////////////////////////////////////////
./gradlew :app:dependencies.
releaseCompileClasspath - Resolved configuration for compilation for variant: release
+--- project :geolocation
| *--- com.google.android.gms:play-services-location:[11.4.0,12.0[ -> 15.0.1**
| +--- com.google.android.gms:play-services-base:[15.0.1,16.0.0) -> 15.0.1
| | +--- com.google.android.gms:play-services-basement:[15.0.1] -> 15.0.1
| | | --- com.android.support:support-v4:26.1.0
| | | +--- com.android.support:support-compat:26.1.0
| | | | +--- com.android.support:support-annotations:26.1.0
| | | | --- android.arch.lifecycle:runtime:1.0.0
| | | | +--- android.arch.lifecycle:common:1.0.0
| | | | | --- com.android.support:support-annotations:26.1.0
| | | | +--- android.arch.core:common:1.0.0
| | | | | --- com.android.support:support-annotations:26.1.0
| | | | --- com.android.support:support-annotations:26.1.0
| | | +--- com.android.support:support-media-compat:26.1.0
| | | | +--- com.android.support:support-annotations:26.1.0
| | | | --- com.android.support:support-compat:26.1.0 ()
| | | +--- com.android.support:support-core-utils:26.1.0
| | | | +--- com.android.support:support-annotations:26.1.0
| | | | --- com.android.support:support-compat:26.1.0 ()
| | | +--- com.android.support:support-core-ui:26.1.0
| | | | +--- com.android.support:support-annotations:26.1.0
| | | | --- com.android.support:support-compat:26.1.0 ()
| | | --- com.android.support:support-fragment:26.1.0
| | | +--- com.android.support:support-compat:26.1.0 ()
| | | +--- com.android.support:support-core-ui:26.1.0 ()
| | | --- com.android.support:support-core-utils:26.1.0 ()
| | --- com.google.android.gms:play-services-tasks:[15.0.1] -> 15.0.1
| | --- com.google.android.gms:play-services-basement:[15.0.1] -> 15.0.1 ()
| +--- com.google.android.gms:play-services-basement:[15.0.1,16.0.0) -> 15.0.1 ()
| +--- com.google.android.gms:play-services-places-placereport:[15.0.1,16.0.0) -> 15.0.1
| | --- com.google.android.gms:play-services-basement:[15.0.1,16.0.0) -> 15.0.1 ()
| --- com.google.android.gms:play-services-tasks:[15.0.1,16.0.0) -> 15.0.1 (*)
//////////////////////////////////////////////////////
Any thoughts?
On Android should be available an option to detect mock locations
calling currentLocation on the android emulator will return the last known location - and if a location is not available (eg if you turned off location and then turned it back on), it will return nothing.
It probably should in should try to get the location rather than failing without trying.
Also - in order to test out different locations I have to go to the maps app after changing the emulator location before currentLocation will pick up on the new location,.
I tried to use singleLocationUpdate on android but had the same issues. In light of the above, what is your advice If I want a single updated location.
I was testing this plugin. I ran this code
import 'package:geolocation/geolocation.dart';
find() async {
LocationResult result = await Geolocation.currentLocation(LocationAccuracy.best);
}
I got this error
[VERBOSE-2:dart_error.cc(16)] Unhandled exception:
NoSuchMethodError: No static method '_fromJson' declared in class 'LocationResult'.
Receiver: LocationResult
Tried calling: _fromJson(_LinkedHashMap len:2)
#0 NoSuchMethodError._throwNew (dart:core-patch/dart:core/errors_patch.dart:192)
#1 _Codec.decodeLocation (package:geolocation/channel/codec.dart:8:22)
#2 _Api.currentLocation (package:geolocation/channel/api.dart:20:19)
<asynchronous suspension>
#3 Geolocation.currentLocation (package:geolocation/geolocation.dart:52:12)
<asynchronous suspension>
#4 UserLocation.find (/Users/gorjan/Projects/aero/lib/models/UserLocation.dart:18:47)
<asynchronous suspension>
#5 HomeState.initState (/Users/gorjan/Projects/aero/lib/pages/home.dart:26:26)
#6 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3734:58)
#7 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600:5)
#8 Element.inflateWidget (package:flutter/src/widgets/framework
Testing on iPhone X iOS 11.3
Pubspec
geolocation: "0.1.1"
Hi, thanks for the library.
The Android location class has speed, location and accuracy https://developer.android.com/reference/android/location/Location.html, I presume that iOS has similar https://developer.apple.com/documentation/corelocation/cllocation.
Would you be open to exposing them on the LocationResult
class?
How easy would it be to expose them? I can submit a PR for Android, but won't know what to do for iOS as I have no experience there.
For some reasons, can we make it like a Promise so we can use it with Synchronous coding with await/sync?
Now, this function returns a Stream, right? I hope I can get the value of currentLocation in initState function by using with "await".
Thanks for your time. Let me know if it's not clear for you. Thanks!
The Dart SDK constraints need to be updated to declare compatibility with Dart 2 stable.
It looks like this was fixed in f32b900#diff-fb2d52cd953afedcafc9fe7629c6f132, but never published?
Xcode's output:
↳
The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. Supported values are: 3.0, 4.0, 4.2. This setting can be set in the build settings editor.
I am using the Firebase services but these all seem to use v11.8.0 and I keep getting a "merge dex" Exception. I know I am a bad person for hardcoding your implementation to use
implementation "com.google.android.gms:play-services-location:11.8.0"
Is there a better way to do handle this situation?
From @markflarup on September 5, 2018 8:35
URL: https://pub.dartlang.org/packages/geolocation#-installing-tab-
I want to support geo location in an app, but after adding geolocation: ^0.2.1
as a dependency the following error message is returned:
The current Dart SDK version is 2.1.0-dev.0.0.flutter-be6309690f.
Because [APP] depends on geolocation >=0.1.1 which requires SDK version <2.0.0, version solving failed.
pub get failed (1)
Do you have a estimate for when it will be supported?
Copied from original issue: dart-lang/pub-dev#1580
If the user closes the application or if it shuts off the screen, it is possible to keep recording the user location?
Hello,
I've tried your package expecting to run it in background, but unfortunately it does not work. The example app runs fine while active (printing the logs), and when the Track option is activated and the app lost focus, the log stops to print.
p.s.: i've changed the parameter inBackground from false to true to suposely activate the background service, but no luck with it.
I had to force a higher version for com.google.android.gms. I am currently using 15.0.1, which appears to work. This version is requested by the google maps plugin by google.
To work around this I added the following the build.grade:
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.google.android.gms') {
details.useVersion "15.0.1"
}
}
}
}
This works, but a proper fix would be to raise the upper version bound.
May I suggest changing the version of the google location api to 15.0.1
Failed to build iOS app
Error output from Xcode build:
↳
2018-08-09 09:55:51.479 xcodebuild[43891:331279] warning: file type '::com.apple.instruments.instrdst' is based on missing file type 'default::com.apple.package'
** BUILD FAILED **
Xcode's output:
↳
There hasn't been any progress from the contributor. are you alive @loup-v ?
Current firebase plugins depend on 11.8.0 while geolocation on 12.0.1. Don't know what the resolution is and not a big mobile developer. Tips how this could be resolved?
I can't able to include the plugin in my flutter app. Whenever I'm trying to include the plugin in my pubspec.yml
file I'm getting following error & build is getting fail.
Running "flutter packages get" in bhramaan...
Launching lib/main.dart on Pixel 2 XL in debug mode...
Initializing gradle...
Resolving dependencies...
Running 'gradlew assembleDebug'...
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 6s
Finished with error: Gradle build failed: 1
My pubspec.yml
file dependancises list is
dependencies:
flutter:
sdk: flutter
google_sign_in: "^3.0.4"
firebase_auth: "^0.5.11"
shared_preferences: "^0.4.2"
cloud_firestore: "^0.7.3"
firebase_storage: "^0.3.7"
image_picker: "^0.4.4"
progress_hud: "^1.0.0"
cached_network_image: "^0.4.1+1"
intl: "^0.15.6"
path: "^1.5.1"
geolocation: "^0.2.1"
My app>build.gradle
file content
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 27
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.bhramaan.bhramaan"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
apply plugin: 'com.google.gms.google-services'
My flutter doctor -v
response
➜ bhramaan flutter doctor -v
[✓] Flutter (Channel master, v0.5.2-pre.78, on Mac OS X 10.13.5 17F77, locale en-IN)
• Flutter version 0.5.2-pre.78 at /Users/sureshkumarmajhi/flutter
• Framework revision 3b9b5acefc (2 days ago), 2018-06-07 10:07:52 -0700
• Engine revision fca976d8c7
• Dart version 2.0.0-dev.60.0.flutter-a5e41681e5
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at /Users/sureshkumarmajhi/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 9.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.4, Build version 9F1027a
• ios-deploy 1.9.2
• CocoaPods version 1.5.3
[✓] Android Studio (version 3.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 25.0.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
[!] VS Code (version 1.21.1)
• VS Code at /Users/sureshkumarmajhi/Applications/Visual Studio Code.app/Contents
• Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected devices (1 available)
• Pixel 2 XL • 803KPSL1600646 • android-arm64 • Android 8.1.0 (API 27)
! Doctor found issues in 1 category.
When I build for release with option minifyEnabled true in build-grable,
the plugin crash when I call Geolocation.requestLocationPermission with error:
FATAL:flutter/shell/platform/android/platform_view_android_jni.cc(60)] Check failed: CheckException(env).
for information pubsec.yaml:
cupertino_icons: ^0.1.2
shared_preferences: ^0.4.1
intl: ^0.15.0
intl_translation: ^0.16.7
url_launcher: ^3.0.0
font_awesome_flutter: ^7.0.0
geolocation: ^0.2.1
Hi I just want to understand what background option is for ? Because it feels like wheneve the app get paused by Android the location stream pause also where a timer function normally, I'm trying to get the location and update it on the map but if I press home or recent app for example, Geolocation.locationUpdates
don't output anything. I'm am not talking about update when we close the app on the recent app list because its different from each app etc
I ran the example application provided by the repo and while the first and all subsequent 'Last Known' location works - clicking 'Current' or 'Single Update' only shows 'In progress...'
The error log is as follows:
I/flutter ( 9240): ══╡ EXCEPTION CAUGHT BY GEOLOCATION ╞═══════════════════════════════════════════════════════════════
I/flutter ( 9240): The following PlatformException was thrown while invoking
I/flutter ( 9240): geolocation/location/addLocationUpdatesRequest:
I/flutter ( 9240): PlatformException(error, Expected BEGIN_OBJECT but was STRING at path $.options, null)
I/flutter ( 9240):
I/flutter ( 9240): When the exception was thrown, this was the stack:
I/flutter ( 9240): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:547:7)
I/flutter ( 9240): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:279:18)
I/flutter ( 9240): <asynchronous suspension>
I/flutter ( 9240): #2 _invokeChannelMethod (file:///C:/Users/addis/Downloads/geolocation-master/geolocation-master/lib/channel/helper.dart:12:26)
I/flutter ( 9240): <asynchronous suspension>
I/flutter ( 9240): #3 _LocationChannel.locationUpdates.<anonymous closure> (file:///C:/Users/addis/Downloads/geolocation-master/geolocation-master/lib/channel/location_channel.dart:101:9)
I/flutter ( 9240): #8 _TabLocationState._listenToLocation (file:///C:/Users/addis/Downloads/geolocation-master/geolocation-master/example/lib/tab_location.dart:49:33)
I/flutter ( 9240): #9 _TabLocationState._onCurrentPressed (file:///C:/Users/addis/Downloads/geolocation-master/geolocation-master/example/lib/tab_location.dart:38:5)
I/flutter ( 9240): #10 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102:24)
I/flutter ( 9240): #11 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:161:9)
I/flutter ( 9240): #12 TapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:123:7)
I/flutter ( 9240): #13 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156:27)
I/flutter ( 9240): #14 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:147:20)
I/flutter ( 9240): #15 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:121:22)
I/flutter ( 9240): #16 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:101:7)
I/flutter ( 9240): #17 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:64:7)
I/flutter ( 9240): #18 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:48:7)
I/flutter ( 9240): #19 _invoke1 (dart:ui/hooks.dart:134:13)
I/flutter ( 9240): #20 _dispatchPointerDataPacket (dart:ui/hooks.dart:91:5)
I/flutter ( 9240): (elided 4 frames from package dart:async)
I/flutter ( 9240): ════════════════════════════════════════════════════════════════════════════════════════════════════
I/flutter ( 9240): location result: null
The app was run on the default AVD Nexus 5X device on Android 8.1.
Android O has changed the way things work in the background, and this service will not work on an Android O device in the background.
To reproduce, run the example project on a virtual Android O device, while subscribed to location updates, turn off the screen of the device. Updates stop (actually slow down to about once every 30 minutes) until the screen is turned back on.
Some explanation on diffs would be great :)
I'm experiencing and issue where my app can no longer launch after integrating the geolocation plugin.
I'm seeing the following error:
04-20 10:38:07.162 28097-28097/greensensor.com.greensensor E/AndroidRuntime: FATAL EXCEPTION: main
Process: greensensor.com.greensensor, PID: 28097
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/api/Api$zzf;
at com.google.android.gms.location.LocationServices.(Unknown Source:0)
at com.google.android.gms.location.LocationServices.getFusedLocationProviderClient(Unknown Source:0)
at io.intheloup.geolocation.location.LocationClient.(LocationClient.kt:40)
at io.intheloup.geolocation.GeolocationPlugin.(GeolocationPlugin.kt:14)
at io.intheloup.geolocation.GeolocationPlugin$Companion.registerWith(GeolocationPlugin.kt:57)
at io.intheloup.geolocation.GeolocationPlugin.registerWith(Unknown Source:2)
at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(GeneratedPluginRegistrant.java:29)
at greensensor.com.greensensor.MainActivity.onCreate(MainActivity.java:12)
at android.app.Activity.performCreate(Activity.java:6975)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.api.Api$zzf" on path: DexPathList[[zip file "/data/app/greensensor.com.greensensor-GIph4HLdX8jz_m5c7vM3jQ==/base.apk"],nativeLibraryDirectories=[/data/app/greensensor.com.greensensor-GIph4HLdX8jz_m5c7vM3jQ==/lib/arm64, /system/fake-libs64, /data/app/greensensor.com.greensensor-GIph4HLdX8jz_m5c7vM3jQ==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
...
...
considering the Dex comment in that log, i'm suspecting a Play Services versioning issue, but i'm not sure how to fix that
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.