Can't build app on release mode Xamarin iOS - ios

I keep getting this error when I try to run the app on release mode:
Severity Code Description Project File Line Suppression State Error
Can't resolve the reference 'System.Void
System.Security.Cryptography.DSACng::.ctor(System.Security.Cryptography.CngKey)',
referenced from the method 'T
Internal.Cryptography.Pal.Windows.PkcsPalWindows::GetPrivateKey(System.Security.Cryptography.X509Certificates.X509Certificate2,System.Boolean,System.Boolean)'
in 'System.Security.Cryptography.Cng, Version=4.3.3.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. LabelApp.iOS
I see on the internet that it is related to mailkit, however, I deleted all references to mailkit. On android, everything works fine and even on debug mode it works fine.
I already tried removing the references to mailkit and used older and newer versions of mailkit. I expected that the error would be resolved because this worked on another app I made in the past, but it didn't.

I fixed it. It seems that the problem was with a package called EPPlus which I used to export data to an excel file.

Related

Xamarin iOS Could not AOT the assembly Microsoft.EntityFrameworkCore.Migrations.Migration

We've added migrations to our xamarin forms project and ever since then we can't deploy it to an iOS device. It will run on the simulator fine but will fail with AOT errors on deploying to device.
It seems to be a fairly wide spread topic over the web but none of the ideas so far have made a difference. We're using EntityFrameworkCore v2.2.6 along with xamarin.forms v4.1.0.
I've tried adding the -v -v -v for more details on the build log but still just get:
Error Could not AOT the assembly '/Users/MyUser/Library/Caches/Xamarin/mtbs/builds/MyCompany.Mobile.iOS/8fcd0a31c7f6e1a671890e2462fe729f/obj/iPhone/Debug/mtouch-cache/3-Build/MyCompany.Data.Persistence.dll' MyCompany.Mobile.iOS
Any ideas what else I should try?
I haven't try these but it could fix your issue
IOS Build -> General -> and uncheck the option Incremental Build.
Disable LLVM.
Remove all unnecesary classes, methods from your MyCompany.Data.Persistence.dll so it wont generate heavy code.
Change Linking to Link All Assemblies
Xamarin.Android applications use a linker to reduce the size
The default value is SdkOnly
None: No linking will be attempted.
SdkOnly: Linking will be performed on the base class libraries only, not user's assemblies.
Full: Linking will be performed on base class libraries and user assemblies. For more details refer here.. Note: if you are facing an issue with linking such as
"GetAdditionalResourcesFromAssemblies" task failed unexpectedly. System.IO.FileNotFoundException: . Perhaps it doesn't exist in the Mono for Android profile?
then recheck your xamarin.Android project settings and set the below tag,
true
It Should Solve Your Problem.

Air ios imported swf (no code) suddenly starts giving 'Uncompiled AS' error

I'm building an iOS app with FlashBuilder 4.7 and Air SDK 25.0. The app has code which installs fonts via an external SWF imported at runtime (no code in external SWF, just fonts). Imported file has been working for months but now throws below error in debugger on device :
'Uncompiled ActionsScript'
I have gone back through previous builds and some that had been working fine suddenly throw error on the swf file. Other old builds will work importing the same swf, but after running a build which fails, the working one will start throwing error!
Anyone else struck a problem like this?
I recently upgraded from SDK 22 to 25, but the problem appeared some time after that. Only significant change was running a dodgy zip ANE that crashed the debug. I've removed the ANE, but I suspect something may have been corrupted somewhere.
I've tried resetting FlashBuilder settings by deleting .metadata folder in workspace.
Tried Cleaning the projects, tried duplicating projects, tried re-publishing the swf to import.
Can't work out why some builds don't work and others do, but then stop working with no changes to the project. I feel sure there is a fix that will suddenly make all of the builds work again...
Any suggestions anyone?
I found my problem.
It appears I have previously been using only the 'Fast' packaging method to test app on ios device, which works.
When set to 'Standard' (Build) packaging to test on device it causes the swf (with embedded fonts) imported at runtime as having 'uncompiled actionscript'.
This answers my original query, but if anyone has a work-around, or alternate method of importing fonts at runtime, I'd be very happy to hear!

"TapkuLibrary/TapkuLibrary.h" File Not Found

I am trying to build my app but I received an error that "TapkuLibrary/TapkuLibrary.h" file not found but the file is added to my references.
I am not the one who did this project, this was just past to me without proper turn over.
I actually replaced my laptop and just open my source code from a new one with XCode 7.3.1
I also tried several solutions that I found here but still not working.
I'm also loosing some Link Binaries,

Couldn't get Xamarin projects working with Rider-EAP on OSX

I was really excited, when JetBrains launched the Project Rider-EAP. First thing I've tried was to get a Xamarin-iOS project to run in Rider-EAP, but it doesn't work out of the box.
Update 1: This issue is now listed as critical bug with fix in EAP 2: https://youtrack.jetbrains.com/issue/RIDER-618
1. Problem (fixed) Projects didn't load with the exception that Xamarin.iOS.targets could not be found.
I fixed this with a simple Symlink:
ln -s /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/ “/Applications/Rider EAP.app/Contents/lib/ReSharperHost/macos-x64/mono/lib/mono/xbuild/”
2. Problem
References are not loaded correctly. Therefore the whole syntax highlighting and everything beyond is broken.
See screenshot: References are not loaded correctly
I get the following error as well:
Error:null: Error initializing task MakeDir: Could not load file or assembly '/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Tasks.dll' or one of its dependencies
Switching the xbuild to mono 4.2.2 removes the error but not solves the problem.
PS: It seams that the references are loaded correctly for Xamarin Android projects.
Basic Xamarin Support like open and build is added with EAP 8 of Project Rider.
More advanced features will come with the next Builds and are tracked here: https://youtrack.jetbrains.com/issue/RIDER-1533

Installation Failed: Invalid Argument - System Error

I know there are lots of posts on this error and it seems like it is a catchall for Xcode. I have tried all the suggestions in these posts:
Installation Failed "Invalid argument" when trying to run Today application extension
Installation Failed: Invalid Argument -iOS Extension
https://forums.developer.apple.com/thread/7338
And none of them have worked (I tried every answer's suggestion). I have reverted to older commits that I know never saw this error, done clean clone installs, I uninstalled and reinstalled Xcode, restarted my computer, deleted all derived data, and everything else I could possibly think of. Please let me know if you think you have an answer.
Note: I still think there may be an issue with the info.plist, but like I said, even reverting back to an older version doesn't work. Is there potentially a place xcode keeps info.plist files on the local hard drive and references these?
Thanks!
Somehow while installing Amazon AWS using pods in my project, the link to the Info.plist in the build settings of the project was deleted. I am still not sure how this problem occurred across all versions of the application, even older ones where this would not have been included. By filling this entry in the Build Settings to App_name/Info.plist the project finally compiled again.

Resources