gpt4 book ai didi

ios - Google Maps SDK for iOS 在发布到 App Store 后崩溃

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:19:38 26 4
gpt4 key购买 nike

我在我的 iOS 应用程序中集成了 Goole Map (v1.5),当我在真实设备 (iPad 4 iOS 6.1) 上以 Debug模式对其进行测试时,它工作正常。

我发布了我的应用程序,但当用户打开 map 时应用程序崩溃了。

我不知道问题出在哪里,为什么会崩溃。

编辑:

崩溃报告:

Exception Type:  EXC_CRASH (SIGABRT)

Exception Codes: 0x0000000000000000, 0x0000000000000000

Crashed Thread: 0


Last Exception Backtrace:

0 CoreFoundation 0x366333e2 __exceptionPreprocess + 158

1 libobjc.A.dylib 0x33b6695e objc_exception_throw + 26

2 CoreFoundation 0x36636dbc +[NSObject(NSObject) doesNotRecognizeSelector:] + 180

3 CoreFoundation 0x36635648 ___forwarding___ + 388

4 CoreFoundation 0x3658d204 _CF_forwarding_prep_0 + 20

5 myApp 0x00053286 -[ELocation loadView] (ELocation.m:45)

6 UIKit 0x309eb414 -[UIViewController loadViewIfRequired] + 64

7 UIKit 0x30a65f7c -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 80

8 UIKit 0x30a65f22 -[UITabBarController transitionFromViewController:toViewController:] + 26

9 UIKit 0x30a100a8 -[UITabBarController _setSelectedViewController:] + 292

10 UIKit 0x30b0569c -[UITabBarController _tabBarItemClicked:] + 268

11 UIKit 0x30ab703a -[UIApplication sendAction:to:from:forEvent:] + 66

12 UIKit 0x30ab6fee -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 26

13 UIKit 0x30b05564 -[UITabBar _sendAction:withEvent:] + 380

14 UIKit 0x30ab703a -[UIApplication sendAction:to:from:forEvent:] + 66

15 UIKit 0x30ab6fee -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 26

16 UIKit 0x30ab6fc8 -[UIControl sendAction:to:forEvent:] + 40

17 UIKit 0x30ab687e -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 498

18 UIKit 0x30ab703a -[UIApplication sendAction:to:from:forEvent:] + 66

19 UIKit 0x30ab6fee -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 26

20 UIKit 0x30ab6fc8 -[UIControl sendAction:to:forEvent:] + 40

21 UIKit 0x30ab687e -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 498

22 UIKit 0x30ab6d6c -[UIControl touchesEnded:withEvent:] + 484

23 UIKit 0x309df5bc -[UIWindow _sendTouchesForEvent:] + 520

24 UIKit 0x309cc8a4 -[UIApplication sendEvent:] + 376

25 UIKit 0x309cc1b2 _UIApplicationHandleEvent + 6194

26 GraphicsServices 0x365465f2 _PurpleEventCallback + 586

27 GraphicsServices 0x36546222 PurpleEventCallback + 30

28 CoreFoundation 0x366083e2 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 30

29 CoreFoundation 0x36608386 __CFRunLoopDoSource1 + 134

30 CoreFoundation 0x3660720a __CFRunLoopRun + 1378

31 CoreFoundation 0x3657a238 CFRunLoopRunSpecific + 352

32 CoreFoundation 0x3657a0c4 CFRunLoopRunInMode + 100

33 GraphicsServices 0x36545336 GSEventRunModal + 70

34 UIKit 0x30a20284 UIApplicationMain + 1116

35 myApp 0x0001277e main (main.m:16)

36 myApp 0x00012734 start + 36



Thread 0 name: Dispatch queue: com.apple.main-thread

Thread 0 Crashed:

0 libsystem_kernel.dylib 0x33e32350 __pthread_kill + 8

1 libsystem_c.dylib 0x376aefb2 pthread_kill + 54

2 libsystem_c.dylib 0x376eb366 abort + 90

3 libc++abi.dylib 0x3144cdda abort_message + 70

4 libc++abi.dylib 0x3144a094 default_terminate() + 20

5 libobjc.A.dylib 0x33b66a58 _objc_terminate() + 144

6 libc++abi.dylib 0x3144a118 safe_handler_caller(void (*)()) + 76

7 libc++abi.dylib 0x3144a1b0 std::terminate() + 16

8 libc++abi.dylib 0x3144b626 __cxa_rethrow + 90

9 libobjc.A.dylib 0x33b669b0 objc_exception_rethrow + 8

10 CoreFoundation 0x3657a29c CFRunLoopRunSpecific + 452

11 CoreFoundation 0x3657a0c4 CFRunLoopRunInMode + 100

12 GraphicsServices 0x36545336 GSEventRunModal + 70

13 UIKit 0x30a20284 UIApplicationMain + 1116

14 myApp 0x0001277e main (main.m:16)

15 myApp 0x00012734 start + 36


Thread 1 name: Dispatch queue: com.apple.libdispatch-manager

Thread 1:

0 libsystem_kernel.dylib 0x33e225d0 kevent64 + 24

1 libdispatch.dylib 0x366c9d22 _dispatch_mgr_invoke + 806

2 libdispatch.dylib 0x366c5374 _dispatch_mgr_thread + 32


Thread 2:

0 libsystem_kernel.dylib 0x33e32d98 __workq_kernreturn + 8

1 libsystem_c.dylib 0x37686ad6 _pthread_workq_return + 14

2 libsystem_c.dylib 0x376867f2 _pthread_wqthread + 362

3 libsystem_c.dylib 0x37686680 start_wqthread + 4


Thread 3 name: WebThread

Thread 3:

0 libsystem_kernel.dylib 0x33e21e30 mach_msg_trap + 20

1 libsystem_kernel.dylib 0x33e21fd0 mach_msg + 48

2 CoreFoundation 0x366082b6 __CFRunLoopServiceMachPort + 126

3 CoreFoundation 0x3660702c __CFRunLoopRun + 900

4 CoreFoundation 0x3657a238 CFRunLoopRunSpecific + 352

5 CoreFoundation 0x3657a0c4 CFRunLoopRunInMode + 100

6 WebCore 0x3898aa58 RunWebThread(void*) + 440

7 libsystem_c.dylib 0x376910de _pthread_start + 306

8 libsystem_c.dylib 0x37690fa4 thread_start + 4


Thread 4:

0 libsystem_kernel.dylib 0x33e32d98 __workq_kernreturn + 8

1 libsystem_c.dylib 0x37686ad6 _pthread_workq_return + 14

2 libsystem_c.dylib 0x376867f2 _pthread_wqthread + 362

3 libsystem_c.dylib 0x37686680 start_wqthread + 4


Thread 5 name: Dispatch queue: com.apple.CoreLocation.ConnectionClient.0x1d8a3f90.events

Thread 5:

0 libsystem_kernel.dylib 0x33e21e98 semaphore_timedwait_trap + 8

1 libdispatch.dylib 0x366c8c16 _dispatch_semaphore_wait_slow + 118

2 CoreLocation 0x32b3a774 CLClientInvokeCallback(__CLClient*, CLClientEvent, objc_object*) + 340

3 CoreLocation 0x32b3ddd8 ___CLClientCreateConnection_block_invoke_0 + 384

4 CoreLocation 0x32b740b8 __setEventHandler_block_invoke_0 + 344

5 libxpc.dylib 0x32457804 _xpc_connection_mach_event + 768

6 libdispatch.dylib 0x366ca688 _dispatch_mach_msg_invoke + 120

7 libdispatch.dylib 0x366c7afa _dispatch_queue_drain + 78

8 libdispatch.dylib 0x366ca92e _dispatch_mach_invoke + 166

9 libdispatch.dylib 0x366c7afa _dispatch_queue_drain + 78

10 libdispatch.dylib 0x366c5678 _dispatch_queue_invoke + 40

11 libdispatch.dylib 0x366c7afa _dispatch_queue_drain + 78

12 libdispatch.dylib 0x366c5678 _dispatch_queue_invoke + 40

13 libdispatch.dylib 0x366c8610 _dispatch_root_queue_drain + 208

14 libdispatch.dylib 0x366c87d4 _dispatch_worker_thread2 + 88

15 libsystem_c.dylib 0x376867ee _pthread_wqthread + 358

16 libsystem_c.dylib 0x37686680 start_wqthread + 4


Thread 0 crashed with ARM Thread State (32-bit):

r0: 0x00000000 r1: 0x00000000 r2: 0x00000000 r3: 0x3ae97524

r4: 0x00000006 r5: 0x3ae97b78 r6: 0x1cdb5a24 r7: 0x2fdf0a34

r8: 0x1cdb5a00 r9: 0x00000300 r10: 0x00000000 r11: 0x00212bc4

ip: 0x00000148 sp: 0x2fdf0a28 lr: 0x376aefb7 pc: 0x33e32350

cpsr: 0x00000010

ELocation.m 加载 View :

- (void)loadView {

_locationManager = [[CLLocationManager alloc] init];

_locationManager.desiredAccuracy = kCLLocationAccuracyBest;

_locationManager.delegate = self;

[_locationManager startUpdatingLocation];

_destLocation = nil;

GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:_locationManager.location.coordinate.latitude longitude:_locationManager.location.coordinate.longitude zoom:12]; //**line 45**

mapView = [GMSMapView mapWithFrame:CGRectZero camera:camera];

mapView.settings.zoomGestures = YES;

mapView.settings.myLocationButton = YES;

mapView.myLocationEnabled = YES;

mapView.delegate = self;

self.view = mapView;

}

最佳答案

当您调用 [_locationManager startUpdatingLocation] 时,您将在位置可用时通过 locationManager:didUpdateLocations: 收到回调,稍后会异步接收。在那之前,_locationManager.location 可能为 nil - 尽管如果您的应用之前已经缓存了位置,则可能不是。

可能对于之前没有运行过应用程序的用户来说是导致崩溃的原因,因为在第 45 行,您假设您有一个有效的位置来创建相机位置。虽然我不确定,因为在 nil 上调用 .coordinate.latitude 应该只返回 0 而不是崩溃。

可能是系统提示您的用户访问其位置,而在他们回答"is"之前尝试访问该位置是导致崩溃的原因。要在您自己的设备上重现该内容,您需要重置您的位置和隐私设置。通过设置 -> 通用 -> 重置 -> 重置位置和隐私来执行此操作。不幸的是,这会为您的所有应用程序和所有隐私选项(即位置、照片、联系人等)重置它。即使您删除并重新安装您的应用程序,iOS 也会记住您之前的回答是"is"。一种更简单的方法可能是尝试临时更改您的包 ID,但您还需要获取新的 Google map key 。

关于ios - Google Maps SDK for iOS 在发布到 App Store 后崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20662167/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com