amap-demo / amap-location-flutter Goto Github PK
View Code? Open in Web Editor NEW高德定位Flutter插件
License: BSD 3-Clause "New" or "Revised" License
高德定位Flutter插件
License: BSD 3-Clause "New" or "Revised" License
/Users/Cz/Documents/flutter/.pub-cache/git/amap-location-flutter-1e4a3502b6c5832cfa522b4d74044104120f4c27/ios/Classes/AmapLocatio
nFlutterPlugin.m:86:9: error: use of undeclared identifier 'CLAccuracyAuthorization'
CLAccuracyAuthorization curacyAuthorization = [manager currentAuthorization];
^
/Users/Cz/Documents/flutter/.pub-cache/git/amap-location-flutter-1e4a3502b6c5832cfa522b4d74044104120f4c27/ios/Classes/AmapLocatio
nFlutterPlugin.m:87:18: error: use of undeclared identifier 'curacyAuthorization'
result(@(curacyAuthorization));
^
/Users/Cz/Documents/flutter/.pub-cache/git/amap-location-flutter-1e4a3502b6c5832cfa522b4d74044104120f4c27/ios/Classes/AmapLocatio
nFlutterPlugin.m:183:26: error: no visible @interface for 'AMapFlutterLocationManager' declares the selector
'setLocationAccuracyMode:'
[manager setLocationAccuracyMode:AMapLocationFullAndReduceAccuracy];
~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~
/Users/Cz/Documents/flutter/.pub-cache/git/amap-location-flutter-1e4a3502b6c5832cfa522b4d74044104120f4c27/ios/Classes/AmapLocatio
nFlutterPlugin.m:185:26: error: no visible @interface for 'AMapFlutterLocationManager' declares the selector
'setLocationAccuracyMode:'
[manager setLocationAccuracyMode:AMapLocationFullAccuracy];
~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~
/Users/Cz/Documents/flutter/.pub-cache/git/amap-location-flutter-1e4a3502b6c5832cfa522b4d74044104120f4c27/ios/Classes/AmapLocatio
nFlutterPlugin.m:187:26: error: no visible @interface for 'AMapFlutterLocationManager' declares the selector
'setLocationAccuracyMode:'
[manager setLocationAccuracyMode:AMapLocationReduceAccuracy];
怎么获取周边?
W/System.err(24432): java.lang.NoSuchMethodError: No virtual method getTimingAdvance()I in class Landroid/telephony/CellSignalStrengthGsm; or its super classes (declaration of 'android.telephony.CellSignalStrengthGsm' appears in /system/framework/framework.jar:classes2.dex)
W/System.err(24432): at com.loc.ep.a(CgiManager.java)
W/System.err(24432): at com.loc.ep.a(CgiManager.java)
W/System.err(24432): at com.loc.ep$b.onCellLocationChanged(CgiManager.java)
W/System.err(24432): at android.telephony.PhoneStateListener$1.handleMessage(PhoneStateListener.java:295)
W/System.err(24432): at android.os.Handler.dispatchMessage(Handler.java:102)
W/System.err(24432): at android.os.Looper.loop(Looper.java:159)
W/System.err(24432): at android.os.HandlerThread.run(HandlerThread.java:61)
W/System.err(24432): at com.loc.e$b.run(ApsManager.java)
但不影响定位结果
老铁,pod引入不好使呢,pod失败。还有本地引入能详细点吗
W/System.err(28451): java.net.ConnectException: Failed to connect to /120.77.134.113:443
W/System.err(28451): at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:147)
W/System.err(28451): at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:116)
W/System.err(28451): at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:186)
W/System.err(28451): at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:128)
W/System.err(28451): at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:97)
W/System.err(28451): at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:289)
W/System.err(28451): at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:232)
W/System.err(28451): at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:465)
W/System.err(28451): at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131)
W/System.err(28451): at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:262)
W/System.err(28451): at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:219)
W/System.err(28451): at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:30)
W/System.err(28451): at com.loc.ay.a(Unknown Source:265)
W/System.err(28451): at com.loc.aw.a(Unknown Source:88)
W/System.err(28451): at com.loc.ei.a(Unknown Source:16)
W/System.err(28451): at com.loc.dr.a(Unknown Source:368)
W/System.err(28451): at com.loc.dr.a(Unknown Source:339)
W/System.err(28451): at com.loc.e.b(Unknown Source:165)
W/System.err(28451): at com.loc.e$a.handleMessage(Unknown Source:379)
W/System.err(28451): at android.os.Handler.dispatchMessage(Handler.java:107)
W/System.err(28451): at android.os.Looper.loop(Looper.java:224)
W/System.err(28451): at android.os.HandlerThread.run(HandlerThread.java:67)
W/System.err(28451): at com.loc.e$b.run(Unknown Source:0)
W/System.err(28451): java.net.UnknownHostException: Unable to resolve host "apilocate.amap.com": No address associated with hostname
W/System.err(28451): at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:156)
W/System.err(28451): at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:103)
W/System.err(28451): at java.net.InetAddress.getAllByName(InetAddress.java:1152)
W/System.err(28451): at com.android.okhttp.Dns$1.lookup(Dns.java:41)
W/System.err(28451): at com.android.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:178)
W/System.err(28451): at com.android.okhttp.internal.http.RouteSelector.nextProxy(RouteSelector.java:144)
W/System.err(28451): at com.android.okhttp.internal.http.RouteSelector.next(RouteSelector.java:86)
W/System.err(28451): at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:176)
W/System.err(28451): at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:128)
W/System.err(28451): at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:97)
W/System.err(28451): at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:289)
W/System.err(28451): at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:232)
W/System.err(28451): at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:465)
W/System.err(28451): at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131)
W/System.err(28451): at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:262)
W/System.err(28451): at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:219)
W/System.err(28451): at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:30)
W/System.err(28451): at com.loc.ay.a(Unknown Source:265)
W/System.err(28451): at com.loc.aw.a(Unknown Source:88)
W/System.err(28451): at com.loc.ei.a(Unknown Source:16)
W/System.err(28451): at com.loc.dr.a(Unknown Source:407)
W/System.err(28451): at com.loc.dr.a(Unknown Source:339)
W/System.err(28451): at com.loc.e.b(Unknown Source:165)
W/System.err(28451): at com.loc.e$a.handleMessage(Unknown Source:379)
W/System.err(28451): at android.os.Handler.dispatchMessage(Handler.java:107)
W/System.err(28451): at android.os.Looper.loop(Looper.java:224)
W/System.err(28451): at android.os.HandlerThread.run(HandlerThread.java:67)
W/System.err(28451): at com.loc.e$b.run(Unknown Source:0)
W/System.err(28451): Caused by: android.system.GaiException: android_getaddrinfo failed: EAI_NODATA (No address associated with hostname)
W/System.err(28451): at libcore.io.Linux.android_getaddrinfo(Native Method)
W/System.err(28451): at libcore.io.ForwardingOs.android_getaddrinfo(ForwardingOs.java:74)
W/System.err(28451): at libcore.io.BlockGuardOs.android_getaddrinfo(BlockGuardOs.java:200)
W/System.err(28451): at libcore.io.ForwardingOs.android_getaddrinfo(ForwardingOs.java:74)
W/System.err(28451): at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:135)
W/System.err(28451): ... 27 more
I/flutter (28451): location.address null
现在最新版本是5.0.1+1
❯ pod install
Analyzing dependencies
[!] Unable to find a specification for AMapLocation
depended upon by amap_flutter_location
You have either:
pod repo update
or with pod install --repo-update
.试了很多次都不行
不支持null safe,没办法跑在最新的版本上,希望更新
逆地理编码应该是很常见的需求了吧
能否提供单次定位的例子?我需要设计一个app,只需要在用户注册的时候拉取用户所在的城市和邮政编码,不需要实时追踪用户的位置;或者在用户单击定位时拉取当前位置。
flutter 什么时候能支持自定义widget 的Marker,和InfoWindow,
W/MessageQueue( 4806): Handler (android.location.LocationManager$GpsStatusListenerTransport$1) {2b29c6fa} sending message to a Handler on a dead thread
W/MessageQueue( 4806): java.lang.IllegalStateException: Handler (android.location.LocationManager$GpsStatusListenerTransport$1) {2b29c6fa} sending message to a Handler on a dead thread
W/MessageQueue( 4806): at android.os.MessageQueue.enqueueMessage(MessageQueue.java:325)
W/MessageQueue( 4806): at android.os.Handler.enqueueMessage(Handler.java:631)
W/MessageQueue( 4806): at android.os.Handler.sendMessageAtTime(Handler.java:600)
W/MessageQueue( 4806): at android.os.Handler.sendMessageDelayed(Handler.java:570)
W/MessageQueue( 4806): at android.os.Handler.sendMessage(Handler.java:507)
W/MessageQueue( 4806): at android.location.LocationManager$GpsStatusListenerTransport.onGpsStopped(LocationManager.java:1420)
W/MessageQueue( 4806): at android.location.IGpsStatusListener$Stub.onTransact(IGpsStatusListener.java:57)
W/MessageQueue( 4806): at android.os.Binder.execTransact(Binder.java:446)
如题,有点奇怪。。。。
NoSuchMethodError: The getter 'statusCode' was called on null. 无法定位呀,求方案
执行打包Module 'amap_location_flutter_plugin' not found
iOS真机调试,手机状态显示定位中,无flutter 通道无定位信息返回
我要用到地图定位功能, #使用2.0找不到Amapwidget类? amap_flutter_map: ^1.0.0 #上面是地图的 下面是定位的 amap_flutter_location: ^2.0.0 permission_handler: ^5.0.0
这是我依赖的东西,但是我发现 我不需要 AMapFlutterLocation _locationPlugin = new AMapFlutterLocation();
他的实例_locationPlugin.startlocation()就能定位?我stop也不管用。而且widget里setkey不管用?我尝试在native端设置key生效了,还有 这个///是否单次定位
locationOption.onceLocation = true; 我明明设置了true为什么还是会一直定位,这个方法_onLocationChanged会一直调用。
所以问一下到底是我使用的问题还是啥? 还有 高德开发者平台提供的demo 并没有定位代码里边代码没实现我下载看了
The plugin amap_location_flutter_plugin
requires your app to be migrated to the Android embedding v2. Follow the steps on https://flutter.dev/go/android-project-migration and re-run this command.
I/zygote64(26287): Rejecting re-init on previously-failed class java.lang.Class<com.loc.ea$a>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/telephony/TelephonyManager$CellInfoCallback;
I/zygote64(26287): at void com.loc.dr.a(android.content.Context) (Aps.java:-1)
I/zygote64(26287): at com.loc.dw com.loc.d.b(com.loc.dr) (AmapLocationManager.java:-1)
I/zygote64(26287): at void com.loc.d.d(com.loc.d) (AmapLocationManager.java:-1)
I/zygote64(26287): at void com.loc.d$a.handleMessage(android.os.Message) (AmapLocationManager.java:-1)
I/zygote64(26287): at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:105)
I/zygote64(26287): at void android.os.Looper.loop() (Looper.java:164)
I/zygote64(26287): at void android.os.HandlerThread.run() (HandlerThread.java:65)
I/zygote64(26287): at void com.loc.d$b.run() (AmapLocationManager.java:-1)
I/zygote64(26287): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.telephony.TelephonyManager$CellInfoCallback" on path:
具体可以看看amap_base这个插件,谢谢高德的各位大大
the 'pods-runner' target has transitive dependencies that include statically linked binaries: (xxxx/ios/Pods/AMapLocation/AMapLocationKit.framework)
flutter: 1.22.4
amap_location_flutter_plugin:
git:
url: https://github.com/amap-demo/amap-location-flutter.git
iOS编译不通过,直接报错,注释use_frameworks!不可取,因为其他插件需要依赖
` ///设置Android端的定位模式
///可选值:
///
///设置iOS端的定位最小更新距离<br>
locationOption.distanceFilter = -1;
///设置iOS端期望的定位精度
/// 可选值:<br>
/// <li>[DesiredAccuracy.Best] 最高精度</li>
/// <li>[DesiredAccuracy.BestForNavigation] 适用于导航场景的高精度 </li>
/// <li>[DesiredAccuracy.NearestTenMeters] 10米 </li>
/// <li>[DesiredAccuracy.Kilometer] 1000米</li>
/// <li>[DesiredAccuracy.ThreeKilometers] 3000米</li>
locationOption.desiredAccuracy = DesiredAccuracy.NearestTenMeters;
///设置iOS端是否允许系统暂停定位
locationOption.pausesLocationUpdatesAutomatically = false;
///将定位参数设置给定位插件
_locationPlugin.setLocationOption(locationOption);`
定位之后的 cityCode: , adCode: 不正确,按理应该是行政区域编码吧,不应该是城市名称。
另外是否可以把 省、市、区的adCode(行政区域编码都返回)
iOS端无法获取位置 没有address。安卓有
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.