使用firebase分析运行unity3d应用程序的SIGABRT

时间:2018-01-29 15:15:10

标签: c# ios firebase unity3d firebase-analytics

我在我的应用上使用Firebase Analytics。

我的应用由Unity3d开发,因此我在我的应用上使用了Firebase资源。

版本是:

  • Unity 5.6.1f1
  • Xcode 8.2
  • Firebase Unity sdk 4.4.1
  • Firebase iOS sdk 4.8.2
  • 没有使用CocoaPods(它使我的构建崩溃)

我写了这段代码:

    private void Init()
    {
        FirebaseAnalytics.SetAnalyticsCollectionEnabled(true);

        ALLogger.Info("[Firebase], set signup method to Facebook");
        // Set the user's sign up method.
        FirebaseAnalytics.SetUserProperty(FirebaseAnalytics.UserPropertySignUpMethod, "Facebook");


        // Set the user ID.
        // Max length: 36
        var userName = ALFacebookConnector.UserId;
        var strLength = Math.Min(36, userName.Length);
        ALLogger.Info("[Firebase], set user name, origin:{0}, sliced:{1}", userName, userName.Substring(0, strLength));
        FirebaseAnalytics.SetUserId(userName.Substring(0, strLength));
    }

我遇到了这个崩溃异常:

Fatal Exception: NSInvalidArgumentException
-[__NSCFString fira_UTF32Length]: unrecognized selector sent to instance 0x1708331e0

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x18abf91b8 __exceptionPreprocess
1  libobjc.A.dylib                0x18963055c objc_exception_throw
2  CoreFoundation                 0x18ac00268 __methodDescriptionForSelector
3  CoreFoundation                 0x18abfd270 ___forwarding___
4  CoreFoundation                 0x18aaf680c _CF_forwarding_prep_0
5  AppExample                     0x1023d8f0c +[FIRADataTypeValidator isValidString:minLength:maxLength:type:failureCode:]
6  AppExample                     0x1023d9248 +[FIRADataTypeValidator isValidInternalName:maxLength:type:failureCode:]
7  AppExample                     0x1023d9368 +[FIRADataTypeValidator isValidPublicName:maxLength:type:failureCode:]
8  AppExample                     0x1023d9ad4 +[FIRADataTypeValidator isValidPublicUserAttributeName:failureCode:]
9  AppExample                     0x102412268 +[FIRAnalytics setUserPropertyString:forName:]
10 AppExample                     0x102477724 firebase::analytics::SetUserProperty(char const*, char const*)
11 AppExample                     0x1005c1074 FirebaseAnalyticsPINVOKE_Firebase_Analytics_SetUserProperty_m4176997281 (il2cpp-codegen.h:708)
12 AppExample                     0x1005c0fd4 FirebaseAnalytics_SetUserProperty_m3701051822 (Bulk_Firebase.Analytics_0.cpp:610)

解决此次崩溃的起点在哪里?

0 个答案:

没有答案