Firebase: Xcode Could not locate configuration file: 'GoogleService-Info.plist' - ios

3 days ago I try to launch my app, but its crashing on startup, I do all steps mentioned in all other questions's answers.
I'm sure of file name exactly: GoogleService-Info.plist , Target Membership is my app I check it, I add file to Copy Bundle Resources and Compile Resources, I clean app and rebuild it, I recreate app on Firebase Console, I restart PC and Xcode, and same error !!
I use firebase for cloud messaging. I import Firebase on AppDelegate, add FirebaseApp.configure() to didFinishLaunchingWithOptions.
What shall I do other than this to get it work ???
2018-03-29 10:54:33.131476+0300 Ajeelk[72808:20293899] 4.11.0 - [Firebase/Core][I-COR000012] Could not locate configuration file: 'GoogleService-Info.plist'.
2018-03-29 10:54:33.131712+0300 Ajeelk[72808:20293899] 4.11.0 - [Firebase/Core][I-COR000005] No app has been configured yet.
2018-03-29 10:54:33.170450+0300 Ajeelk[72808:20293848] *** Terminating app due to uncaught exception 'com.firebase.core', reason: '`[FIRApp configure];` (`FirebaseApp.configure()` in Swift) could not find a valid GoogleService-Info.plist in your project. Please download one from https://console.firebase.google.com/.'
*** First throw call stack:
(
0 CoreFoundation 0x0000000103f4812b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00000001035dcf41 objc_exception_throw + 48
2 CoreFoundation 0x0000000103fbd245 +[NSException raise:format:] + 197
3 Ajeelk 0x0000000101512102 +[FIRApp configure] + 352
4 Ajeelk 0x0000000101451500 _T06Ajeelk11AppDelegateC11applicationSbSo13UIApplicationC_s10DictionaryVySC0E16LaunchOptionsKeyVypGSg022didFinishLaunchingWithH0tF + 240
5 Ajeelk 0x000000010145302a _T06Ajeelk11AppDelegateC11applicationSbSo13UIApplicationC_s10DictionaryVySC0E16LaunchOptionsKeyVypGSg022didFinishLaunchingWithH0tFTo + 186
6 UIKit 0x0000000104fc7bca -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 299
7 UIKit 0x0000000104fc9648 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4113
8 UIKit 0x0000000104fceaeb -[UIApplication _runWithMainScene:transitionContext:completion:] + 1720
9 UIKit 0x00000001053986f8 __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 924
10 UIKit 0x000000010576e4c8 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
11 UIKit 0x00000001053982f1 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 249
12 UIKit 0x0000000105398b6b -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 696
13 UIKit 0x0000000105d16a69 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 262
14 UIKit 0x0000000105d16922 -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 444
15 UIKit 0x00000001059f39c8 __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 221
16 UIKit 0x0000000105bf2b06 _performActionsWithDelayForTransitionContext + 100
17 UIKit 0x00000001059f388b -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 231
18 UIKit 0x000000010576db25 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
19 UIKit 0x0000000104fcd36a -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 523
20 UIKit 0x00000001055a8605 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 369
21 FrontBoardServices 0x000000010bd48cc0 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 338
22 FrontBoardServices 0x000000010bd517b5 __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 235
23 libdispatch.dylib 0x00000001086151ba _dispatch_client_callout + 8
24 libdispatch.dylib 0x000000010861a468 _dispatch_block_invoke_direct + 324
25 FrontBoardServices 0x000000010bd7d498 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
26 FrontBoardServices 0x000000010bd7d14e -[FBSSerialQueue _performNext] + 464
27 FrontBoardServices 0x000000010bd7d6bd -[FBSSerialQueue _performNextFromRunLoopSource] + 45
28 CoreFoundation 0x0000000103eeb101 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
29 CoreFoundation 0x0000000103f8af71 __CFRunLoopDoSource0 + 81
30 CoreFoundation 0x0000000103ecfa19 __CFRunLoopDoSources0 + 185
31 CoreFoundation 0x0000000103ecefff __CFRunLoopRun + 1279
32 CoreFoundation 0x0000000103ece889 CFRunLoopRunSpecific + 409
33 GraphicsServices 0x000000010995a9c6 GSEventRunModal + 62
34 UIKit 0x0000000104fd05d6 UIApplicationMain + 159
35 Ajeelk 0x00000001014586b7 main + 55
36 libdyld.dylib 0x0000000108689d81 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Your Xcode project is overriding the default Xcode copyPlist function to a no-op. Therefore no plist files get copied in the Copy Resource Files section.
Delete the following from Ajeelk.xcodeproj/project.pbxproj:
/* Begin PBXBuildRule section */
048423361F1F829200C5DC6B /* PBXBuildRule */ = {
isa = PBXBuildRule;
compilerSpec = com.apple.compilers.proxy.script;
fileType = text.plist;
isEditable = 1;
outputFiles = (
);
script = "# builtin-copyPlist\n";
};
/* End PBXBuildRule section */

Related

The service configuration is `nil`. You need to configure `Info.plist` or set `defaultServiceConfiguration` before using this method

I'm trying to connect an existing AppSync API to my iOS app.
To perform this, I followed the instructions on this page: https://docs.amplify.aws/cli/graphql-transformer/codegen#ios-usage, but instead of performing:
amplify add api
amplify push
I added my existing AppSync API:
amplify add codegen --apiId XXXXXXXXXXXXXXX
amplify codegen
After running those commands, I added awsconfiguration.json and API.swift to my project.
After performing the setup, I initialized the AppSync client in the AppDelegate file:
import AWSAppSync
#UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var appSyncClient: AWSAppSyncClient?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
do {
// You can choose your database location if you wish, or use the default
let cacheConfiguration = try AWSAppSyncCacheConfiguration()
// AppSync configuration & client initialization
let appSyncConfig = try AWSAppSyncClientConfiguration(appSyncServiceConfig: AWSAppSyncServiceConfig(), cacheConfiguration: cacheConfiguration)
appSyncClient = try AWSAppSyncClient(appSyncConfig: appSyncConfig)
} catch {
print("Error initializing appsync client. \(error)")
}
}
}
It's worth mentioning that I'm using AWS SDK (for DynamoDB using Object Mapper) in my app (the previous SDK, not Amplify yet)
The problem is that when I'm running the app, it immediately crashes.
This is the log message that comes along with the crash:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'The service configuration is `nil`. You need to configure `Info.plist` or set `defaultServiceConfiguration` before using this method.'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff23c7127e __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff513fbb20 objc_exception_throw + 48
2 AWSDynamoDB 0x000000010be77baa __54+[AWSDynamoDBObjectMapper defaultDynamoDBObjectMapper]_block_invoke + 474
3 libdispatch.dylib 0x000000010cb04d48 _dispatch_client_callout + 8
4 libdispatch.dylib 0x000000010cb06297 _dispatch_once_callout + 66
5 AWSDynamoDB 0x000000010be779a4 +[AWSDynamoDBObjectMapper defaultDynamoDBObjectMapper] + 84
6 App 0x000000010a7d0f9c $s22App10GlobalVarsCACycfc + 140
7 App 0x000000010a7ca97c $s22App10GlobalVarsCACycfC + 60
8 App 0x000000010a7fd7e1 $s22App21LoadingViewControllerC5coderACSgSo7NSCoderC_tcfc + 113
9 App 0x000000010a7fd943 $s22App21LoadingViewControllerC5coderACSgSo7NSCoderC_tcfcTo + 51
10 UIKitCore 0x00007fff47cf7268 -[UIClassSwapper initWithCoder:] + 2427
11 UIFoundation 0x00007fff4753d872 UINibDecoderDecodeObjectForValue + 744
12 UIFoundation 0x00007fff4753db19 UINibDecoderDecodeObjectForValue + 1423
13 UIFoundation 0x00007fff4753d57d -[UINibDecoder decodeObjectForKey:] + 251
14 UIKitCore 0x00007fff47cf6531 -[NSCoder(UIIBDependencyInjectionInternal) _decodeObjectsAndTrackChildViewControllerIndexWithParent:forKey:] + 298
15 UIKitCore 0x00007fff47a0e65d -[UIViewController initWithCoder:] + 1419
16 UIKitCore 0x00007fff4795cc16 -[UINavigationController initWithCoder:] + 65
17 UIKitCore 0x00007fff47cf7268 -[UIClassSwapper initWithCoder:] + 2427
18 UIFoundation 0x00007fff4753d872 UINibDecoderDecodeObjectForValue + 744
19 UIFoundation 0x00007fff4753d57d -[UINibDecoder decodeObjectForKey:] + 251
20 UIKitCore 0x00007fff47cfb56f -[UIRuntimeConnection initWithCoder:] + 125
21 UIFoundation 0x00007fff4753d872 UINibDecoderDecodeObjectForValue + 744
22 UIFoundation 0x00007fff4753db19 UINibDecoderDecodeObjectForValue + 1423
23 UIFoundation 0x00007fff4753d57d -[UINibDecoder decodeObjectForKey:] + 251
24 UIKitCore 0x00007fff47cf6336 -[NSCoder(UIIBDependencyInjectionInternal) _decodeObjectsWithSourceSegueTemplate:creator:sender:forKey:] + 450
25 UIKitCore 0x00007fff47cf90a5 -[UINib instantiateWithOwner:options:] + 1145
26 UIKitCore 0x00007fff481f8f24 -[UIStoryboard __reallyInstantiateViewControllerWithIdentifier:creator:storyboardSegueTemplate:sender:] + 279
27 UIKitCore 0x00007fff481f8dcf -[UIStoryboard _instantiateViewControllerWithIdentifier:creator:storyboardSegueTemplate:sender:] + 97
28 UIKitCore 0x00007fff48091ebf -[UIApplication _loadMainStoryboardFileNamed:bundle:] + 167
29 UIKitCore 0x00007fff48092473 -[UIApplication _loadMainInterfaceFile] + 274
30 UIKitCore 0x00007fff48090dff -[UIApplication _runWithMainScene:transitionContext:completion:] + 964
31 UIKitCore 0x00007fff477c576d -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 122
32 UIKitCore 0x00007fff47cb44c1 _UIScenePerformActionsWithLifecycleActionMask + 83
33 UIKitCore 0x00007fff477c627f __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 198
34 UIKitCore 0x00007fff477c5c8e -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 296
35 UIKitCore 0x00007fff477c60ac -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 818
36 UIKitCore 0x00007fff477c5941 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 345
37 UIKitCore 0x00007fff477c9f3f __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke_2 + 178
38 UIKitCore 0x00007fff47bd8c83 +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:actions:completion:] + 865
39 UIKitCore 0x00007fff47cd2dff _UISceneSettingsDiffActionPerformChangesWithTransitionContext + 240
40 UIKitCore 0x00007fff477c9c5a __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 153
41 UIKitCore 0x00007fff47cd2d02 _UISceneSettingsDiffActionPerformActionsWithDelayForTransitionContext + 84
42 UIKitCore 0x00007fff477c9ac8 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 381
43 UIKitCore 0x00007fff476206e7 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke + 657
44 UIKitCore 0x00007fff4761f26c -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 248
45 UIKitCore 0x00007fff47620411 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 210
46 UIKitCore 0x00007fff4808f599 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 535
47 UIKitCore 0x00007fff47bfa7f5 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361
48 FrontBoardServices 0x00007fff365d6165 -[FBSSceneImpl _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 442
49 FrontBoardServices 0x00007fff365fc4d8 __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke.154 + 102
50 FrontBoardServices 0x00007fff365e0c45 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 220
51 FrontBoardServices 0x00007fff365fc169 __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke + 355
52 libdispatch.dylib 0x000000010cb04d48 _dispatch_client_callout + 8
53 libdispatch.dylib 0x000000010cb07cb9 _dispatch_block_invoke_direct + 300
54 FrontBoardServices 0x00007fff3662237e __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30
55 FrontBoardServices 0x00007fff3662206c -[FBSSerialQueue _queue_performNextIfPossible] + 441
56 FrontBoardServices 0x00007fff3662257b -[FBSSerialQueue _performNextFromRunLoopSource] + 22
57 CoreFoundation 0x00007fff23bd4471 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
58 CoreFoundation 0x00007fff23bd439c __CFRunLoopDoSource0 + 76
59 CoreFoundation 0x00007fff23bd3b74 __CFRunLoopDoSources0 + 180
60 CoreFoundation 0x00007fff23bce87f __CFRunLoopRun + 1263
61 CoreFoundation 0x00007fff23bce066 CFRunLoopRunSpecific + 438
62 GraphicsServices 0x00007fff384c0bb0 GSEventRunModal + 65
63 UIKitCore 0x00007fff48092d4d UIApplicationMain + 1621
64 App 0x000000010a841728 main + 72
65 libdyld.dylib 0x00007fff5227ec25 start + 1
66 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Apparently, because I'm using the old version of AWS SDK for iOS, I couldn't use both awsconfiguration.json file and the AWS section in Info.plist file.
In order to solve it, I removed the awsconfiguration.json file from Build Phases -> Copy Bundle Resources, and added the AppSync API details from that file to the Info.plist file:
<key>AWS</key>
<dict>
<key>AppSync</key>
<dict>
<key>Default</key>
<dict>
<key>ApiUrl</key>
<string>https://XXXXXXXXXXXXX.appsync-api.xx-xxxx-x.amazonaws.com/graphql</string>
<key>Region</key>
<string>xx-xxxx-x</string>
<key>AuthMode</key>
<string>API_KEY</string>
<key>ApiKey</key>
<string>XXXXXXXXXXXXX</string>
<key>ClientDatabasePrefix</key>
<string>XXXXXXXX_API_KEY
</dict>
</dict>
...
</dict>

App crashing when App is setting delegate of FirebaseMessaging

My app try to use Firebase remote notification, I followed the Firebase guide. Now my app crashes in AppDelegate where I am trying to set the delegate of Firebase messaging.
Here is the code
[FIRApp configure];
[FIRMessaging messaging].delegate = self;
In the second line it crashes with crash message as given below:
+[FIRInstanceIDCheckinPreferences preferencesFromKeychainContents:]: unrecognized selector sent to class 0x10ef2a538
* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason:
'+[FIRInstanceIDCheckinPreferences preferencesFromKeychainContents:]:
unrecognized selector sent to class 0x10ef2a538'
* First throw call stack: ( 0 CoreFoundation 0x00000001116671e6 exceptionPreprocess + 294 1 libobjc.A.dylib
0x0000000110cfc031 objc_exception_throw + 48 2 CoreFoundation
0x00000001116e86c4 +[NSObject(NSObject) doesNotRecognizeSelector:] +
132 3 CoreFoundation 0x00000001115e9898
___forwarding_ + 1432 4 CoreFoundation 0x00000001115e9278 _CF_forwarding_prep_0 + 120 5 MobilePro Dev
0x000000010ed09af3 -[FIRInstanceIDCheckinStore
cachedCheckinPreferences] + 407 6 MobilePro Dev
0x000000010ed0d73a -[FIRInstanceIDStore resetCredentialsIfNeeded] +
145 7 MobilePro Dev 0x000000010ed0d230
-[FIRInstanceIDStore initWithCheckinStore:tokenStore:delegate:] + 174 8 MobilePro Dev 0x000000010ed0d154
-[FIRInstanceIDStore initWithDelegate:] + 142 9 MobilePro Dev 0x000000010ed10acc -[FIRInstanceIDTokenManager init] + 105 10
MobilePro Dev 0x000000010ed022ae -[FIRInstanceID
setupTokenManager] + 50 11 MobilePro Dev
0x000000010ed0225c -[FIRInstanceID start] + 90 12 libdispatch.dylib
0x0000000114c4f7ec _dispatch_client_callout + 8 13 libdispatch.dylib
0x0000000114c50d64 dispatch_once_f + 285 14 MobilePro Dev
0x000000010ecfefac +[FIRInstanceID instanceID] + 45 15 MobilePro Dev
0x000000010ed26a6a -[FIRMessaging initPrivately] + 38 16 MobilePro
Dev 0x000000010ed26939 25+[FIRMessaging
messaging]_block_invoke + 41 17 libdispatch.dylib
0x0000000114c4f7ec _dispatch_client_callout + 8 18 libdispatch.dylib
0x0000000114c50d64 dispatch_once_f + 285 19 MobilePro Dev
0x000000010ed2690d +[FIRMessaging messaging] + 45 20 MobilePro Dev
0x000000010eaa9ac3 -[AppDelegate
application:didFinishLaunchingWithOptions:] + 323 21 UIKit
0x00000001128d96fb -[UIApplication
_handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 278 22 UIKit 0x00000001128db172
-[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4123 23 UIKit 0x00000001128e05cb
-[UIApplication _runWithMainScene:transitionContext:completion:] + 1677 24 UIKit 0x0000000112ca2f7e
__111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke
+ 866 25 UIKit 0x0000000113075a39 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153 26 UIKit 0x0000000112ca2bba
-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 236 27 UIKit 0x0000000112ca33db
-[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 675 28 UIKit
0x0000000113614614 __82-[_UIApplicationCanvas
_transitionLifecycleStateWithTransitionContext:completion:]_block_invoke
+ 299 29 UIKit 0x00000001136144ae -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 433 30 UIKit 0x00000001132f875d
__125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke
+ 221 31 UIKit 0x00000001134f34b7 _performActionsWithDelayForTransitionContext + 100 32 UIKit 0x00000001132f8627 -[_UICanvasLifecycleSettingsDiffAction
performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]
+ 223 33 UIKit 0x00000001130750e0 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392 34 UIKit 0x00000001128deeac
-[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 515 35
UIKit 0x0000000112eb1bcb
-[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361 36
FrontBoardServices 0x00000001176452f3 -[FBSSceneImpl
_didCreateWithTransitionContext:completion:] + 331 37 FrontBoardServices 0x000000011764dcfa
__56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 225 38
libdispatch.dylib 0x0000000114c4f7ec
_dispatch_client_callout + 8 39 libdispatch.dylib 0x0000000114c54db8 _dispatch_block_invoke_direct + 592 40
FrontBoardServices 0x0000000117679470
__FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 24 41 FrontBoardServices 0x000000011767912e
-[FBSSerialQueue _performNext] + 439 42 FrontBoardServices 0x000000011767968e -[FBSSerialQueue _performNextFromRunLoopSource] +
45 43 CoreFoundation 0x0000000111609bb1
CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17 44 CoreFoundation 0x00000001115ee4af
__CFRunLoopDoSources0 + 271 45 CoreFoundation 0x00000001115eda6f __CFRunLoopRun + 1263 46 CoreFoundation
0x00000001115ed30b CFRunLoopRunSpecific + 635 47 GraphicsServices
0x000000011779ca73 GSEventRunModal + 62 48 UIKit
0x00000001128e2057 UIApplicationMain + 159 49 MobilePro Dev
0x000000010eac56cf main + 111 50 libdyld.dylib
0x0000000114ccc955 start + 1 51 ???
0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with
uncaught exception of type NSException
If you don't use pods, you must to add the objC linker flag for your target.
From the documentation:
"Integrate without CocoaPods
If you don't want to use Cocoapods, you can still take advantage of the Firebase SDKs by importing the frameworks directly.
Download the framework SDK zip. This is a ~1GB file and might take some time to download.
Unzip the file, then review the README for the Frameworks that you want to include in your app.
Add the ObjC linker flag in your Other Linker Settings in your target's build settings."
Link:
https://firebase.google.com/docs/ios/setup
https://developer.apple.com/library/archive/qa/qa1490/_index.html
When you call a delegate, you must ensure that all the required methods of that delegate are written.
Check the following method is called in your Appdelegate.
-(void)messaging:(FIRMessaging *)messaging didReceiveRegistrationToken:(NSString *)fcmToken
{
}
Or ensure that FIRMessagingDelegate is written in your Appdelegate
#interface AppDelegate ()<FIRMessagingDelegate>
You need to change the Firebase configure method.
Call it as,
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 42.0), dispatch_get_main_queue(), ^{
[FIRApp configure];
});
It will solve your issue.
import FirebaseMessaging
FirebaseApp.configure()
Messaging.messaging().delegate = self
//MARK:- Messaging Delegate Method ..............................
func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String) {
let token = Messaging.messaging().fcmToken
print("FCM token: \(token ?? "")")
}

Xcode is giving exception when Ionic 3 app run on ios greater than 9.3

Xcode is giving an exception when Ionic 3 app run on ios greater than 9.3 but 9.3 or below is fine, why?
Giving this trace:
2018-05-04 10:12:51.442622+0500 AfroCoin[3018:45327] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///Users/ApplePro/Library/Developer/CoreSimulator/Devices/13045814-2612-45C9-B223-CFC9C7F84987/data/Containers/Data/Application/5E794874-59EA-4DF6-B824-82B97E52E402/Library/Cookies/io.ionic.afrocoinworldwide.binarycookies
objc[3018]: Class VCWeakObjectHolder is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AVConference.framework/Frameworks/ViceroyTrace.framework/ViceroyTrace (0x1299384d0) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AVConference.framework/AVConference (0x128a64e38). One of the two will be used. Which one is undefined.
2018-05-04 10:13:03.634193+0500 AfroCoin[3018:45327] Apache Cordova native platform version 4.5.3 is starting.
2018-05-04 10:13:03.637288+0500 AfroCoin[3018:45327] Multi-tasking -> Device: YES, App: YES
2018-05-04 10:13:03.777136+0500 AfroCoin[3018:45327] CDVWKWebViewEngine: trying to inject XHR polyfill
2018-05-04 10:13:04.034624+0500 AfroCoin[3018:45327] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<WKWebViewConfiguration 0x7fc776d138a0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key _requiresUserActionForMediaPlayback.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010c2bf1e6 __exceptionPreprocess + 294
1 libobjc.A.dylib 0x000000010a69e031 objc_exception_throw + 48
2 CoreFoundation 0x000000010c2bf0b9 -[NSException raise] + 9
3 Foundation 0x000000010a0bfb47 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 292
4 AfroCoin 0x000000010926df46 __43+[APPBackgroundMode swizzleWKWebViewEngine]_block_invoke + 358
5 AfroCoin 0x0000000109285667 -[CDVWKWebViewEngine pluginInitialize] + 983
6 AfroCoin 0x00000001092d13ab -[CDVViewController registerPlugin:withClassName:] + 315
7 AfroCoin 0x00000001092d0abc -[CDVViewController newCordovaViewWithFrame:] + 1404
8 AfroCoin 0x00000001092d0fc2 -[CDVViewController createGapView] + 354
9 AfroCoin 0x00000001092ce516 -[CDVViewController viewDidLoad] + 566
10 AfroCoin 0x000000010926c196 -[MainViewController viewDidLoad] + 54
11 UIKit 0x000000010f59b191 -[UIViewController loadViewIfRequired] + 1215
12 UIKit 0x000000010f59b5d4 -[UIViewController view] + 27
13 UIKit 0x000000010f469183 -[UIWindow addRootViewControllerViewIfPossible] + 122
14 UIKit 0x000000010f469894 -[UIWindow _setHidden:forced:] + 294
15 UIKit 0x000000012805a136 -[UIWindowAccessibility _orderFrontWithoutMakingKey] + 86
16 UIKit 0x000000010f47c62c -[UIWindow makeKeyAndVisible] + 42
17 AfroCoin 0x00000001092d2e08 -[CDVAppDelegate application:didFinishLaunchingWithOptions:] + 776
18 AfroCoin 0x000000010926bf17 -[AppDelegate application:didFinishLaunchingWithOptions:] + 199
19 UIKit 0x000000010f3ee75b -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 278
20 UIKit 0x000000010f3f01d2 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4123
21 UIKit 0x000000010f3f562b -[UIApplication _runWithMainScene:transitionContext:completion:] + 1677
22 UIKit 0x000000010f7b7e4a _111-[__UICanvasLifecycleMonitor_Compatability scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 866
23 UIKit 0x000000010fb8a909 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
24 UIKit 0x000000010f7b7a86 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 236
25 UIKit 0x000000010f7b82a7 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 675
26 UIKit 0x00000001101294d4 _82-[_UIApplicationCanvas transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 299
27 UIKit 0x000000011012936e -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 433
28 UIKit 0x000000010fe0d62d __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 221
29 UIKit 0x0000000110008387 _performActionsWithDelayForTransitionContext + 100
30 UIKit 0x000000010fe0d4f7 -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 223
31 UIKit 0x000000010fb89fb0 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
32 UIKit 0x000000010f3f3f0c -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 515
33 UIKit 0x000000010f9c6a97 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361
34 FrontBoardServices 0x00000001184402f3 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 331
35 FrontBoardServices 0x0000000118448cfa __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 225
36 libdispatch.dylib 0x000000010d5b8848 _dispatch_client_callout + 8
37 libdispatch.dylib 0x000000010d5bde14 _dispatch_block_invoke_direct + 592
38 FrontBoardServices 0x0000000118474470 _FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK_ + 24
39 FrontBoardServices 0x000000011847412e -[FBSSerialQueue _performNext] + 439
40 FrontBoardServices 0x000000011847468e -[FBSSerialQueue _performNextFromRunLoopSource] + 45
41 CoreFoundation 0x000000010c261bb1 _CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION_ + 17
42 CoreFoundation 0x000000010c2464af __CFRunLoopDoSources0 + 271
43 CoreFoundation 0x000000010c245a6f __CFRunLoopRun + 1263
44 CoreFoundation 0x000000010c24530b CFRunLoopRunSpecific + 635
45 GraphicsServices 0x000000010e1eba73 GSEventRunModal + 62
46 UIKit 0x000000010f3f70b7 UIApplicationMain + 159
47 AfroCoin 0x000000010926be31 main + 65
48 libdyld.dylib 0x000000010d635955 start + 1
49 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
As per my exprience, you need to update your cordova version as its old issue of cordova.
As its deprecated method after iOS 9.0 so either you need to remove _ from that key (_requiresUserActionForMediaPlayback) or update your cordova cli
Update cordova cmd:
$ sudo npm update -g cordova
By updating to latest Cordova CLI will solve your problem of crashing.
For more ref you can find below issue reported on GitHub:
Issue Link : https://github.com/katzer/cordova-plugin-background-mode/issues/264
Hope this will helps.

Firebase [FIRApp configure] crash after pod update

My app was working great and I just have updated my Firebase pods to latest version and I started to get error in AppDelegate for [FIRApp configure];. Below is the crash log. What might be the problem?
Ps. I don't have Analytics in my podfile but it is existing as a folder under pods folder and app works well when I delete [FirApp configure].
Podfile:
pod 'Firebase/Auth'
pod 'GoogleSignIn'
pod 'Firebase/Storage'
pod 'Firebase/Database'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'Firebase/Crash'
pod 'Firebase/RemoteConfig'
pod 'Firebase/AdMob'
Crash log:
2017-10-04 20:38:56.259470+0300 App Name[1833:36427]
[Firebase/Analytics][I-ACS024000] Debug mode is on
2017-10-04 20:38:56.259863+0300 App Name[1833:36427] [Firebase/Analytics][I-ACS023007] Firebase Analytics v.40004000 started
2017-10-04 20:38:56.260640+0300 App Name[1833:36427] [Firebase/Analytics][I-ACS023008] To disable debug logging set the following application argument: -noFIRAnalyticsDebugEnabled (see http:)
2017-10-04 20:38:56.260949+0300 App Name[1833:36427] [Firebase/Analytics][I-ACS023009] Debug logging enabled
2017-10-04 20:38:56.301947+0300 App Name[1833:36333] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '(null) is not class or protocol'
*** First throw call stack:
(
0 CoreFoundation 0x000000010fa161cb __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000011627ff41 objc_exception_throw + 48
2 CoreFoundation 0x000000010fa8ab95 +[NSException raise:format:] + 197
3 App Name 0x000000010ce45798 -[TyphoonComponentFactory(InstanceBuilder) allDefinitionsForType:includeSubclasses:] + 184
4 App Name 0x000000010ce45409 -[TyphoonComponentFactory(InstanceBuilder) definitionForType:orNil:includeSubclasses:] + 121
5 App Name 0x000000010ce477ab -[TyphoonComponentFactory inject:] + 171
6 App Name 0x000000010ce69937 +[TyphoonStartup injectInitialFactoryIntoDelegate:] + 87
7 App Name 0x000000010ce69514 __60+[TyphoonStartup swizzleSetDelegateMethodOnApplicationClass]_block_invoke + 1044
8 App Name 0x000000010d0fa929 -[FIRAuthAppDelegateProxy initWithApplication:] + 1589
9 App Name 0x000000010d0fb304 __41+[FIRAuthAppDelegateProxy sharedInstance]_block_invoke + 78
10 libdispatch.dylib 0x000000011371543c _dispatch_client_callout + 8
11 libdispatch.dylib 0x00000001137169c7 dispatch_once_f + 297
12 App Name 0x000000010d0fb2b4 +[FIRAuthAppDelegateProxy sharedInstance] + 102
13 App Name 0x000000010d0f1852 -[FIRAuth initWithAPIKey:appName:] + 280
14 App Name 0x000000010d0f0cd4 -[FIRAuth initWithApp:] + 151
15 App Name 0x000000010d0f0c13 __23+[FIRAuth authWithApp:]_block_invoke + 51
16 App Name 0x000000010d11793e +[FIRAppAssociationRegistration registeredObjectWithHost:key:creationBlock:] + 354
17 App Name 0x000000010d0f0ba5 +[FIRAuth authWithApp:] + 152
18 App Name 0x000000010d0f07d6 __15+[FIRAuth load]_block_invoke_2 + 144
19 Foundation 0x0000000115ca19c9 -[__NSObserver _doit:] + 303
20 CoreFoundation 0x000000010f9b207c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
21 CoreFoundation 0x000000010f9b1f7a _CFXRegistrationPost + 442
22 CoreFoundation 0x000000010f9b1cc2 ___CFXNotificationPost_block_invoke + 50
23 CoreFoundation 0x000000010f973a32 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1826
24 CoreFoundation 0x000000010f972bac _CFXNotificationPost + 652
25 Foundation 0x0000000115c61842 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
26 App Name 0x000000010d116a6a +[FIRApp sendNotificationsToSDKs:] + 393
27 App Name 0x000000010d115a6d +[FIRApp configureDefaultAppWithOptions:sendingNotifications:] + 302
28 App Name 0x000000010d11570a +[FIRApp configure] + 380
29 App Name 0x000000010c8dcf73 -[AppDelegate application:didFinishLaunchingWithOptions:] + 115
30 UIKit 0x0000000113b0f35a -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 267
31 UIKit 0x0000000113b10db7 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4105
32 UIKit 0x0000000113b16245 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1720
33 UIKit 0x0000000113ed1c6c __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 924
34 UIKit 0x000000011429f3ef +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
35 UIKit 0x0000000113ed1865 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 249
36 UIKit 0x0000000113ed20c3 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 668
37 UIKit 0x000000011482fc11 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 262
38 UIKit 0x000000011482faca -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 444
39 UIKit 0x000000011451db9c __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 420
40 UIKit 0x0000000114718c3e _performActionsWithDelayForTransitionContext + 100
41 UIKit 0x000000011451d998 -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 231
42 UIKit 0x000000011429ea4c -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
43 UIKit 0x0000000113b14ac6 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 523
44 UIKit 0x00000001140dd523 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 369
45 FrontBoardServices 0x000000011b1da158 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 338
46 FrontBoardServices 0x000000011b1e2c4d __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 235
47 libdispatch.dylib 0x000000011371543c _dispatch_client_callout + 8
48 libdispatch.dylib 0x000000011371aaf4 _dispatch_block_invoke_direct + 592
49 FrontBoardServices 0x000000011b20e672 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
50 FrontBoardServices 0x000000011b20e328 -[FBSSerialQueue _performNext] + 464
51 FrontBoardServices 0x000000011b20e897 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
52 CoreFoundation 0x000000010f9b92b1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
53 CoreFoundation 0x000000010fa58d31 __CFRunLoopDoSource0 + 81
54 CoreFoundation 0x000000010f99dc19 __CFRunLoopDoSources0 + 185
55 CoreFoundation 0x000000010f99d1ff __CFRunLoopRun + 1279
56 CoreFoundation 0x000000010f99ca89 CFRunLoopRunSpecific + 409
57 GraphicsServices 0x0000000117fdf9c6 GSEventRunModal + 62
58 UIKit 0x0000000113b17d30 UIApplicationMain + 159
59 App Name 0x000000010c8e1b4f main + 111
60 libdyld.dylib 0x0000000113791d81 start + 1
61 ??? 0x0000000000000002 0x0 + 2
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

Xcode Console saying Firebase is not configured

I don't know why this isn't working my Firebase is configured.
Here is a Screenshot of my AppDelegate.swift file. Here is my console log:
2017-05-29 17:52:53.141 Study M8[31592] <Error> [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add [FIRApp configure] to your application initialization. Read more: https://firebase.google.com/docs/ios/setup#initialize_firebase_in_your_app.
2017-05-29 17:52:53.184 Study M8[31592:1051241] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'The default FIRApp instance must be configured before the default FIRAuthinstance can be initialized. One way to ensure that is to call `[FIRApp configure];` is called in `application:didFinishLaunchingWithOptions:`.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010a445b0b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000109eaa141 objc_exception_throw + 48
2 CoreFoundation 0x000000010a4ae625 +[NSException raise:format:] + 197
3 Study M8 0x0000000108550a84 +[FIRAuth auth] + 88
4 Study M8 0x00000001084e7a77 _TFC8Study_M810MessagesVCcfT5coderCSo7NSCoder_GSqS0__ + 279
5 Study M8 0x00000001084e7bcd _TToFC8Study_M810MessagesVCcfT5coderCSo7NSCoder_GSqS0__ + 45
6 UIKit 0x000000010ac70f54 -[UIClassSwapper initWithCoder:] + 246
7 UIKit 0x000000010ae614af UINibDecoderDecodeObjectForValue + 693
8 UIKit 0x000000010ae6164d UINibDecoderDecodeObjectForValue + 1107
9 UIKit 0x000000010ae611ef -[UINibDecoder decodeObjectForKey:] + 89
10 UIKit 0x000000010aa07267 -[UIViewController initWithCoder:] + 1421
11 UIKit 0x000000010aa5cee5 -[UITabBarController initWithCoder:] + 65
12 UIKit 0x000000010ae614af UINibDecoderDecodeObjectForValue + 693
13 UIKit 0x000000010ae611ef -[UINibDecoder decodeObjectForKey:] + 89
14 UIKit 0x000000010ac70c20 -[UIRuntimeConnection initWithCoder:] + 178
15 UIKit 0x000000010ae614af UINibDecoderDecodeObjectForValue + 693
16 UIKit 0x000000010ae6164d UINibDecoderDecodeObjectForValue + 1107
17 UIKit 0x000000010ae611ef -[UINibDecoder decodeObjectForKey:] + 89
18 UIKit 0x000000010ac6fe1d -[UINib instantiateWithOwner:options:] + 1262
19 UIKit 0x000000010b02882f -[UIStoryboard instantiateViewControllerWithIdentifier:] + 181
20 UIKit 0x000000010a8688d1 -[UIApplication _loadMainStoryboardFileNamed:bundle:] + 108
21 UIKit 0x000000010a868db3 -[UIApplication _loadMainInterfaceFile] + 260
22 UIKit 0x000000010a867456 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1407
23 UIKit 0x000000010a864793 -[UIApplication workspaceDidEndTransaction:] + 182
24 FrontBoardServices 0x000000010d3205f6 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
25 FrontBoardServices 0x000000010d32046d -[FBSSerialQueue _performNext] + 186
26 FrontBoardServices 0x000000010d3207f6 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
27 CoreFoundation 0x000000010a3ebc01 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
28 CoreFoundation 0x000000010a3d10cf __CFRunLoopDoSources0 + 527
29 CoreFoundation 0x000000010a3d05ff __CFRunLoopRun + 911
30 CoreFoundation 0x000000010a3d0016 CFRunLoopRunSpecific + 406
31 UIKit 0x000000010a86302f -[UIApplication _run] + 468
32 UIKit 0x000000010a8690d4 UIApplicationMain + 159
33 Study M8 0x00000001084e8997 main + 55
34 libdyld.dylib 0x000000010ca5665d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
If anyone has any idea what to do plz help.
Does GoogleService-Info.plist show up as checked for the build target in the Xcode Target Membership pane?
There was a problem with the plist file, after replacing it everything worked fine. Thank you to everyone who helped.
Did you add the .plist Firebase configuration file that you get from the Firebase website when configuring your app?
The solution is already shown in the error message. Please visit the read and follow the link below. Your problem will be solved.
Add firebase to your iOS project

Resources