Skip to content

RemoteConfig invalid array decoding #9980

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)
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions