Skip to content

Realm InvalidExternalSchemaChangeException During Initialization in Flutter and iOS SDK #8701

@harinath01

Description

@harinath01

How frequently does the bug occur?

Always

Description

I am facing an issue while trying to initialize Realm in my iOS SDK. My setup consists of a Flutter app that utilizes the realm_flutter package, along with my iOS SDK (CourseKit), which also incorporates the Realm package. When I attempt to initialize Realm in the iOS SDK, I encounter the following error:

terminating due to uncaught exception of type realm::InvalidExternalSchemaChangeException: Unsupported schema changes were made by another client or process

It seems there is a conflict when both the iOS SDK and the Flutter app try to initialize Realm, leading to this error.

Stacktrace & log output

terminating due to uncaught exception of type realm::InvalidExternalSchemaChangeException: Unsupported schema changes were made by another client or process:
- Property 'Attempt.date' has been made optional.
- Property 'Attempt.title' has been removed.
- Property 'Attempt.result' has been removed.
- Property 'Attempt.total_questions' has been removed.
- Property 'Attempt.correct_answers_count' has been removed.
- Property 'Attempt.incorrect_answers_count' has been removed.
- Property 'Attempt.unanswered_count' has been removed.
- Property 'Attempt.score' has been made optional.
- Property 'Attempt.time_taken' has been removed.
- Property 'Attempt.remaining_time' has been removed.
- Property 'Attempt.exam_id' has been removed.
- Property 'Attempt.content_id' has been removed.
- Property 'Attempt.state' has been made optional.
- Property 'Attempt.review_url' has been removed.
- Property 'Attempt.exam' has been changed from '<Exam>' to 'int'.
- Property 'Course.title' has been made required.
- Property 'Course.slug' has been made required.
- Property 'Course.description' has been removed.
- Property 'Exam.start_date' has been removed.
- Property 'Exam.end_date' has been removed.
- Property 'Exam.number_of_questions' has been removed.
- Property 'Exam.allow_retake' has been removed.
If your app is running in development mode, you can delete the realm and restart the app to update your schema.

Can you reproduce the bug?

Always

Reproduction Steps

  1. Create an iOS SDK that uses the Realm package for data storage (e.g., CourseKit).
  2. Integrate this SDK into a Flutter app that also uses the realm_flutter package.
  3. Attempt to initialize Realm in the iOS SDK while the Flutter app is running.
  4. Observe the error: realm::InvalidExternalSchemaChangeException.

Version

all

What Atlas Services are you using?

Local Database only

Are you using encryption?

No

Platform OS and version(s)

all

Build environment

flutter realm package version: ^20.0.0
iOS realm package version: 10.49.3

ProductName: macOS
ProductVersion: 13.6.7
BuildVersion: 22G720

/Applications/Xcode.app/Contents/Developer
Xcode 15.0.1
Build version 15A507

/Users/testpress/.rvm/rubies/ruby-3.0.0/bin/pod
1.15.2
(not in use here)

/bin/bash
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin22)

/usr/local/bin/carthage
0.39.0
(not in use here)

/usr/bin/git
git version 2.39.3 (Apple Git-145)

Any insights or solutions to resolve this conflict would be greatly appreciated.

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