Closed NumaNumaNuma closed 5 years ago
I'm getting this exact issue every time I launch on my iPhone 6s. It was not happening with the 7.14.1 version of the SDK, only 7.15.0. It means I'm completely unable to test my game without going back to an older version of the SDK (which I didn't seem to be getting any events from - hence why I upgraded). Would also love feedback if anyone else knows what might be wrong!
From Xcode the error appears to be: NSInvalidArgumentException: +[NSError fbErrorWithCode:userInfo:message:underlyingError:]: unrecognized selector sent to class 0x257dd4f80
Any news on this? We're getting the crash even without calling the API at all, just having it as part of the project. We have to remove the sdk completely for now...
I'm not sure if it'll be helpful but it turns out my problem was caused by the FacebookSettings object breaking when I updated the SDK. I just deleted it and made a new one and now everything is working again.
Hey @NumaNumaNuma @BlazingGillian, FB Unity SDK v7.15.1 is released and the issue should be fixed.
Hi @KylinChang, unfortunately I updated to the latest version and the issue is still occurring, the app crashes on launch every time. (It was also happening with 7.14.1 by the way).
Hi @NumaNumaNuma , thanks for your report. Can you provide more details about the iOS device you use, iOS version and maybe more stack traces?
I've seen it happen on a mix of iPhones and iPads running iOS 11.4, 12 and 12.1, so I'm not sure if it's device related (iPad Pro 11" 2018, iPhone X, iPhone XR, iPhone XS Max). The one interesting thing is for the people affected it works fine on wifi, but crashes 99% of the time on cellular. As for stack traces, I don't have anything besides the crash logs reported by xcode (hundreds of the same crash log). Could I email the .xccrashpoint file to you?
@NumaNumaNuma , sure, you can email .xccrashpoint file to me. Thanks for your report again!
@KylinChang Thanks, sent.
I tried using the sdk example scene AppEvents as a test, to rule out anything being caused by my project, and it 's crashing too. I didn't add anything to the scene besides this script to initialise the sdk that I placed on a gameobject in the scene (the example scene didn't have any init code by default). One thing I noticed is I'm getting a warning for calling init twice (in Awake and in OnApplicationPause), not sure if that's a problem?
` public class AnalyticsManager: MonoBehaviour {
void Awake()
{
base.Awake();
InitFBSDK();
}
public void InitFBSDK()
{
if (!FB.IsInitialized)
{
// Initialize the Facebook SDK
FB.Init(InitCallback);
}
else
{
// Already initialized, signal an app activation App Event
FB.ActivateApp();
}
}
public void InitCallback()
{
if (FB.IsInitialized)
{
// Signal an app activation App Event
FB.ActivateApp();
}
else
{
Debug.Log("Failed to Initialize the Analytics SDK");
}
}
private void OnApplicationPause(bool pauseStatus)
{
// Check the pauseStatus to see if we are in the foreground
// or background
if (!pauseStatus)
{
//app resume
if (FB.IsInitialized)
{
FB.ActivateApp();
}
else
{
//Handle FB.Init
FB.Init(InitCallback);
}
}
}
}`
We're seeing the same issue, except for our users it seems disabling wifi and going over 4G works. Maybe it's just something with a change of network connection that temporarily fixes it?
I think whichever is the fastest/slowest is causing problems at init time. Hopefully Kylin finds something in my logs🤞.
@KylinChang Let me know if you want our crash logs as well.
Hi @NumaNumaNuma @kuljaninemir , I think you can add -ObjC
flag in exported xcode project to fix the problem. I will keep this issue open and please let me know if it still crashes with the flag. FYI, here is link about how to add the flag http://docs.onemobilesdk.aol.com/ios-ad-sdk/adding-objc-linker-flag-xcode.html
@KylinChang Thanks, I tried adding the flag, but it causes a link error:
/Libraries/Plugins/iOS/libQuantumCore.a(QuantumCore.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Libraries/Plugins/iOS/libQuantumCore.a' for architecture arm64
I could disable bitcode but I'd rather not. Is there any way around this?
edit: I'll disable bitcode and send to my patient 0, see if the issue is resolved.
All is good on my side and users reported the problem is gone. I'll put a version out to the world and if no one complains then we can call it fixed! @kuljaninemir is it fixed for you too?
I don't have contact with a patient 0 unfortunately so I'll have to push an update with this and see if the crashes stop.
No crashes so far, I think it's fixed! Thanks @KylinChang
Seems to work for us as well, thanks @KylinChang
I have the same issue with my app. Version 7.15.1 Will try to upload next version with -ObjC flag. Sorry, maybe this is stupid question, but why this information is not in instruction with sdk integration?
Why not just add a post processing script to the Unity SDK?
[PostProcessBuild]
public static void OnPostprocessBuild(BuildTarget buildTarget, string path)
{
if (buildTarget == BuildTarget.iOS)
{
string projPath = PBXProject.GetPBXProjectPath(path);
PBXProject proj = new PBXProject();
proj.ReadFromString(File.ReadAllText(projPath));
string targetName = PBXProject.GetUnityTargetName();
string targetGUID = proj.TargetGuidByName(targetName);
proj.AddBuildProperty(targetGUID, "OTHER_LDFLAGS", "-ObjC");
File.WriteAllText(projPath, proj.WriteToString());
}
}
Yes please, That's what I ended up doing, but for others please add it to the post build process.
I am encountering the exact same issue. What you mentioned here of adding the -ObjC did the trick for iPhone, but Apple rejected my binaries because of a crash on an iPad with IOS 12.1.4. Can anyone shed light on this please? I can't figure that out. The moment I go on cellular / flight mode / remove the Facebook SDK the error is gone. On Android everything works perfectly.
@sharonreytan Did you try the solution mentioned above? Are you using any other analytics solutions?
Yes, I added the -ObjC flag. It did solved the issue on my iPhone with IOS 12.1.4 that I test with, but Apple rejected my app, saying that it crashes on load on an iPad with IOS 12.1.4, on wifi. I use Game Analytics SDK in addition to Facebook SDK. The error comes from the Facebook SDK for sure, it is the one that throws the exception that crashes my app. Also, when I remove it everything works well, no crashes. I use Unity 2018.3.3, Facebook SDK 7.15.1 and xcode 10.1. The error happens only when the wifi is connected, with that flag, it happens on iPads but not on iPhones. it is not something in my code.
@KylinChang Can you help here? Do you know if any update is coming up from Facebook?
@sharonreytan can you post the exception here?
I will ask from Apple the crash log. Thank you everyone in advance! :)
I suggest that you connect your app to a platform that catches the crashes, like Unity Analytics or Firebase Crashlytics. Unity Analytics is just one switch away. Even if you fix this crash, it is probably not going to be the only one you are ever going to have. https://unitytech.github.io/clouddiagnostics/UnityCloudDiagnosticsSettingUp.html
I do have such thing, but it doesn't catch that exception. I guess it is thrown on the wrapper level of Unity (the Swift stuff that handles such things like networking... That are OS related)
You can also see the crashes if you go to XCode -> Window -> Organizer -> Crashes (at the top, next to Archives) If they are symbolicated, try this to make them readable https://www.youtube.com/watch?v=kBA7H_uYf34
The problem is that I can't reproduce the error locally, because I don't have an iPad, only an iPhone. Apple alerted me about this issue. As I said, on my iPhone everything works well with the -ObjC flag. The problem persists for iPads on wifi, and I can't simulate this with the simulator
The problem is that I can't reproduce the error locally, because I don't have an iPad, only an iPhone. Apple alerted me about this issue. As I said, on my iPhone everything works well with the -ObjC flag. The problem persists for iPads on wifi, and I can't simulate this with the simulator
The organizer shows all the crashes related to a specific version. https://8mobile.wordpress.com/2015/02/27/xcode-crashes-organizer/
That's great. Thanks. I will add that
@sharonreytan can you please share the crash report as soon as possible? I am actually holding up my build release because of this issue.
Yep for sure. I am stuck with my release as well
Yep for sure. I am stuck with my release as well
Did you find the crash reports?
Not yet, it is a side project of mine
Same crash here :(
@pmusolino Can you post the crash report please?
@sharonreytan It happens randomly. The next time it happens I'll post it
I opened an empty project on Unity. It added a simple 3d cube in it and a particle system to it. I integrated to it the Facebook SDK and GameAnalytics SDK with my original app details. The error persists on that simple app - only on wifi things go wrong and I get a crash. That is the exact same crash I got on the app that I am trying to release. The error persist even if I remove the GameAnalytics SDK I use Unity 2018.3.3, Facebook SDK 7.15.1 and Xcode 10.1. This is the crash log:
2019-03-26 22:31:37.375996+0200 Jumpy[2798:888564] [DYMTLInitPlatform] platform initialization successful
2019-03-26 22:31:37.440830+0200 Jumpy[2798:888345] Built from '2018.3/staging' branch, Version '2018.3.3f1 (393bae82dbb8)', Build type 'Release', Scripting Backend 'il2cpp'
2019-03-26 22:31:37.446308+0200 Jumpy[2798:888345] -> registered mono modules 0x1035eb250
-> applicationDidFinishLaunching()
2019-03-26 22:31:39.096573+0200 Jumpy[2798:888345] Metal GPU Frame Capture Enabled
2019-03-26 22:31:39.098086+0200 Jumpy[2798:888345] Metal API Validation Disabled
2019-03-26 22:31:39.328250+0200 Jumpy[2798:888345] [Warning] Trying to set delaysTouchesBegan to NO on a system gate gesture recognizer - this is unsupported and will have undesired side effects
-> applicationDidBecomeActive()
GfxDevice: creating device client; threaded=1
Initializing Metal device caps: Apple A11 GPU
Initialize engine version: 2018.3.3f1 (393bae82dbb8)
2019-03-26 22:31:39.653020+0200 Jumpy[2798:888616] [avas] AVAudioSessionPortImpl.mm:56:ValidateRequiredFields: Unknown selected data source for Port רמקול (type: Speaker)
2019-03-26 22:31:39.740801+0200 Jumpy[2798:888616] [avas] AVAudioSessionPortImpl.mm:56:ValidateRequiredFields: Unknown selected data source for Port רמקול (type: Speaker)
2019-03-26 22:31:40.107347+0200 Jumpy[2798:888345] +[NSError fbErrorWithCode:userInfo:message:underlyingError:]: unrecognized selector sent to class 0x26fc19f80
2019-03-26 22:31:40.152342+0200 Jumpy[2798:888345] Uncaught exception: NSInvalidArgumentException: +[NSError fbErrorWithCode:userInfo:message:underlyingError:]: unrecognized selector sent to class 0x26fc19f80
(
0 CoreFoundation 0x0000000235d21ebc
I got pretty much the same networkError from facebook happening with my new game:
2019-03-26 19:31:10.325566-0600 gamename[651:128389] +[NSError fbErrorWithCode:userInfo:message:underlyingError:]: unrecognized selector sent to class 0x228d7af80
2019-03-26 19:31:10.380123-0600 gamename[651:128389] Uncaught exception: NSInvalidArgumentException: +[NSError fbErrorWithCode:userInfo:message:underlyingError:]: unrecognized selector sent to class 0x228d7af80
(
0 CoreFoundation 0x00000001ef9a5ebc
Funny though, I have the exact opposite happening. My game works great on WIFI, but as soon I'm on 3G it crashes. The crash report from above is on data 3G on a iPhone SE with iOS 12.2. Apple let it through review...
@KylinChang Can you please have a look? This is a fatal error... I can't release my game because of that. Apple rejects my binaries. Might it be related to iOS >12.1.4?
@elguero44 did you add the -ObjC flag? I guess Apple missed with your app. It seems to happen even on the simplest project. It is something on the FBSDK for Unity. My previous game was also approved and released but I see that there are crashes on iPads. It also had the FBSDK
Are you all seeing this since ios 12.2 / XCode 10.2 was released this week?
I experienced it on iOS 12.1.4 and Xcode 10.1 as well. I will quote apple: "We discovered one or more bugs in your app when reviewed on iPad running iOS 12.1.4 on Wi-Fi.
Specifically, your app launched to a black screen and no further action was produced."
The black screen is the Unity splash screen. This version was submitted for review with the -ObjC flag
Did anyone report this issue to Facebook bug tracker?
@oct-test I did not. Can you please? I am far away from my project at the moment... And they require some stuff I can't gather right now
I'm using the sdk for analytics only. I'm getting rare crashes on app launch for some of our users (Unity 2018.2.19 and iOS 12.1) on 4G only (works fine on wifi). Xcode crash logs show:
At first I thought it was due to FB not being initialized properly but I'm using
private void Awake() { if (FB.IsInitialized) { FB.ActivateApp(); } else { FB.Init(FB.ActivateApp); } }
And I check that FB has been initialised before logging any analytics event.Not sure if I'm doing something wrong or if this is a bug. Would love some feedback either way.
Thanks!