iOS 앱에서 Firebase를 사용 중이며 프로덕션 용으로 하나, 개발 용으로 두 개의 Firebase 프로젝트가 있습니다. 내 두 .plist 파일은 GoogleService-Info.plist
및 GoogleService-Info-Dev.plist
이며 대상 -> 빌드 설정 -> 기타 스위프트 플래그에서 설정된 플래그를 기반으로 선택할 수있었습니다.앱을 구성 할 때 Firebase 오류가 발생했습니다.
내부 AppDelegate에 didFinishLaunchingWithOptions
: 나는 다른 Cocoapod 프로젝트에 문제가있을 때
#if DEBUG
let buildFor = "DEV"
#else
let buildFor = "PROD"
#endif
let firebasePlistFileName = buildFor == "DEV" ? "GoogleService-Info-Dev" : "GoogleService-Info"
let firebaseOptions = FIROptions(contentsOfFile: NSBundle.mainBundle().pathForResource(firebasePlistFileName, ofType: "plist"))
FIRApp.configureWithOptions(firebaseOptions) // line causing new Firebase error
이 오늘까지 벌금 일하고있다. > 일반 - -> 프레임 워크를 링크 및 라이브러리, 다음 선택을 모두 추가
dyld: Library not loaded: @rpath/OtherPod.framework/OtherPod
Referenced from:
/Users/me/Library/Developer/CoreSimulator/Devices/12345678-E1C4-480F-B1D9-C10823DEA810/data/Containers/Bundle/Application/AE7B6EB0-43AB-CCCC-BBBB-AAAA71BF/MyApp.app/MyApp
Reason: image not found
내가 결국 대상에서 내 응용 프로그램을 선택하여 해당 해결 : 나는 내가 Xcode 프로젝트를 청소 때 일이 시작되거나 삭제 된 파생 데이터 폴더 생각 Workspace
폴더 (7 개의 다른 pod 프로젝트) 안에 넣고 옵션으로 추가 한 것들을 설정하십시오. 그 이후로,이 게시물의 제목에서 설명하는 오류에 직면 봤는데 :
2017-02-10 17:19:29.660 MyApp[12639:182433] +[NSData gtm_dataByGzippingData:error:]: unrecognized selector sent to class 0x10a0442e8
2017-02-10 17:19:29.680 MyApp[12639:182433] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSData gtm_dataByGzippingData:error:]: unrecognized selector sent to class 0x10a0442e8'
*** First throw call stack:
(
0 CoreFoundation 0x0000000109d88d4b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00000001097f121e objc_exception_throw + 48
2 CoreFoundation 0x0000000109df8e44 +[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x0000000109d0e005 ___forwarding___ + 1013
4 CoreFoundation 0x0000000109d0db88 _CF_forwarding_prep_0 + 120
5 MyApp 0x0000000102d73c9d -[FIRNetwork postURL:payload:queue:usingBackgroundSession:completionHandler:] + 331
6 MyApp 0x0000000102d70e72 -[FIRClearcutLogger sendNextPendingRequestWithCompletionHandler:] + 570
7 MyApp 0x0000000102d70918 -[FIRClearcutLogger sendLogsWithCompletionHandler:] + 447
8 libdispatch.dylib 0x000000010a6ab978 _dispatch_call_block_and_release + 12
9 libdispatch.dylib 0x000000010a6d50cd _dispatch_client_callout + 8
10 libdispatch.dylib 0x000000010a6b2e17 _dispatch_queue_serial_drain + 236
11 libdispatch.dylib 0x000000010a6b3b4b _dispatch_queue_invoke + 1073
12 libdispatch.dylib 0x000000010a6b402b _dispatch_queue_override_invoke + 683
13 libdispatch.dylib 0x000000010a6b6385 _dispatch_root_queue_drain + 720
14 libdispatch.dylib 0x000000010a6b6059 _dispatch_worker_thread3 + 123
15 libsystem_pthread.dylib 0x000000010aa3a712 _pthread_wqthread + 1299
16 libsystem_pthread.dylib 0x000000010aa3a1ed start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
나는 adding to the Link Binary with Libraries이 adding to the Other Linker Flags이, 그리고 그들 중 누구도 일하지 않은 등 다양한 수정, 많이 노력했다.
알 수없는 선택기가 될 수있는 대상은 무엇이며 어떻게 변경/제거 할 수 있습니까? 이 문제는 제가 직면 한 초기 문제 (라이브러리가로드되지 않음) 때문일 수 있습니까?
설명을 위해 unrecognized selector sent to class
오류가 발생하면 Xcode 디버그 탐색기에서 스레드 7에 초점을 맞추고 FIRApp.configureWithOptions(firebaseOptions)
행이 강조 표시됩니다.
그때 현재의 오류 - 확약 오래된에서 프로젝트 내용의 대부분을 대체 (별도의 디렉토리에 내 저장소를 복제) 이전 자식 커밋에 복귀하여 임시 수정을 발견
업데이트 루트 디렉터리 내의 응용 프로그램 이름 폴더, 응용 프로그램 이름 .xcodeproj 및 응용 프로그램 이름 .xcworkspace를 포함하여 복사본을 생성합니다. 시뮬레이터 (iOS 10.2를 실행하는 iPhone 7)에서만 테스트했는데 효과가있었습니다. 그런 다음 아이튠즈 커넥트에 성공적으로 빌드를 제출하고 내 디바이스 (아이폰 5c 10.2.1)에서 빌드를 실행할 수 있었지만,이를 삭제하고 Xcode에서 빌드를 실행하려고 시도한 후에 같은 오류가 다시 발생했다. 그러나 은 시뮬레이터에서 실행되는 동안이 발생하지 않았습니다. 이는 물리적 장치와 시뮬레이터 모두에서 발생했기 때문에 초기 오류 시나리오와 대조됩니다.
이것은 내가 처음 게시 한 스택 추적이 시뮬레이터에서 실행중인 앱임을 기억하게했습니다. 장치에서 실행하면 출력이 적어지며 특히 파일/함수 이름이 더 자세한 출력이 아닌 *** First throw call stack:
이후의 내용은 (0x1d01cdf7 0x1c27f077 0x1d022467 0x1d020579 0x1cf453d8 0x31ff3f 0x31d653 0x31d05d 0x1c57d57 0x1c63e63 0x1c5b205 0x1c64391 0x1c65d9f 0x1c65ba7 0x1c877937 0x1c877490)
입니다.
이것은 트릭을 만들었습니다. 두 개의 매개 변수'$ (inherited) '와'-ObjC'는 이미 80-100 개의 다른 라인들 (절반은 프레임 워크)과 함께'Other Linker Flags' 섹션에 있습니다. 꼬투리 탈 통합은 효과가 있었지만 포드 클린은 알 수없는 명령 인 것 같습니다 (포드 버전은 1.2.0 임). 나는 여전히 포드 (pod)를 설치하고 청소하고 빌드하며 더 이상 오류가 발생하지 않습니다. –
@PatNeedham을 들으면서 기쁘다. – iMHitesh