- Home /
How to create a library from my C# project that runs on Android
Imagine this scenario. I have a Unity game that runs in Windows and Android. All code is C#. It runs perfectly fine in both platforms, however now I need to move some classes to a separate library. They don't use Unity classes, just .NET 3.5 classes.
For Windows I created a separate project with the classes and built a DLL that I added it into "plugins" folder. It works fine.
Now, how can I do the same for Android?
How can I create a library from my C# classes compatible with Android?
What extension would it have ".so" any other?
Where should I put the library in my project (plugins folder)?
I have read I could create a PCL library but some people says it is not supported by Unity, and I'm not quite clear how can I create it and use it anyway. It is worthy to mention I don't want to translate my code to Java or C++.
Thanks.
Answer by Forest3 · Oct 11, 2016 at 02:23 AM
Never mind. I was assuming my DLLs were not working because some issue between running in Android and using a DLL. But no, there was an issue because my library was trying to access a file incorrectly, once that was fixed, it worked just fine.
So, just to leave this here in case anyone had the same questions, the answers are:
Yes
dll
just drop it in plugins folder, no difference with Windows version
I'm not sure about PCL, but it may not be needed as in my case. Just create a library with .NET 3.5 version.
Your answer
![](https://koobas.hobune.stream/wayback/20220612094334im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Why is there an option to choose full or subset .Net 2.0 library ? 1 Answer
Including Google Apis to Unity .Net and C# 0 Answers
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Open With... a Build Unity program 3 Answers