简体   繁体   中英

Firebase RemoteConfig crashes app with signal 11 (SIGSEGV)

I have a Unity app and I use a bunch of plugins provided by Google: Play Games Services, AdMob, Firebase Analytics. They all work perfectly fine. Now I want to add Firebase RemoteConfig. But I can't because my app is constantly crashing (on android device) when I try to do anything with RemoteConfig. I trying googling but didn't find anything similar. My code looks something like this:

public class RemoteConfigManager
{
    void Start()
    {
        Debug.Log("Start");
        var dependencyStatus = Firebase.FirebaseApp.CheckDependencies();
        if (dependencyStatus != Firebase.DependencyStatus.Available)
        {
            Debug.Log("Trying to fix dependencies");
            Firebase.FirebaseApp.FixDependenciesAsync().ContinueWith(task =>
            {
                dependencyStatus = Firebase.FirebaseApp.CheckDependencies();
                if (dependencyStatus == Firebase.DependencyStatus.Available)
                {
                    Debug.Log("Fixed dependencies");
                    SetDefaults();
                }
                else
                {
                    Debug.LogError("Could not resolve all Firebase dependencies: " + dependencyStatus);
                }
            });
        }
        else
        {
            Debug.Log("Dependencies ok");
            SetDefaults();
        }
    }

    void SetDefaults()
    {
        Debug.Log("Set defaults");
        var configuration = ConfigurationManager.Instance.Configuration;
        var defaults = new Dictionary<string, object>();
        defaults.Add("some_key", 1);
        FirebaseRemoteConfig.SetDefaults(defaults);
    }
}

SIGSEGV happens when FirebaseRemoteConfig.SetDefaults() is called. Stack trace looks like this:

06-20 17:10:38.929: I/DEBUG(30994): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
06-20 17:10:38.929: I/DEBUG(30994): Build fingerprint: 'htc/htc_europe/m7:5.0.2/LRX22G/482424.51:user/release-keys'
06-20 17:10:38.929: I/DEBUG(30994): Revision: '3'
06-20 17:10:38.929: I/DEBUG(30994): ABI: 'arm'
06-20 17:10:38.929: I/DEBUG(30994): pid: 29950, tid: 29973, name: UnityMain
06-20 17:10:38.929: I/DEBUG(30994): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
06-20 17:10:38.969: I/DEBUG(30994):     r0 00000000  r1 00000008  r2 affc42f0  r3 915dc8f8
06-20 17:10:38.969: I/DEBUG(30994):     r4 ba252920  r5 00000008  r6 ba252920  r7 00000008
06-20 17:10:38.969: I/DEBUG(30994):     r8 00000000  r9 9744f118  sl 00000000  fp affc4308
06-20 17:10:38.969: I/DEBUG(30994):     ip 00000001  sp affc42b8  lr 9158e7d1  pc 91598354  cpsr 600b0030
06-20 17:10:38.969: I/DEBUG(30994): backtrace:
06-20 17:10:38.969: I/DEBUG(30994):     #00 pc 00064354  /data/app/com.myapp-1/lib/arm/libApp.so (firebase::App::GetInstance(char const*)+3)
06-20 17:10:38.969: I/DEBUG(30994):     #01 pc 0005a7cd  /data/app/com.myapp-1/lib/arm/libApp.so (firebase::remote_config::SetDefaults(firebase::remote_config::ConfigKeyValue const*, unsigned int)+12)
06-20 17:10:38.969: I/DEBUG(30994):     #02 pc 00059357  /data/app/com.myapp-1/lib/arm/libApp.so (firebase::remote_config::SetDefaultsInternal(std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::
06-20 17:10:38.969: I/DEBUG(30994):     #03 pc 00059821  /data/app/com.myapp-1/lib/arm/libApp.so (Firebase_RemoteConfig_CSharp_SetDefaultsInternal__SWIG_1+84)
06-20 17:10:38.969: I/DEBUG(30994):     #04 pc 0000516c  <unknown>

I tried different variants but always get this SIGSEGV. Any ideas?

I ran into the same problem. It seems when installing the RemoteConfig package it doesn't install all the required Android libraries. Using the Play Services Resolver tool pulled in a needed remote config library and then it worked ok.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM