TobiasBuchholz / Plugin.Firebase

Wrapper around the native Android and iOS Firebase Xamarin SDKs
MIT License
220 stars 49 forks source link

Exception Type: EXC_CRASH (SIGABRT) #277

Open bahoss opened 8 months ago

bahoss commented 8 months ago

Hi, i have creta project using this plugin in net 8.

using Microsoft.Extensions.Logging;
using Microsoft.Maui.LifecycleEvents;
using Plugin.Firebase.Auth;
using Plugin.Firebase.Bundled.Shared;

namespace test_project;

#if IOS
using Plugin.Firebase.Bundled.Platforms.iOS;

#elif ANDROID
using Plugin.Firebase.Bundled.Platforms.Android;

#endif

public static class MauiProgram
{
    public static MauiApp CreateMauiApp()
    {
        var builder = MauiApp.CreateBuilder();
        builder
            .UseMauiApp<App>()
            .RegisterFirebaseServices()
            .ConfigureFonts(fonts =>
            {
                fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
                fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
            });

#if DEBUG
        builder.Logging.AddDebug();
#endif

        return builder.Build();
    }

    private static MauiAppBuilder RegisterFirebaseServices(this MauiAppBuilder builder)
    {
        builder.ConfigureLifecycleEvents(events =>
        {
#if IOS
                events.AddiOS(iOS => iOS.WillFinishLaunching((app, launchOptions) =>
                {
                    CrossFirebase.Initialize(CreateCrossFirebaseSettings());
                    return false;
                }));
#else
            events.AddAndroid(android => android.OnCreate((activity, _) =>
                CrossFirebase.Initialize(activity, CreateCrossFirebaseSettings())));
#endif
        });

        builder.Services.AddSingleton(_ => CrossFirebaseAuth.Current);
        return builder;
    }

    private static CrossFirebaseSettings CreateCrossFirebaseSettings()
    {
        return new CrossFirebaseSettings(
     isAuthEnabled: true,
     isCloudMessagingEnabled: true);
    }

}```

On androin its work, but on ios i have this problem 

Translated Report (Full Report Below)

Incident Identifier: 1E56B764-3AC8-4BC3-826F-8A4A4B80782A CrashReporter Key: FFA56D69-1970-4A8E-8D62-A9C01972C60C Hardware Model: Mac14,15 Process: test_project [31119] Path: /Users/USER/Library/Developer/CoreSimulator/Devices/81DA1A11-1AB8-4193-923A-E66D0488EB71/data/Containers/Bundle/Application/EC67C264-8997-4B27-94BE-DB7CED9214E8/test_project.app/test_project Identifier: com.companyname.test_project Version: 1.0 (1) Code Type: X86-64 (Native) Role: Foreground Parent Process: launchd_sim [28941] Coalition: com.apple.CoreSimulator.SimDevice.81DA1A11-1AB8-4193-923A-E66D0488EB71 [11453] Responsible Process: SimulatorTrampoline [942]

Date/Time: 2024-03-16 20:11:18.1011 +0600 Launch Time: 2024-03-16 20:11:14.6222 +0600 OS Version: macOS 14.4 (23E214) Release Type: User Report Version: 104

Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: SIGNAL 6 Abort trap: 6 Terminating Process: test_project [31119]

Triggered by Thread: 3

Thread 0:: tid_103 Dispatch queue: com.apple.main-thread 0 ??? 0x7ff7ffd43380 ??? 1 0x103fe548c ??? 2 ??? 0xffffd5b6d2c00036 ??? 3 JavaScriptCore 0x122842995 pas_segregated_size_directory_get_allocator_from_tlc + 437 4 JavaScriptCore 0x122809c55 bmalloc_heap_config_specialized_try_allocate_common_impl_slow + 437 5 JavaScriptCore 0x1227fbfbf bmalloc_allocate_impl_impl_slow + 47 6 JavaScriptCore 0x1227fb197 bmalloc_allocate_impl_casual_case + 471 7 JavaScriptCore 0x1222f2d38 void std::1::call_once_proxy[abi:sn170006]<std::1::tuple<JSC::Options::initialize()::$_4&&>>(void) + 3208 8 libc++.1.dylib 0x10ddf7cae std::1::call_once(unsigned long volatile&, void, void ()(void)) + 135 9 JavaScriptCore 0x1220be8d5 void std::1::call_once_proxy[abi:sn170006]<std::1::tuple<JSC::initialize()::$_12&&>>(void) + 117 10 libc++.1.dylib 0x10ddf7cae std::1::call_once(unsigned long volatile&, void, void ()(void)) + 135 11 JavaScriptCore 0x1220b08fc JSC::initialize() + 60 12 WebKit 0x10f5606ce WebKit::runInitializationCode(void) + 43 13 libc++.1.dylib 0x10ddf7cae std::1::call_once(unsigned long volatile&, void, void ()(void)) + 135 14 WebKit 0x10f55ea0a WebKit::InitializeWebKit2() + 58 15 WebKit 0x10f648515 -[WKWebViewConfiguration init] + 67 16 WebKit 0x10f60b454 -[WKWebView initWithFrame:] + 26 17 UIKitCore 0x132758791 -[UIView init] + 44 18 FirebaseDynamicLinks 0x10c94e692 -[FIRDLJavaScriptExecutor start] + 253 19 FirebaseDynamicLinks 0x10c94e572 -[FIRDLJavaScriptExecutor initWithDelegate:script:] + 146 20 FirebaseDynamicLinks 0x10c94e364 -[FIRDLDefaultRetrievalProcessV2 fetchLocaleFromWebView] + 61 21 FirebaseDynamicLinks 0x10c9525f8 -[FIRDynamicLinks checkForPendingDynamicLink] + 483 22 FirebaseDynamicLinks 0x10c951c96 39+[FIRDynamicLinks componentsToRegister]_block_invoke + 253 23 FirebaseCore 0x10c06fa28 -[FIRComponentContainer instantiateInstanceForProtocol:withBlock:] + 60 24 FirebaseCore 0x10c06fbef -[FIRComponentContainer instanceForProtocol:] + 232 25 FirebaseCore 0x10c06f92e -[FIRComponentContainer instantiateEagerComponents] + 235 26 FirebaseCore 0x10c06c2a9 +[FIRApp configureWithName:options:] + 790 27 FirebaseCore 0x10c06bee5 +[FIRApp configureWithOptions:] + 89 28 FirebaseCore 0x10c06be7d +[FIRApp configure] + 108 29 libxamarin-dotnet-debug.dylib 0x10e54a099 xamarin_dyn_objc_msgSend + 217 30 libmonosgen-2.0.dylib 0x1118156a2 do_icall + 146 31 libmonosgen-2.0.dylib 0x111813ef7 do_icall_wrapper + 295 32 libmonosgen-2.0.dylib 0x111804c16 mono_interp_exec_method + 3990 33 libmonosgen-2.0.dylib 0x111802383 interp_runtime_invoke + 259 34 libmonosgen-2.0.dylib 0x1118e86f8 mono_runtime_invoke_checked + 136 35 libmonosgen-2.0.dylib 0x1118ecc02 mono_runtime_invoke + 562 36 libxamarin-dotnet-debug.dylib 0x10e54142f xamarin_invoke_trampoline + 6303 37 libxamarin-dotnet-debug.dylib 0x10e548d39 xamarin_arch_trampoline + 105 38 libxamarin-dotnet-debug.dylib 0x10e549f1a xamarin_x86_64_common_trampoline + 118 39 UIKitCore 0x1320ae161 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 184 40 UIKitCore 0x1320aff37 -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 4253 41 UIKitCore 0x1320b5ac0 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1241 42 UIKitCore 0x1313d5b1d -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 122 43 UIKitCore 0x131aca7b1 _UIScenePerformActionsWithLifecycleActionMask + 87 44 UIKitCore 0x1313d667b __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 198 45 UIKitCore 0x1313d60dc -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 249 46 UIKitCore 0x1313d64c4 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 813 47 UIKitCore 0x1313d5cf0 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 341 48 UIKitCore 0x1313e3253 186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 174 49 UIKitCore 0x131976f8c +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:fromCurrentState:actions:completion:] + 865 50 UIKitCore 0x131ae8e2f _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion + 261 51 UIKitCore 0x1313e2ee2 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 347 52 UIKitCore 0x1311b3a27 64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.613 + 877 53 UIKitCore 0x1311b23dc -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 245 54 UIKitCore 0x1311b358f -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 252 55 UIKitCore 0x1320b4300 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 672 56 UIKitCore 0x1319ac42d -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 353 57 FrontBoardServices 0x12ac6fdfe -[FBSScene _callOutQueue_didCreateWithTransitionContext:completion:] + 406 58 FrontBoardServices 0x12aca3a53 92-[FBSWorkspaceScenesClient createSceneWithIdentity:parameters:transitionContext:completion:]_block_invoke.254 + 279 59 FrontBoardServices 0x12ac7fac0 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 213 60 FrontBoardServices 0x12aca374d 92-[FBSWorkspaceScenesClient createSceneWithIdentity:parameters:transitionContext:completion:]_block_invoke + 328 61 libdispatch.dylib 0x12a0c86d8 _dispatch_client_callout + 8 62 libdispatch.dylib 0x12a0cc1e2 _dispatch_block_invoke_direct + 508 63 FrontBoardServices 0x12accf3a7 FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30 64 FrontBoardServices 0x12accf281 -[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible] + 188 65 FrontBoardServices 0x12accf3cf -[FBSMainRunLoopSerialQueue _performNextFromRunLoopSource] + 19 66 CoreFoundation 0x118071ff3 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17 67 CoreFoundation 0x118071f35 CFRunLoopDoSource0 + 157 68 CoreFoundation 0x118071732 CFRunLoopDoSources0 + 215 69 CoreFoundation 0x11806be67 __CFRunLoopRun + 919 70 CoreFoundation 0x11806b6ed CFRunLoopRunSpecific + 557 71 GraphicsServices 0x128e2f08f GSEventRunModal + 137 72 UIKitCore 0x1320b26ee -[UIApplication _run] + 972 73 UIKitCore 0x1320b716e UIApplicationMain + 123 74 libxamarin-dotnet-debug.dylib 0x10e50450a xamarin_UIApplicationMain + 58 75 libmonosgen-2.0.dylib 0x111815765 do_icall + 341 76 libmonosgen-2.0.dylib 0x111813ef7 do_icall_wrapper + 295 77 libmonosgen-2.0.dylib 0x111804c16 mono_interp_exec_method + 3990 78 libmonosgen-2.0.dylib 0x111802383 interp_runtime_invoke + 259 79 libmonosgen-2.0.dylib 0x1118e86f8 mono_runtime_invoke_checked + 136 80 libmonosgen-2.0.dylib 0x1118f003b mono_runtime_exec_main_checked + 107 81 libmonosgen-2.0.dylib 0x111754b62 mono_jit_exec + 354 82 libxamarin-dotnet-debug.dylib 0x10e548bea xamarin_main + 1898 83 test_project 0x10247ce34 main + 68 (main.x86_64.mm:77) 84 dyld_sim 0x10b3023e0 start_sim + 10 85 dyld 0x202c6a366 start + 1942

I try use some other examples with core or bundle platforms...

TobiasBuchholz commented 7 months ago

Hi, sorry for the late response! Could you please provide a sample project that demonstrates this issue? Thanks!