-
Type: Task
-
Resolution: Fixed
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
-
6751
-
SDK FY21-Q3.
!!! MANDATORY TO FILL OUT !!!
<!---
Questions: If you have questions about HOW TO USE Realm, ask on
StackOverflow,
or in our Swift Forum or Obj-C Forum.
Feature Request: Just fill in the first two sections below.
Bugs: To help you as fast as possible with an issue please describe your issue
and the steps you have taken to reproduce it in as many details as possible.
-->
Goals
<!--- What do you want to achieve? -->
- open the encrypted Realm DB with realm studio
- perform CRUD without error in my program
Expected Results
- open the DB file with realm studio I should get one of the following results:
(1) it is opened correctly without any info
(2) asking me to upgrade the DB file before opened
(3) show me "Opening Realm files of format version x is not supported by this version of Realm" x is bigger than 0. - when running my program: if one of the first two options of 1 is met, the program will not crash; if it is the third condition, I could upgrade the realm to solve the problem.
Actual Results
- open the DB file with realm studio, and it show me "Opening Realm files of format version 0 is not supported by this version of Realm"
- perform CRUD in my program and it crashes with info "The Realm file format must be allowed to be upgraded in order to proceed."
Upgrade the realm studio or the realm version of my program will not help.
More Info
- if do not encrypt, everything works fine !
- if encrypt, when I wrote all the datas which make the file size bigger than 100MB, error happen. But If I wrote part of the datas which make the file size around 40MB, no error happen.
Code Sample
- (RLMRealm *)_defaultRealm {
RLMRealmConfiguration *config = [RLMRealmConfiguration defaultConfiguration];
config.fileURL = [[config.fileURL URLByDeletingLastPathComponent]
URLByAppendingPathComponent:REALM_NAME];
[RLMRealmConfiguration setDefaultConfiguration:config];
NSError *error;
RLMRealm *realm = [RLMRealm realmWithConfiguration:config error:&error];
if (error) { NSLog(@"Error opening realm: %@", error); return nil; }
return realm;
}
[realm transactionWithBlock:^
{ [realm addObjects:objs]; NSLog(@"realm create finish!"); }];
[realm writeCopyToURL:[NSURL URLWithString:documentPath] encryptionKey:key error:&error];
Version of Realm and Tooling
<!---
In the CONTRIBUTING guidelines, you will find a script,
which will help determining some of these versions.
-->
Realm framework version: tried all main version
Xcode version: XCode 11
iOS/OSX version: 13.3