question

SrinathMannam-4826 avatar image
0 Votes"
SrinathMannam-4826 asked RobCaplan edited

Xamarin IOS App Not Building

I am trying to build the Xamarin IOS app from visual studio windows to an iPhone 9.

I get the following errors.

99995-image.png


99937-image.png


Can someone please about this?


dotnet-xamarin
image.png (28.3 KiB)
image.png (47.4 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

KyleWang-MSFT avatar image
0 Votes"
KyleWang-MSFT answered KyleWang-MSFT edited

Hi SrinathMannam-4826,

Welcome to our Microsoft Q&A platform!

For the first error, there is no "ToHexString" method in NSData class. You can convert NSData to hexstring as follows.

 string ToHexString(NSData data)
 {
     byte[] by = data.ToArray();
     StringBuilder hex = new StringBuilder(by.Length * 2);
     foreach (byte b in by)
         hex.AppendFormat("{0:x2}", b);
     return hex.ToString();
 }

For the error "CS0246", please check if you have add the right reference and using it in your code. More info you can refer to Compiler Error CS0246.

As to the error "CS0234", similarly, you need to check if the namesapce has the correct references. For more info, refer to Compiler Error CS0234.

To handle the error in the second image, you can try to clean the project and clear the related cache on Mac under the path ~/Library/Caches/Xamarin/mtbs.

Regards,
Kyle


If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Yes, for the first image the errors caused because some files were not included, So I need to add them and then the errors are gone.

For the second image. It seems there is an ongoing issue at https://developercommunity.visualstudio.com/t/Xamarin-Forms-iOS-SkiaSharp-DirectoryNot/1424416 and The workaround mentioned by Ian Martin works for me.

The solution is to downgrade SkiaSharp, SkiaSharp.Views, SkiaSharp.Views.Forms (to version 2.80.1) and include them in head project as well as the IOS project


0 Votes 0 ·