-
-
Notifications
You must be signed in to change notification settings - Fork 6
Xamarin IOS Linking #929
Comments
I don't know a solution here. But I can provide some insight into what is probably happening. The data portal dynamically invokes various methods, and those methods are often private. For example:
Those methods would appear, to any static code analysis, to be "dead code" - never called by anything, because they are called dynamically. As a result, the linker (which applies static analysis) almost certainly removes those methods to reduce the binary output size. Of course at runtime those methods literally aren't there anymore and so attempting to invoke them results in a linked away exception. Which is pretty polite really - it means that the linker replaced the methods with a little stub that throws a "friendly" exception. It is generally less important that you prevent There are a few cases where CSLA will dynamically invoke non-public methods in base classes (like the |
Although it is hard (for me at least) to follow twitter threads, I started a thread about linker issues late last night actually, because I ran into one when dealing with client-side Blazor. The thread has some interesting insights into managing the linker from the Uno Platform team, because they sit on the same infrastructure as Xamarin (and also on wasm) and so have intimate understanding of the linker. https://twitter.com/RockyLhotka/status/1249545555266752512?s=20 |
@brinawebb , I voted yes because I thought making those methods public would help solve this issue @Gevand is talking about here. |
Sorry, I replied to the wrong thread. |
@Gevand , If I may add a question here. |
Our team is planning on doing that in October. The apps viewmodels are inheriting from CSLA. We are submitting to apple the first few features ahead of time, to make sure nothing bites us. Currently still working on the submission process. Once we figure everything out, I'll dump all the knowledge to my original post. |
@Gevand thank you , will be eagerly waiting. |
We figured out the issue. I appended the answer to the question. |
Answer
Figured this out with our team and were able to upload to apple. Adding --nolinkaway to aditional mtouch parameters solved the issue. For some reason it seems to needs to be first if --optimize parameter is passed in.
Question
I'm having trouble setting up linking for the sample Xamarin app in this repository. In order to submit to apple, Microsoft suggests to set up the iOS build to have "link framework sdks only". Otherwise the app will exceed Apple's 60mb limit. CSLA should be skipped with those settings and function normally.
Here are my settings.
When clicking on the add button in the sample app, and invoking a dataportal for the first time an error occurs.
I get the following error:
I googled around and tried different mtouch parameters such as --nolinkaway and --linkskiping CSLA libraries and the Link ALL option.
Does anyone here have an app published to the app store that uses Xamarin + CSLA and if so, what parameters did you use for iOS linker behavior.
I'm gonna keep working on this, and if I figure it out, I'll append something to this post.
Version and Platform
CSLA version: 5.1.0-R19110101
OS: iOS,
Platform: Xamarin
The text was updated successfully, but these errors were encountered: