我有一个Unity应用程序,我使用了Google提供的一系列插件:Play游戏服务,AdMob,Firebase Analytics。他们都完美无缺。现在我要添加Firebase RemoteConfig。但我不能,因为当我尝试使用RemoteConfig做任何事情时,我的应用程序不断崩溃(在Android设备上)。我在谷歌搜索,但没有找到类似的东西。 我的代码看起来像这样:
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在调用FirebaseRemoteConfig.SetDefaults()
时发生。堆栈跟踪如下所示:
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 :(得分:0)
我遇到了同样的问题。在安装RemoteConfig软件包时,它似乎并未安装所有必需的Android库。使用拉入所需远程配置库的Play服务解析器工具,然后就可以了。