admin管理员组文章数量:1391977
I make feature that fetch configs from firebase remote config store. but I got a result that emptry value for some key. so i debug process that fetching values and find singleton instance for RemoteConfig points address 0x00000000.. and if i print this object app crashed and showed error "bad access". I dont know why this happen because i followed all procedure that firebase docs offers. help me if you get same problem with me thanks.
initially, i called below funcition before launches.
func configureFirebase() {
FirebaseApp.configure()
// Setup remote config
do {
let settings = RemoteConfigSettings()
let config = RemoteConfig.remoteConfig()
config.configSettings = settings
try config.setDefaults(from: [
"alarm_mission_type": "shake_mission"
])
config.fetchAndActivate()
} catch {
debugPrint("Remote config 기본값 설정 오류 \(error.localizedDescription)")
}
}
and below code is using config value code.
let config = RemoteConfig.remoteConfig()
config.fetchAndActivate()
let configValue = config["alarm_mission_type"].stringValue
print(config) // app crashed and showed error "bad access"
I make feature that fetch configs from firebase remote config store. but I got a result that emptry value for some key. so i debug process that fetching values and find singleton instance for RemoteConfig points address 0x00000000.. and if i print this object app crashed and showed error "bad access". I dont know why this happen because i followed all procedure that firebase docs offers. help me if you get same problem with me thanks.
initially, i called below funcition before launches.
func configureFirebase() {
FirebaseApp.configure()
// Setup remote config
do {
let settings = RemoteConfigSettings()
let config = RemoteConfig.remoteConfig()
config.configSettings = settings
try config.setDefaults(from: [
"alarm_mission_type": "shake_mission"
])
config.fetchAndActivate()
} catch {
debugPrint("Remote config 기본값 설정 오류 \(error.localizedDescription)")
}
}
and below code is using config value code.
let config = RemoteConfig.remoteConfig()
config.fetchAndActivate()
let configValue = config["alarm_mission_type"].stringValue
print(config) // app crashed and showed error "bad access"
Share
Improve this question
asked Mar 13 at 8:10
Choijun0Choijun0
496 bronze badges
1 Answer
Reset to default 1Answer myself,
this is caused by compiler's optiomization.
Firebase frameworks register them self by calling load method static method for Service component(Objective-C code, automatically called on runtime).
framwork's components files actally not using directly so build setting in Tuist ignore Component file. and so registration not worked.
So we should add Other linker flag field a value '-ObjC'. this flag compile Objective-C file in static library imported to this executable.
本文标签: swiftiOS Firebase remote config39s singleton instance point 0x00000000(bad access)Stack Overflow
版权声明:本文标题:swift - iOS Firebase remote config's singleton instance point 0x00000000(bad access) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744714133a2621299.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论