2014-07-08 4 views
0

앱이 출시 될 때 충돌이 발생합니다. 코드는 시뮬레이터에서 완벽하게 실행됩니다. 그러나 iTunes를 통해 .ipa 보관함을 실행하면 앱이 다운됩니다. 아래 오류 로그에서 알 수 있듯이 NSObject는 doesNotRecognizeSelector: 메서드를 호출합니다. 라인 (202)의 에러 로그에 표시되는 행 번호에 의해 지정된대로 범인은 : viewDidLoad: 방법iOS 용 Google지도 SDK를 사용하는 iOS 앱이 예외 코드와 충돌 함 : 0x0000000000000000

self.mapView.mapType = kGMSTypeNormal; 

.

나는이 주석하지만 오류 로그는 단순히로 시작하는 다음 줄을 잡은 : self.mapView 스토리 보드를 통해 구성된 GMSMapView의 출구가 있습니다 마십시오

self.mapView 

.

오류 로그는 다음과 같이

Incident Identifier: 4F7341AD-7C0E-4383-8B40-AED516F165F0 
CrashReporter Key: 6e031db1ca4c291576f3a897221102f0aef6019c 
Hardware Model:  iPhone5,2 
Process:    MyAppName [3224] 
Path:    /var/mobile/Applications/BFF8291E-CB8E-47F3-A43C-32F272C7DEA6/MyAppName.app/MyAppName 
Identifier:   com.vikrambahl.MyAppName 
Version:    1.0 (1.0) 
Code Type:   ARM (Native) 
Parent Process:  launchd [1] 

Date/Time:   2014-07-08 15:33:28.745 +0800 
OS Version:   iOS 7.1.2 (11D257) 
Report Version:  104 

Exception Type: EXC_CRASH (SIGABRT) 
Exception Codes: 0x0000000000000000, 0x0000000000000000 
Triggered by Thread: 0 

Last Exception Backtrace: 
0 CoreFoundation     0x2d876ec6 __exceptionPreprocess + 126 
1 libobjc.A.dylib     0x38011ce2 objc_exception_throw + 34 
2 CoreFoundation     0x2d87a7f2 -[NSObject(NSObject) doesNotRecognizeSelector:] + 198 
3 CoreFoundation     0x2d8790f2 ___forwarding___ + 702 
4 CoreFoundation     0x2d7c8054 _CF_forwarding_prep_0 + 20 
5 MyAppName      0x000208bc -[MainViewController viewDidLoad] (MainViewController.m:202) 
6 UIKit       0x300aca2e -[UIViewController loadViewIfRequired] + 514 
7 UIKit       0x301572e8 -[UINavigationController _layoutViewController:] + 28 
8 UIKit       0x301571fe -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 226 
9 UIKit       0x301567dc -[UINavigationController _startTransition:fromViewController:toViewController:] + 76 
10 UIKit       0x30156504 -[UINavigationController _startDeferredTransitionIfNeeded:] + 568 
11 UIKit       0x30156274 -[UINavigationController __viewWillLayoutSubviews] + 40 
12 UIKit       0x3015620c -[UILayoutContainerView layoutSubviews] + 180 
13 UIKit       0x300a82e0 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 376 
14 QuartzCore      0x2fd24316 -[CALayer layoutSublayers] + 138 
15 QuartzCore      0x2fd1fb3a CA::Layer::layout_if_needed(CA::Transaction*) + 346 
16 QuartzCore      0x2fd4eb48 -[CALayer layoutIfNeeded] + 136 
17 UIKit       0x3012487a -[UIViewController window:setupWithInterfaceOrientation:] + 238 
18 UIKit       0x30122e84 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 3508 
19 UIKit       0x301220c2 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 42 
20 UIKit       0x3012204a -[UIWindow _setRotatableViewOrientation:updateStatusBar:duration:force:] + 90 
21 UIKit       0x30121fe2 -[UIWindow _setRotatableViewOrientation:duration:force:] + 38 
22 UIKit       0x3011a65c __57-[UIWindow _updateToInterfaceOrientation:duration:force:]_block_invoke + 104 
23 UIKit       0x300ae672 -[UIWindow _updateToInterfaceOrientation:duration:force:] + 378 
24 UIKit       0x30121d34 -[UIWindow setAutorotates:forceUpdateInterfaceOrientation:] + 692 
25 UIKit       0x30121804 -[UIViewController _tryBecomeRootViewControllerInWindow:] + 156 
26 UIKit       0x300b35f0 -[UIWindow addRootViewControllerViewIfPossible] + 456 
27 UIKit       0x300b0db4 -[UIWindow _setHidden:forced:] + 300 
28 UIKit       0x3011aa2c -[UIWindow makeKeyAndVisible] + 56 
29 UIKit       0x301176c0 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1816 
30 UIKit       0x30111ca4 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 716 
31 UIKit       0x300adc72 -[UIApplication handleEvent:withNewEvent:] + 3546 
32 UIKit       0x300acdd4 -[UIApplication sendEvent:] + 68 
33 UIKit       0x301113e0 _UIApplicationHandleEvent + 612 
34 GraphicsServices    0x3271ab50 _PurpleEventCallback + 604 
35 GraphicsServices    0x3271a73a PurpleEventCallback + 30 
36 CoreFoundation     0x2d841802 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 30 
37 CoreFoundation     0x2d84179e __CFRunLoopDoSource1 + 342 
38 CoreFoundation     0x2d83ff6a __CFRunLoopRun + 1402 
39 CoreFoundation     0x2d7aa724 CFRunLoopRunSpecific + 520 
40 CoreFoundation     0x2d7aa506 CFRunLoopRunInMode + 102 
41 UIKit       0x30110606 -[UIApplication _run] + 758 
42 UIKit       0x3010b86c UIApplicationMain + 1132 
43 MyAppName      0x00017a98 main (main.m:37) 
44 libdyld.dylib     0x3850fab2 tlv_initializer + 2 

내있는 viewDidLoad 방법은 다음과 같습니다

- (void)viewDidLoad 
{ 
    [super viewDidLoad]; 

    // Ask for My Location data after the map has already been added to the UI. 
    dispatch_async(dispatch_get_main_queue(), ^{ 
     self.mapView.myLocationEnabled = YES; 
    }); 

    // Listen to the myLocation property of GMSMapView. 
    [self.mapView addObserver:self 
        forKeyPath:@"myLocation" 
         options:NSKeyValueObservingOptionNew 
         context:NULL]; 


    self.mapView.mapType = kGMSTypeNormal; 

    self.mapView.accessibilityElementsHidden = NO; 
    self.mapView.settings.compassButton = YES; 
    self.mapView.settings.myLocationButton = YES; 
    self.mapView.delegate = self; 

    //Enter camera settings here 
    GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:self.mapView.myLocation.coordinate.latitude longitude:self.mapView.myLocation.coordinate.longitude zoom:14]; 

    self.mapView.camera = camera; 
} 
+0

위치 좌표를 확인하십시오. 때로는이 유형의 충돌이 발생하지 않았을 때도 있습니다. –

+0

스토리 보드에 사용자 정의 클래스 이름을 입력하는 것을 기억하지 못했지만 NSObject로 남았습니다. – borrrden

+0

GMSMapView라는 사용자 정의 클래스 이름을 추가했습니다. viewDidLoad :에 GMSMapView 속성을 설정하는 순간 iTunes를 통해 업로드 할 때 앱이 충돌하지만 시뮬레이터에서 완벽하게 작동합니다. – svram

답변

2

당신이 당신의 릴리스 빌드에서 디버그 빌드에서 -ObjC을 가지고 있지만하지 않는 것이이 될 수 있을까?

+0

오, 이걸 잊어 버렸어. 배포판에 -ObjC를 추가 한 후 작동하고 "기타 링커 플래그"빌드를 빌드합니다. 고마워, 고마워. – svram

관련 문제