简体   繁体   中英

Mono.Android reference in PCL project in VS 2017 Mac

I have created a project in Visual Studio 2017 Windows. Now I am trying to work on it from Mac. While tried to build the project I can see reference to Mono.Android is not available. Also System.ComponentModel is unavailable. How I can add the reference for both of it? 在此处输入图片说明

I also facing the same issue mono.android is missing, finally it work by adding mono.android.dll. I did something like this in my project, in Deploy.cs file add this line

class Deploy
{
    [Android.Runtime.Register("getExternalStoragePublicDirectory", "(Ljava/lang/String;)Ljava/io/File;", "")]

it show missing mono.android.dll library is missing need to add into the project. Problem solved later I comment this line.

From the picture above you can see that the reference is made to a particular file on your Windows computer which on the Mac is obviously not on that path. If you want to make the project work you should find those files on the Mac and reference them. Copying them from Windows somewhere and referencing them should work too.

But as people noted, the point of PCL project is not to contain references like this so whole the architecture of your app is wrong and that's why you see the problems. So you may want to resolve the root of the problem as this probably won't be the last thing that you encounter by doing the things in the wrong way.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM