firebase / firebase-unity-sdk

The Firebase SDK for Unity
http://firebase.google.com
Apache License 2.0
234 stars 38 forks source link

[Bug] Mac editor crashes #1100

Closed ChurikiTenna closed 2 months ago

ChurikiTenna commented 3 months ago

Description

The app is running fine on Mac,Windows,iOS,Android,Windows Editor. However, when I try to run it on Mac Editor, it always crashes.

Reproducing the issue

Add Firebase SDK to the project and write any code that calls firestore, run it on Mac editor. Firebase auth works fine

Firebase Unity SDK Version

12.2.0

Unity editor version

2020.3.17f1

Installation Method

.unitypackage

Problematic Firebase Component(s)

Firestore

Other Firebase Component(s) in use

Authentication, Firestore, Storage

Additional SDKs you are using

No response

Targeted Platform(s)

Desktop

Unity editor platform

Mac

Scripting Runtime

Mono

Release Distribution Type

Pre-built SDK from https://firebase.google.com/download/unity

Relevant Log Output

=================================================================
    Telemetry Dumper:
=================================================================
Thread 0x389567000 may have been prematurely finalized* Assertion at mono-threads.c:702, condition `info' not met, function:mono_thread_info_current, 

An error has occured in the native fault reporting. Some diagnostic information will be unavailable.

=================================================================
    Native stacktrace:
=================================================================
    0x17ed8724c - /Applications/Unity/Hub/Editor/2022.3.17f1/Unity.app/Contents/Frameworks/MonoBleedingEdge/MonoEmbedRuntime/osx/libmonobdwgc-2.0.dylib : mono_dump_native_crash_info
    0x17eee05b0 - /Applications/Unity/Hub/Editor/2022.3.17f1/Unity.app/Contents/Frameworks/MonoBleedingEdge/MonoEmbedRuntime/osx/libmonobdwgc-2.0.dylib : monoeg_assertion_message
    0x17eed4258 - /Applications/Unity/Hub/Editor/2022.3.17f1/Unity.app/Contents/Frameworks/MonoBleedingEdge/MonoEmbedRuntime/osx/libmonobdwgc-2.0.dylib : mono_thread_info_list_head
    0x17eed597c - /Applications/Unity/Hub/Editor/2022.3.17f1/Unity.app/Contents/Frameworks/MonoBleedingEdge/MonoEmbedRuntime/osx/libmonobdwgc-2.0.dylib : mono_thread_info_is_async_context
    0x17ee7d048 - /Applications/Unity/Hub/Editor/2022.3.17f1/Unity.app/Contents/Frameworks/MonoBleedingEdge/MonoEmbedRuntime/osx/libmonobdwgc-2.0.dylib : mono_threads_summarize
    0x17ed87494 - /Applications/Unity/Hub/Editor/2022.3.17f1/Unity.app/Contents/Frameworks/MonoBleedingEdge/MonoEmbedRuntime/osx/libmonobdwgc-2.0.dylib : mono_dump_native_crash_info
    0x17ed49748 - /Applications/Unity/Hub/Editor/2022.3.17f1/Unity.app/Contents/Frameworks/MonoBleedingEdge/MonoEmbedRuntime/osx/libmonobdwgc-2.0.dylib : mono_handle_native_crash
    0x17ecd1e28 - /Applications/Unity/Hub/Editor/2022.3.17f1/Unity.app/Contents/Frameworks/MonoBleedingEdge/MonoEmbedRuntime/osx/libmonobdwgc-2.0.dylib : mono_sigsegv_signal_handler_debug
    0x188729a24 - /usr/lib/system/libsystem_platform.dylib : _sigtramp
    0x3d7c62244 - /Users/tenna/Desktop/ai_chara/unity/AIChara-App/Assets/Firebase/Plugins/x86_64/FirebaseCppApp-12_2_0.bundle : _ZN9grpc_core9Timestamp3NowEv
    0x3d814573c - /Users/tenna/Desktop/ai_chara/unity/AIChara-App/Assets/Firebase/Plugins/x86_64/FirebaseCppApp-12_2_0.bundle : _ZL11timer_checkPN9grpc_core9TimestampE
    0x3d8144f80 - /Users/tenna/Desktop/ai_chara/unity/AIChara-App/Assets/Firebase/Plugins/x86_64/FirebaseCppApp-12_2_0.bundle : _Z16grpc_timer_checkPN9grpc_core9TimestampE
    0x3d8148288 - /Users/tenna/Desktop/ai_chara/unity/AIChara-App/Assets/Firebase/Plugins/x86_64/FirebaseCppApp-12_2_0.bundle : _ZL15timer_main_loopv
    0x3d8148214 - /Users/tenna/Desktop/ai_chara/unity/AIChara-App/Assets/Firebase/Plugins/x86_64/FirebaseCppApp-12_2_0.bundle : _ZL12timer_threadPv
#1  0x000003d1b52cc0 in absl::string_view::string_view(char const*)
Thread 0x31ddc7000 may have been prematurely finalized  0x3d861f4a0 - /Users/tenna/Desktop/ai_chara/unity/AIChara-App/Assets/Firebase/Plugins/x86_64/FirebaseCppApp-12_2_0.bundle : _ZZN9grpc_core12_GLOBAL__N_120ThreadInternalsPosixC1EPKcPFvPvES4_PbRKNS_6Thread7OptionsEENKUlS4_E_clES4_
#2  0x000003d1b52c2c in absl::string_view::string_view(char const*)
Thread 0x31ddc7000 may have been prematurely finalized  0x3d861f394 - /Users/tenna/Desktop/ai_chara/unity/AIChara-App/Assets/Firebase/Plugins/x86_64/FirebaseCppApp-12_2_0.bundle : _ZZN9grpc_core12_GLOBAL__N_120ThreadInternalsPosixC1EPKcPFvPvES4_PbRKNS_6Thread7OptionsEENUlS4_E_8__invokeES4_
    0x1886fa034 - /usr/lib/system/libsystem_pthread.dylib : _pthread_start
    0x1886f4e3c - /usr/lib/system/libsystem_pthread.dylib : thread_start
#3  0x000003d1835e9c in grpc_core::RemoveGrpcInternalArgs(grpc_channel_args const*)
Thread 0x31ddc7000 may have been prematurely finalized#4  0x000003d18e9a68 in decltype(static_cast<grpc_channel_args const* (*&>(fp)(static_cast<grpc_channel_args const*>(fp0))) std::__1::__invoke<grpc_channel_args const* (*&)(grpc_channel_args const*), grpc_channel_args const*>(grpc_channel_args const* (*&)(grpc_channel_args const*), grpc_channel_args const*&&)
Thread 0x31ddc7000 may have been prematurely finalized#5  0x000003d18e9a10 in grpc_channel_args const* std::__1::__invoke_void_return_wrapper<grpc_channel_args const*, false>::__call<grpc_channel_args const* (*&)(grpc_channel_args const*), grpc_channel_args const*>(grpc_channel_args const* (*&)(grpc_channel_args const*), grpc_channel_args const*&&)
Thread 0x31ddc7000 may have been prematurely finalized#6  0x000003d18e99bc in std::__1::__function::__alloc_func<grpc_channel_args const* (*)(grpc_channel_args const*), std::__1::allocator<grpc_channel_args const* (*)(grpc_channel_args const*)>, grpc_channel_args const* (grpc_channel_args const*)>::operator()(grpc_channel_args const*&&)
Thread 0x31ddc7000 may have been prematurely finalized#7  0x000003d18e8378 in std::__1::__function::__func<grpc_channel_args const* (*)(grpc_channel_args const*), std::__1::allocator<grpc_channel_args const* (*)(grpc_channel_args const*)>, grpc_channel_args const* (grpc_channel_args const*)>::operator()(grpc_channel_args const*&&)
Thread 0x31ddc7000 may have been prematurely finalized
=================================================================
    External Debugger Dump:
=================================================================
#8  0x000003d7fe4c44 in std::__1::__function::__value_func<grpc_core::ChannelArgs (grpc_core::ChannelArgs)>::operator()[abi:v160006](grpc_core::ChannelArgs&&) const
Thread 0x31ddc7000 may have been prematurely finalized#9  0x000003d7fe2af8 in std::__1::function<grpc_core::ChannelArgs (grpc_core::ChannelArgs)>::operator()(grpc_core::ChannelArgs) const
Thread 0x31ddc7000 may have been prematurely finalized#10 0x000003d7fe2994 in grpc_core::ChannelArgsPreconditioning::PreconditionChannelArgs(grpc_channel_args const*) const
Thread 0x31ddc7000 may have been prematurely finalized#11 0x000003d7dfe394 in grpc_channel_create
Thread 0x31ddc7000 may have been prematurely finalized#12 0x000003d7c46a0c in grpc::SecureChannelCredentials::CreateChannelWithInterceptors(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, grpc::ChannelArguments const&, std::__1::vector<std::__1::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface, std::__1::default_delete<grpc::experimental::ClientInterceptorFactoryInterface>>, std::__1::allocator<std::__1::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface, std::__1::default_delete<grpc::experimental::ClientInterceptorFactoryInterface>>>>)
Thread 0x31ddc7000 may have been prematurely finalized
Exiting early due to double fault.
[Unity Package Manager (Upm)]
Application terminated due to HTTP connection being closed on the other end:
  Error: write EPIPE
    at afterWriteDispatched (node:internal/stream_base_commons:160:15)
    at writeGeneric (node:internal/stream_base_commons:151:3)
    at Socket._writeGeneric (node:net:905:11)
    at Socket._write (node:net:917:8)
    at writeOrBuffer (node:internal/streams/writable:391:12)
    at _write (node:internal/streams/writable:332:10)
    at Socket.Writable.write (node:internal/streams/writable:336:10)
    at module2.exports.log (/Applications/Unity/Hub/Editor/2022.3.17f1/Unity.app/Contents/Resources/PackageManager/Server/server/app.js:27:3678)
    at module2.exports.TransportStream._write (/Applications/Unity/Hub/Editor/2022.3.17f1/Unity.app/Contents/Resources/PackageManager/Server/server/app.js:27:1586)
    at doWrite (/Applications/Unity/Hub/Editor/2022.3.17f1/Unity.app/Contents/Resources/PackageManager/Server/server/app.js:26:52771)
info: Microsoft.Hosting.Lifetime[0]
      Application is shutting down...
info: Unity.ILPP.Runner.PostProcessingAssemblyLoadContext[0]
      ALC ILPP context 1 is unloading

If using CocoaPods for Apple platforms, the project's Podfile.lock

Expand Podfile.lock snippet
```yml 👀 Replace this line with the contents of your Podfile.lock! ```
google-oss-bot commented 3 months ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

argzdev commented 3 months ago

Hey @ChurikiTenna, thanks for reaching out. The latest versions of Firebase 12.0.0+ requires a higher version of Android Gradle plugin and Gradle version. The problem is the AGP and Gradle version is tied up with the version of the Unity Editor you're using. Please update and use the latest LTS version of Unity Editor. (e.g. 2022.3.44f1, 2021.3.43f1)

Additionally, to avoid this issue, please note that you'll also need to update your Minimum API level to 24. If you'd prefer to stay at version 22. You may enable Project Settings > Publishing Settings > Minify > Release/Debug which will fix the r8 tool issue.

Let me know if it helps. Thanks!

ChurikiTenna commented 3 months ago

Thank you @argzdev for the response! The crash also occur when using Firebase 11.6.0, and it is on Mac Editor, so Gradle version seems irrelevant... But I'll try anyway and let you know!

ps: Updated the issue description with more detailed information.

ChurikiTenna commented 3 months ago

Hi @argzdev ! I have updated Unity to 2022.3.44f1 and minimum api level is set to 32, but the issue still persist. The app still crashes...

argzdev commented 3 months ago

Thanks for testing those out, @ChurikiTenna. I'm guessing the issue might have something to do with your code or configuration. If you try running our Firebase Quickstart Unity for Firestore, do you also experience the same behavior?

Also any chance you could share an MCVE?

argzdev commented 3 months ago

Just some updates, I noticed there was also a similar issue filed, where I was able to reproduce the same behavior with our quickstart. It seems to be an issue with the login for the keychain. I wonder if this is the same issue. Could you try if adding your login works?

google-oss-bot commented 2 months ago

Hey @ChurikiTenna. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 2 months ago

Since there haven't been any recent updates here, I am going to close this issue.

@ChurikiTenna if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.