Pensou por 21 segundos Title iOS App Crashes When Accessing Firestore Documents Created via iOS - Resolved with Document References and Apple Validation Key Adjustments Briefly describe your issue in a few words iOS app crashes when accessing Firestore documents created on iOS devices; resolved by using Document References and updating Apple validation keys.

Actions & Logic
Resolved

I am developing a FlutterFlow application that interacts with Firestore for data storage and retrieval. The application functions correctly on Android devices and within FlutterFlow's web test mode. However, a critical issue arises on iOS devices:

Issue Manifestation:

  • Crash Behavior: When accessing certain Firestore documents created via an iOS device (using TestFlight), the app crashes, displaying a black screen. This crash does not occur when the same documents are accessed on Android devices or when viewed through FlutterFlow's web test mode.

  • Data Anomalies: Firestore documents created on iOS devices exhibit unexpected null values in fields that are correctly populated when the same documents are created on Android devices.

  • Query Failures: Queries utilizing single user queries fail to retrieve data from iOS-created documents, whereas using DocumentReference queries successfully retrieves the data without causing crashes.

Technical Details:

  • Firestore Integration: The application employs Firestore for real-time database functionalities. Data is structured with references and direct queries.

  • Image Handling: Profile pictures and category images are loaded using cached_network_image. Issues are observed with .svg formats not rendering correctly on iOS, leading to performance degradation and crashes.

  • Error Messages:

    • Invalid argument(s): No host specified in URI file:///

    • [FirebaseCrashlytics][I-CLS000000] Crashlytics skipped rotating the Install ID during urgent mode because it is run on the main thread, which can't succeed. This can happen if the app crashed the last run and Crashlytics is uploading urgently.

  • Pensou por 21 segundos


    Title

    iOS App Crashes When Accessing Firestore Documents Created via iOS - Resolved with Document References and Apple Validation Key Adjustments

    Briefly describe your issue in a few words

    iOS app crashes when accessing Firestore documents created on iOS devices; resolved by using Document References and updating Apple validation keys.

    Description

    I am developing a FlutterFlow application that interacts with Firestore for data storage and retrieval. The application functions correctly on Android devices and within FlutterFlow's web test mode. However, a critical issue arises on iOS devices:

    Issue Manifestation:

    • Crash Behavior: When accessing certain Firestore documents created via an iOS device (using TestFlight), the app crashes, displaying a black screen. This crash does not occur when the same documents are accessed on Android devices or when viewed through FlutterFlow's web test mode.

    • Data Anomalies: Firestore documents created on iOS devices exhibit unexpected null values in fields that are correctly populated when the same documents are created on Android devices.

    • Query Failures: Queries utilizing single user queries fail to retrieve data from iOS-created documents, whereas using DocumentReference queries successfully retrieves the data without causing crashes.

    Technical Details:

    • Firestore Integration: The application employs Firestore for real-time database functionalities. Data is structured with references and direct queries.

    • Image Handling: Profile pictures and category images are loaded using cached_network_image. Issues are observed with .svg formats not rendering correctly on iOS, leading to performance degradation and crashes.

    • Error Messages:

      • Invalid argument(s): No host specified in URI file:///

      • [FirebaseCrashlytics][I-CLS000000] Crashlytics skipped rotating the Install ID during urgent mode because it is run on the main thread, which can't succeed. This can happen if the app crashed the last run and Crashlytics is uploading urgently.

    Environment:

    • Platforms Tested: iOS (TestFlight), Android (APK and Play Store public test), Web (FlutterFlow test mode)

    • Tools Used: FlutterFlow, Firebase Firestore, Xcode for iOS build configurations

What have you tried so far?
  • Apple Validation Keys and Permissions:

    • Reviewed and Updated Apple Validation Keys: Ensured that all necessary validation keys are correctly configured in the Apple Developer portal and within the app's settings.

    • Adjusted App Permissions: Verified that the app has the required permissions for data access and storage on iOS devices.

  • Firestore Query Optimization:

    • Transitioned to Document References: Replaced single user queries with DocumentReference queries in Firestore. This change mitigated crashes and improved data retrieval consistency across platforms.

    • Optimized Data Structures: Ensured that Firestore documents have a uniform schema, eliminating null values and ensuring data integrity regardless of the platform used for document creation.

  • Image Format Adjustments:

    • Avoided Using .svg Images: Switched from .svg to .png and .jpg formats for dynamic images to enhance compatibility and performance on iOS devices.

    • Implemented Local Caching: Utilized local caching mechanisms to store images directly on the device, reducing the need for repeated network calls to Firebase servers and improving load times.

  • Xcode Build Settings Adjustments:

    • Configured Build Settings: Attempted to set the build configuration to "DWARF with dSYM File" for better crash reporting, though faced issues with the settings reverting upon rebuild.

  • Comprehensive Testing:

    • Cross-Platform Testing: Conducted tests on both iOS and Android devices to identify discrepancies in behavior.

    • Data Comparison in Firebase: Compared Firestore data entries created via iOS and Android to identify inconsistencies and anomalies.

  • Error Logging and Analysis:

    • Enhanced Crash Logging: Enabled detailed crash logs using Firebase Crashlytics to capture and analyze crash reports specific to iOS.

    • Identified Root Causes: Pinpointed that the crashes were linked to how data was queried and accessed from Firestore when documents were created on iOS devices.

  • Consulted Documentation and Community Resources:

    • Reviewed FlutterFlow Documentation: Ensured adherence to best practices for Firestore integration and iOS-specific configurations as per FlutterFlow guidelines.

    • Engaged with Community Forums: Sought insights from FlutterFlow and Firebase communities to identify similar issues and potential solutions.

Did you check FlutterFlow's Documentation for this topic?
Yes
2