New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System.TypeInitializationException in iOS share extension #1354
Comments
Hi @Schaefers. Thanks for reaching out. I wanted to let you know that we've received your issue and that someone will review what you've shared and follow-up soon. In the meantime, would you be able to specify what flavour of RMP you're using? |
Hi, if RMP stands for this https://realm.io/products/realm-mobile-platform/ - I'm not using any kind of cloud based storage, the database ist just on the device itself - just left the Flavor part in the issue, because it was in the template and had no idea what to select. |
Thanks for the report and the clarification. Just wanted to let you know it's public holiday right now in Denmark, so we'll look into the issue early next week. |
This is indeed a bug on our part. We don't apply the necessary transformations for share extension projects. The current solution would be to downgrade to Realm 1.0.4. Share extensions are not .exe's so the |
Hi, this is also an issue if the DB is accessed from a DLL. Any news on when this will be fixed? Thanks |
Not sure what you mean by that. How are you accessing the database from a DLL? |
We have a separate DLL in which we have all our DB code, and where we create and access the Realm. This causes the same crash. This Sample Project shows it. Most of the code is copy paste from the Realm.io documentation. |
@dirkoswanepoel looking at the project you linked to, you need to add the Realm package to your iOS App project, not just the library project. |
@fealebenpae Thanks, that was an oversight in the sample. That does fix the problem with the sample app, but for some reason it doesn't with our production app which already has a reference to Realm in the main App project. We however have many other libraries that might be causing this, but staying on 1.0.4 is the only known way to stop this crash from happening. |
Is there any other workaround besides downgrading to 1.0.4? We can't roll back to that version due to Mono 5. If you could point me in the right direction I'd be happy to take a stab at fixing it ;-) |
There are two points where we need to make adjustments:
It's not a huge code change, but would require some testing which is why we haven't resolved the issue yet. But we would be more than happy to review a PR :) |
I'm also seeing this when I have a .NET library (DLL) and either a library or console app for NUnit unit testing. Additionally, it doesn't seem to make a different whether the unit test target is a library or an executable, as the error stays the same. |
I'd be surprised if you're getting the same error - it's specific to iOS because that's the only application type that we modify the realm assembly for. It would be best to open a new issue and post as much detail as possible (ideally with a repro case). |
Now even 1.0.4 isn't working for me anymore. On iOS 10.3.2 the App crashes with this exception Any ideas or an ETA when this issue will be addressed? |
@Schaefers can you drill down into the exception and see what the inner exception is? |
does this help? |
Did you update Xamarin Studio recently? Maybe a new version of Xamarin is not linking the old Realm package properly. |
I'm not sure..since Xamarin is replaced by Visual Studio (which isn't working with these old versions), I'm avoiding any update. Will try with an older build later, but I don't think its possible to downgrade the Xamarin version anyway, because you won't find it online anymore. Tried an old build, crashes with the same error, so may be an Xamarin bug, trying to find an older version. |
Goals
I'm trying to access my realm database, which is stored in the shared memory using an AppGroup.
Expected Results
Realm.GetInstance(Path)
should return an valid instance of the Realm database.Actual Results
Realm.GetInstance(Path)
crashes throwing the exception below. It doesn't make any difference if I'm providing a path or using the instance method without parameters.Steps to Reproduce
Realm.GetInstance()
inViewDidLoad()
in ActionViewController.csThe issue first occurred in a bigger project, but I can't tell exactly when the Extension stopped working. It was working fine for a long time, than after some modifications on the main App, I was unable to get the Share Extension working again.
Code Sample
https://github.com/Schaefers/realm-share-extension
Version of Realm and Tooling
The text was updated successfully, but these errors were encountered: