What does “linked out by Xamarin” mean?

泄露秘密 提交于 2020-01-05 05:18:09

问题


In the Akavache docs, it says...

Add the following class anywhere in your project to make sure Akavache.Sqlite3 will not be linked out by Xamarin

What does "linked out by Xamarin" mean?


回答1:


The Xamarin.Android linker and Xamarin.iOS linker remove unused code from a compiled application. They inspect the compiled code and remove any code that doesn't appear as if it would be referenced during a run of the application.

Because this analysis is done on a compiled binary (e.g., a static analysis), there may be some cases where an application does use some code but the linker can't detect such a usage. Thus, the linker will remove this code, even though it is used. This will lead to problems when the application actually runs.

The quoted Akavache docs imply that Akavache.Sqlite3 is one of these cases, where the Xamarin linker will not be able to tell that it is being used, and thus the linker will remove it incorrectly. The docs recommend you add a reference to prevent the Xamarin linker from removing Akavache.Sqlite3 - i.e., to prevent the library from being "linked out" of your application by Xamarin.



来源:https://stackoverflow.com/questions/51070050/what-does-linked-out-by-xamarin-mean

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!