title: Cannot open Realm database in React Native using Realm Studio
body: <p>I create, open and write on a realm database using following functions:</p>
  
  <p>To load the database or to create a new one I am using:</p>
  
  <pre><code>let realm = new Realm({
    path: 'UserDatabase.realm',
    schema: [
      {
        name: 'user_details',
        properties: {
          user_id: {type: 'int', default: 0},
          user_name: 'string',
          user_contact: 'string',
          user_address: 'string',
        },
      },
    ],
  });
  </code></pre>
  
  <p>Write some data:</p>
  
  <pre><code>let realmWrite = () =&gt; {
    if (realm === null || realm === undefined) {
      console.error('realm is:' + realm);
    } else {
      realm.write(() =&gt; {
        var ID = 1;
        realm.create('user_details', {
          user_id: ID,
          user_name: 'username' + ID,
          user_contact: 'contact',
          user_address: `asd${ID}@asd.asd`,
        });
      });
    }
  };
  </code></pre>
  
  <p>Apparently writing data doesn't work, so I try to open the database using Realm Studio and I get following errors:</p>
  
  <pre><code>CLASSES
  Unable to open a realm at path '/Users/shinigami/Library/Developer/CoreSimulator/Devices/DEB97125-E440-4AAA-9326-7E2B8D29F158/data/Containers/Data/Application/F2B137EF-F864-454D-A622-184C95C39EEE/Documents/UserDatabase.realm': Invalid top array (ref: 1080, size: 11)
  Exception backtrace:
  0 .io.realm.realm-studio.SwVRf2 0x000000010dcfe581 _ZN5realm15InvalidDatabaseC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_ + 49
  1 .io.realm.realm-studio.SwVRf2 0x000000010dcec970 _ZN5realm5Group18validate_top_arrayERKNS_5ArrayERKNS_9SlabAllocE + 1632
  2 .io.realm.realm-studio.SwVRf2 0x000000010dcf6a20 _ZN5realm11SharedGroup7do_openERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbbNS_18SharedGroupOptionsE + 5136
  3 .io.realm.realm-studio.SwVRf2 0x000000010d9f9a8c _ZN5realm11SharedGroup4openERNS_11ReplicationENS_18SharedGroupOptionsE + 236
  4 .io.realm.realm-studio.SwVRf2 0x000000010d9f9473 _ZN5realm11SharedGroupC2ERNS_11ReplicationENS_18SharedGroupOptionsE + 1587
  5 .io.realm.realm-studio.SwVRf2 0x000000010d964951 _ZN5realm5Realm16open_with_configERKNS0_6ConfigERNSt3__110unique_ptrINS_11ReplicationENS4_14default_deleteIS6_EEEERNS5_INS_11SharedGroupENS7_ISB_EEEERNS5_INS_5GroupENS7_ISF_EEEEPS0_ + 1145
  6 .io.realm.realm-studio.SwVRf2 0x000000010d964286 _ZN5realm5RealmC2ENS0_6ConfigENSt3__110shared_ptrINS_5_impl16RealmCoordinatorEEE + 278
  7 .io.realm.realm-studio.SwVRf2 0x000000010d984a40 _ZZN5realm5Realm17make_shared_realmENS0_6ConfigENSt3__110shared_ptrINS_5_impl16RealmCoordinatorEEEEN19make_shared_enablerC2ES1_S6_ + 84
  8 .io.realm.realm-studio.SwVRf2 0x000000010d96ab44 _ZNSt3__110shared_ptrIZN5realm5Realm17make_shared_realmENS2_6ConfigENS0_INS1_5_impl16RealmCoordinatorEEEE19make_shared_enablerE11make_sharedIJS3_S6_EEES8_DpOT_ + 136
  9 .io.realm.realm-studio.SwVRf2 0x000000010d97fa3c _ZN5realm5_impl16RealmCoordinator12do_get_realmENS_5Realm6ConfigERNSt3__110shared_ptrIS2_EERNS4_11unique_lockINS4_5mutexEEEb + 260
  10 .io.realm.realm-studio.SwVRf2 0x000000010d97f8aa _ZN5realm5_impl16RealmCoordinator9get_realmENS_5Realm6ConfigE + 352
  11 .io.realm.realm-studio.SwVRf2 0x000000010d9665fb _ZN5realm5Realm16get_shared_realmENS0_6ConfigE + 113
  12 .io.realm.realm-studio.SwVRf2 0x000000010d8cb2cb _ZN5realm2js10RealmClassINS_4node5TypesEE19create_shared_realmEPN2v87IsolateENS_5Realm6ConfigEbONSt3__13mapINSA_12basic_stringIcNSA_11char_traitsIcEENSA_9allocatorIcEEEENSB_ISH_NS0_9ProtectedINS5_5LocalINS5_5ValueEEEEENSA_4lessISH_EENSF_INSA_4pairIKSH_SM_EEEEEESO_NSF_INSP_ISQ_ST_EEEEEEONSB_ISH_NSI_INSJ_INS5_8FunctionEEEEESO_NSF_INSP_ISQ_S10_EEEEEE + 127
  13 .io.realm.realm-studio.SwVRf2 0x000000010d8c96c6 _ZN5realm2js10RealmClassINS_4node5TypesEE11constructorEPN2v87IsolateENS5_5LocalINS5_6ObjectEEERNS0_9ArgumentsIS3_EE + 402
  14 .io.realm.realm-studio.SwVRf2 0x000000010d8c8a1b _ZN5realm4node10ObjectWrapINS_2js10RealmClassINS0_5TypesEEEE9constructERKN3Nan20FunctionCallbackInfoIN2v85ValueEEE + 333
  15 .io.realm.realm-studio.SwVRf2 0x000000010d8c9412 _ZN3Nan3impL23FunctionCallbackWrapperERKN2v820FunctionCallbackInfoINS1_5ValueEEE + 166
  16 Electron Framework 0x0000000102c1e4a8 _ZN2v88internallsERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEERKNS0_18BasicBlockProfilerE + 350504
  ...
  </code></pre>
  
  <p>What's wrong?</p>
  
  <hr>
  
  <blockquote>
    <p>Update</p>
  </blockquote>
  
  <p>Inspecting manually the realm file I see that the file is written and filled "<em>as expected</em>". Please, note <strong>username</strong> and <strong>asd1@asd.asd</strong> that are literal strings from the writing function.</p>
  
  <p><a href="https://i.stack.imgur.com/Ql6b0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ql6b0.png" alt="enter image description here"></a></p>