Skip to content

RemoteConfig invalid array decoding #9980

Closed
@Harryjeffs

Description

@Harryjeffs

[REQUIRED] Step 1: Describe your environment

  • Xcode version: 13.4.1
  • Firebase SDK version: 9.2.0
  • Installation method: Swift Package Manage
  • Firebase Component: Remote Config
  • Target platform(s): iOS

[REQUIRED] Step 2: Describe the problem

Steps to reproduce:

Example XML:
RemoteConfigDefaults.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
	<dict>
		<key>state</key>
		<string>["yes", "no", "maybe"]</string>
	</dict>
</plist>

Fetching the data is fine however decoding runs into the following error:

DecodingError
▿ typeMismatch : 2 elements
- .0 : Swift.Array
▿ .1 : Context
- codingPath : 0 elements
- debugDescription : "Expected to decode Array but found FirebaseRemoteConfigValueDecoderHelper instead."
- underlyingError : nil

Relevant Code:

remoteConfig = RemoteConfig.remoteConfig()
let settings = RemoteConfigSettings()
remoteConfig.configSettings = settings
remoteConfig.setDefaults(fromPlist: "RemoteConfigDefaults")
do {
	config = try remoteConfig.decoded(asType: [String].self)
} catch {
	print(error)
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions