Skip to content

AppCheck + AppAttest still causing DCErrorInvalidInput #14569

Closed
@matsomatic

Description

@matsomatic

Description

Hello,

This reports builds upon #12629. Based on the discussion there it appeared the issue had been resolved, possibly with 10.27.0. However with Firebase iOS SDK 10.29.0 and AppCheck 10.19.2 the issue still manifests itself. Even in a small group of testers on a Testflight distribution some users were blocked from making requests as AppCheck failed.

Any help or workarounds would be much appreciated.

Reproducing the issue

The code used to try to acquire a token:
return try await AppCheck.appCheck().token(forcingRefresh: false).token

Firebase SDK Version

10.29.0

Xcode Version

16.2

Installation Method

Swift Package Manager

Firebase Product(s)

App Check

Targeted Platforms

iOS

Relevant Log Output

I have not been able to reproduce in a debugging session but have managed to capture error details from users who experienced the issue.

Error details:

nserror-code : 0

nserror-domain: com.firebase.appCheck

NSLocalizedFailureReason: Failed to create a block of data that demonstrates the legitimacy of the app instance (`generateAssertion:clientDataHash:completionHandler:`); keyId.length = 44, clientDataHash = <redacted>, systemVersion = 17.6.1; DCErrorInvalidInput - An error code that indicates when your app provides data that isn’t formatted correctly.

NSUnderlyingError: Error Domain=com.apple.devicecheck.error Code=2 "(null)"

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet
{
  "pins" : [
    {
      "identity" : "abseil-cpp-binary",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/abseil-cpp-binary.git",
      "state" : {
        "revision" : "194a6706acbd25e4ef639bcaddea16e8758a3e27",
        "version" : "1.2024011602.0"
      }
    },
    {
      "identity" : "alamofire",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/Alamofire/Alamofire.git",
      "state" : {
        "revision" : "513364f870f6bfc468f9d2ff0a95caccc10044c5",
        "version" : "5.10.2"
      }
    },
    {
      "identity" : "app-check",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/app-check.git",
      "state" : {
        "revision" : "3b62f154d00019ae29a71e9738800bb6f18b236d",
        "version" : "10.19.2"
      }
    },
    {
      "identity" : "appsflyerframework",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/AppsFlyerSDK/AppsFlyerFramework",
      "state" : {
        "revision" : "c91c3a46f9352891728cfc4583c209d683a999f9",
        "version" : "6.16.0"
      }
    },
    {
      "identity" : "braze-swift-sdk",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/braze-inc/braze-swift-sdk",
      "state" : {
        "revision" : "a8ac3eb1055c79fa8bf55661b7dc07ae736b4f03",
        "version" : "6.6.2"
      }
    },
    {
      "identity" : "cachedasyncimage",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/bullinnyc/CachedAsyncImage.git",
      "state" : {
        "revision" : "cb253e111528c082381af54b67dab7a15eefde16",
        "version" : "2.6.0"
      }
    },
    {
      "identity" : "facebook-ios-sdk",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/facebook/facebook-ios-sdk",
      "state" : {
        "revision" : "b28dde427715b45a26ebebf697929f4a81b15e04",
        "version" : "18.0.0"
      }
    },
    {
      "identity" : "firebase-ios-sdk",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/firebase/firebase-ios-sdk",
      "state" : {
        "revision" : "eca84fd638116dd6adb633b5a3f31cc7befcbb7d",
        "version" : "10.29.0"
      }
    },
    {
      "identity" : "googleappmeasurement",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/GoogleAppMeasurement.git",
      "state" : {
        "revision" : "fe727587518729046fc1465625b9afd80b5ab361",
        "version" : "10.28.0"
      }
    },
    {
      "identity" : "googledatatransport",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/GoogleDataTransport.git",
      "state" : {
        "revision" : "a637d318ae7ae246b02d7305121275bc75ed5565",
        "version" : "9.4.0"
      }
    },
    {
      "identity" : "googleutilities",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/GoogleUtilities.git",
      "state" : {
        "revision" : "57a1d307f42df690fdef2637f3e5b776da02aad6",
        "version" : "7.13.3"
      }
    },
    {
      "identity" : "grpc-binary",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/grpc-binary.git",
      "state" : {
        "revision" : "e9fad491d0673bdda7063a0341fb6b47a30c5359",
        "version" : "1.62.2"
      }
    },
    {
      "identity" : "gtm-session-fetcher",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/gtm-session-fetcher.git",
      "state" : {
        "revision" : "a2ab612cb980066ee56d90d60d8462992c07f24b",
        "version" : "3.5.0"
      }
    },
    {
      "identity" : "gzip",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/nicklockwood/GZIP.git",
      "state" : {
        "revision" : "f710a37aa978a93b815a4f64bd504dc4c3256312",
        "version" : "1.3.2"
      }
    },
    {
      "identity" : "interop-ios-for-google-sdks",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/interop-ios-for-google-sdks.git",
      "state" : {
        "revision" : "2d12673670417654f08f5f90fdd62926dc3a2648",
        "version" : "100.0.0"
      }
    },
    {
      "identity" : "kanna",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/tid-kijyun/Kanna.git",
      "state" : {
        "revision" : "41c3d28ea0eac07e4551b28def9de1ede702e739",
        "version" : "5.3.0"
      }
    },
    {
      "identity" : "keychainaccess",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/kishikawakatsumi/KeychainAccess.git",
      "state" : {
        "revision" : "84e546727d66f1adc5439debad16270d0fdd04e7",
        "version" : "4.2.2"
      }
    },
    {
      "identity" : "leveldb",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/firebase/leveldb.git",
      "state" : {
        "revision" : "a0bc79961d7be727d258d33d5a6b2f1023270ba1",
        "version" : "1.22.5"
      }
    },
    {
      "identity" : "lottie-ios",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/airbnb/lottie-ios.git",
      "state" : {
        "revision" : "047aa81b77adcbf583a966dfef620d17650cc656",
        "version" : "4.5.1"
      }
    },
    {
      "identity" : "nanopb",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/firebase/nanopb.git",
      "state" : {
        "revision" : "b7e1104502eca3a213b46303391ca4d3bc8ddec1",
        "version" : "2.30910.0"
      }
    },
    {
      "identity" : "promises",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/promises.git",
      "state" : {
        "revision" : "540318ecedd63d883069ae7f1ed811a2df00b6ac",
        "version" : "2.4.0"
      }
    },
    {
      "identity" : "reachability.swift",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/ashleymills/Reachability.swift",
      "state" : {
        "revision" : "21d1dc412cfecbe6e34f1f4c4eb88d3f912654a6",
        "version" : "5.2.4"
      }
    },
    {
      "identity" : "sdwebimage",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/SDWebImage/SDWebImage.git",
      "state" : {
        "revision" : "cac9a55a3ae92478a2c95042dcc8d9695d2129ca",
        "version" : "5.21.0"
      }
    },
    {
      "identity" : "starscream",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/daltoniam/Starscream.git",
      "state" : {
        "revision" : "c6bfd1af48efcc9a9ad203665db12375ba6b145a",
        "version" : "4.0.8"
      }
    },
    {
      "identity" : "swift-custom-dump",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/pointfreeco/swift-custom-dump",
      "state" : {
        "revision" : "82645ec760917961cfa08c9c0c7104a57a0fa4b1",
        "version" : "1.3.3"
      }
    },
    {
      "identity" : "swift-jsonapi",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/Datadog/swift-jsonapi",
      "state" : {
        "revision" : "d3b95e724b0f9259c6ca659fedae246eaca0a3e2",
        "version" : "0.1.2"
      }
    },
    {
      "identity" : "swift-protobuf",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/apple/swift-protobuf.git",
      "state" : {
        "revision" : "d72aed98f8253ec1aa9ea1141e28150f408cf17f",
        "version" : "1.29.0"
      }
    },
    {
      "identity" : "swift-snapshot-testing",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/pointfreeco/swift-snapshot-testing.git",
      "state" : {
        "revision" : "b2d4cb30735f4fbc3a01963a9c658336dd21e9ba",
        "version" : "1.18.1"
      }
    },
    {
      "identity" : "swift-syntax",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/swiftlang/swift-syntax",
      "state" : {
        "revision" : "2bc86522d115234d1f588efe2bcb4ce4be8f8b82",
        "version" : "510.0.3"
      }
    },
    {
      "identity" : "xctest-dynamic-overlay",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/pointfreeco/xctest-dynamic-overlay",
      "state" : {
        "revision" : "39de59b2d47f7ef3ca88a039dff3084688fe27f4",
        "version" : "1.5.2"
      }
    },
    {
      "identity" : "zipfoundation",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/weichsel/ZIPFoundation.git",
      "state" : {
        "revision" : "02b6abe5f6eef7e3cbd5f247c5cc24e246efcfe0",
        "version" : "0.9.19"
      }
    }
  ],
  "version" : 2
}

If using CocoaPods, the project's Podfile.lock

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions