2017-06-20 84 views
1

我有一個Unity應用程序,我使用了一系列由Google提供的插件:Play遊戲服務,AdMob,Firebase Analytics。他們都工作得很好。現在我想添加Firebase RemoteConfig。但我不能因爲我的應用程序不斷崩潰(在Android設備上),當我嘗試使用RemoteConfig做任何事情時。我試着用谷歌搜索,但沒有發現類似的東西。 我的代碼看起來是這樣的:當FirebaseRemoteConfig.SetDefaults()被稱爲Firebase RemoteConfig使用信號11(SIGSEGV)崩潰應用程序

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發生。堆棧跟蹤如下所示:

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> 

我試過不同的變體,但總是得到這個SIGSEGV。有任何想法嗎?

回答

0

我遇到了同樣的問題。看起來在安裝RemoteConfig軟件包時,它並未安裝所有必需的Android庫。使用Play Services Resolver工具拉入所需的遠程配置庫,然後工作正常。

相關問題