facebook / facebook-sdk-for-unity

The facebook sdk for unity.
https://developers.facebook.com/docs/unity
Other
480 stars 256 forks source link

[IOS] Unity Crashes on Startup in [FBSDKInternalUtility validateAppID] + 132 (FBSDKInternalUtility.m:451) #726

Open Vitalii-Dudnyk opened 1 month ago

Vitalii-Dudnyk commented 1 month ago

Checklist

Environment

Goals

The application must be launched with Facebook log in without a crash

Expected Results

The application crashes at startup. I assume it started happening after XCode update to version 15.3. The first launch of the build is successful, but after the 2nd run the crash starts repeating constantly until reinstalling the app. As you can see from the log it happens when I try to call facebook log in API.

Actual Results

0 CoreFoundation 0x196610f20 exceptionPreprocess + 164 (NSException.m:249) 1 libobjc.A.dylib 0x18e4be018 objc_exception_throw + 60 (objc-exception.mm:356) 2 FBSDKCoreKit 0x100e446c0 -[FBSDKInternalUtility validateAppID] + 132 (FBSDKInternalUtility.m:451) 3 FBSDKCoreKit 0x100e44814 -[FBSDKInternalUtility validateURLSchemes] + 36 (FBSDKInternalUtility.m:469) 4 FBSDKLoginKit 0x10118459c LoginManager.logInParameters(configuration:loggingToken:authenticationMethod:) + 408 (LoginManager.swift:514) 5 FBSDKLoginKit 0x101181dec LoginManager.performBrowserLogIn(handler:) + 1072 (LoginManager.swift:665) 6 FBSDKLoginKit 0x10118cb08 LoginManager.logIn() + 92 (LoginManager.swift:272) 7 FBSDKLoginKit 0x10118cb08 specialized LoginManager.logIn(permissions:handler:) + 508 (LoginManager.swift:266) 8 FBSDKLoginKit 0x101180a30 LoginManager.logIn(permissions:handler:) + 12 (:0) 9 FBSDKLoginKit 0x101180a30 LoginManager.commonLogIn(from:configuration:completion:) + 252 (:-1) 10 FBSDKLoginKit 0x101180918 LoginManager.logIn(from:configuration:completion:) + 264 (LoginManager.swift:136) 11 FBSDKLoginKit 0x101180cdc @objc LoginManager.logIn(from:configuration:completion:) + 136 (:0) 12 UnityFramework 0x106d8a5f8 -[FBUnityInterface loginWithTrackingPreference:scope:tracking:nonce:] + 392 (FBUnityInterface.mm:191) 13 UnityFramework 0x106d8b5cc IOSFBLoginWithTrackingPreference + 80 (FBUnityInterface.mm:416) 14 UnityFramework 0x1083c4ebc IOSWrapper_IOSFBLoginWithTrackingPreference_m701FFF9F59A1A14A5E0EE66C1F823739D1EB2E87 + 52 (Facebook.Unity.IOS.cpp:1220) 15 UnityFramework 0x1083c4ebc IOSWrapper_LoginWithTrackingPreference_m288F211613DC218CE2A58288BA73552D3EB59DCE + 84 (Facebook.Unity.IOS.cpp:462) 16 UnityFramework 0x1084528ec InitializeCallback_Invoke_mCAC8FC62470167DC6CC38647B4D3B3B3EC2C685A_inline(InitializeCallback_tD21E2067EC15D768277A58529987B1B92F87E1A5, bool, MethodInfo const) + 20 (Foundation3.cpp:32723) 17 UnityFramework 0x1084528ec FacebookService_OnFacebookInitialized_mC048AF72DD0DE14497F9EFEB0055E4D37570FC20 + 344 (Foundation__3.cpp:25427) 18 UnityFramework 0x1084ffe40 FacebookDelegate_1_Invoke_mBF6BA93033A7B72E328E2BA4C01FC55B970E123B_gshared_inline(FacebookDelegate_1_tC3557293F9F4D8302666EA5C4874312230B814C9, Il2CppObject, MethodInfo const*) + 16 (GenericMethods__12.cpp:36705)

Vitalii-Dudnyk commented 3 weeks ago

This is a similar issue, but it happens only using the iOS SDK, I mean without the Unity SDK layer https://github.com/facebook/facebook-ios-sdk/issues/1745

I tried to call the Init method each session, but it didn't help

I also noticed that the issue happens using a distribution profile. I checked profilers, identifiers, and certificates and found nothing unusual.

We also tried downgrading the SDK version to before 17.0.0 but it didn't help.

Vitalii-Dudnyk commented 2 weeks ago

We reverted the Unity version to 2021.3.31 and tried to delete SKDs: Firebase, Applovin, AppsFlyers, and AppleAuth. Also, we tried to remove the privacy manifest and check other Facebook versions 14 and 16. However, nothing helped.