MTOUCH: error MT0034 Xamarin.iOS and Catel - xamarin

I am getting this error when I try to compile my Xamarin.iOS app. I am referencing Catel.MVVM and Catel.Fody.
Any idea what to do?
MTOUCH: error MT0034: Cannot include both 'monotouch.dll' and 'Xamarin.iOS.dll' in the same Xamarin.iOS project - 'Xamarin.iOS.dll' is referenced explicitly, while 'monotouch.dll' is referenced by 'Catel.MVVM, Version=4.4.0.0, Culture=neutral, PublicKeyToken=null'.

One of your project parts uses the UnifiedAPI (Xamarin.iOS.dll) and another one uses the Classic API (monotouch.dll). They can not be both part of the project.
You goal should be to use the UnifiedAPI/ Xamarin.iOS.dll instead of the old monotouch assembly because with the new one you are able to get your app in the store. Xamarin Studio is able to convert your project to the UnifiedAPI. I am not sure but take a look under Project > "Convert to UnifiedAPI" or something like that.

Related

Using xamarin forms, still getting warning for UIWebView deprecation in app store "ITMS-90809: Deprecated API Usage"

I have removed all UIWebView references and using WKWebView now.
I am hoping any one will help me as I am stuck.
The apple depreciation warning still
persists even after following the above steps in
https://devblogs.microsoft.com/xamarin/uiwebview-deprecation-xamarin-forms/.
My nugets are updated as per the article. And removed "obj" and "bin" folders from
ios project to just not use previous references.
I have following details:
MacMini
OS: macOS-10.15 (Catalina)
Visual Studio: 8.6.2
Xamarin.iOS: 13.18.2.1
XCode: 11.5
Xamarin.Forms: 4.8.0.1269
Xamarin.Forms.Maps: 4.8.0.1269
Xamarin.Essentials: 4.5.3.2
Xamarin.Auth: 1.7.0
But it still giving me
UIKit.UIWebView reference in following dll
One or more reference(s) to type ‘UIKit.UIWebView’ still exists inside
‘Xamarin.Forms.Platform.iOS, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null
One or more reference(s) to type ‘UIKit.UIWebView’ still exists inside ‘Xamarin.Auth,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=null
One or more reference(s) to type UIKit.UIWebView still exists inside
‘Xamarin.Forms.Platform.iOS, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null
One or more reference(s) to type ‘UIKit.UIWebView’ still exists inside ‘Xamarin.Auth,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=null
At this stage, I cannot figure out what I am missing
As it says in the error message that you are getting,
One or more reference(s) to type ‘UIKit.UIWebView’ still exists inside ‘Xamarin.Auth,
So, you need to stop using "Xamarin.Auth" as it still references UIWebView.
There's also an issue filed in the Github of that nuget. Even though there's a PR already submitted to fix that issue, but they are not going to fix it because Xamarin.Auth is not safe for use. They have made it clear that the library is deprecated, so you have to start using the SecureStorage provided by Xamarin Essentials. They even wrote a migration guide to help you with this.
So, please migrate and then delete that Xamarin.Auth package. Make sure you update the packages to the latest version and then resubmit.
This seems an existing issue of Xamarin.forms on iOS .
Make sure that the version Xamarin.Forms is 4.6 or higher and Xamarin.iOS is 13.10.0.17 or higher.
Change the Linker Behavior to SDK Only or Link All and then add the
additional arguments: --optimize=experimental-xforms-product-type
Please check all of these have been set under the release
configuration and iPhone platform.
For more details you could refer
https://devblogs.microsoft.com/xamarin/uiwebview-deprecation-xamarin-forms/
Hi I fixed my issue by removing Xamarin Auth package. And also set mTouch argument to AppStore/iPhone iOS build configuration. It is working now. I didn't get any warning message from apple.

Error MT2001: Could not link assemblies. Reason: Error while processing references

I'm getting this error trying to build a Xamarin.iOS project referencing a .NET Standard 2.0 library.
None of the MT2001 issues online seem to have this specific "Error while processing references" reason, so I'm at a loss as to how to diagnose this. I've tweaked and fiddled about as much as any one person can and stay sane, but I'm really in the dark.
Can anyone out there point me in a direction?
Adding -v -v -v -v to "Additional mtouch arguments" in the project iOS Build settings will help diagnose the issue. After that, you can search the build output for MT2001 and view the inner exceptions. Obviously, each project may differ as to what assembly causes the linker to fail. You may need to add, remove or fix your references based on the output.
For example, I was trying to use SignalR from AspNetCore 2.1, which has a dependency on System.Threading.Tasks.Extensions 4.5.1 in my project, which it seems Mono does not yet support. Mono does not provide its own version of the assembly yet, so when mtouch goes to link the assembly, it's unable to do so and throws an exception:
Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
Removing all references to this assembly (and therefore the whole feauture in my case) allowed the build and linking to succeed.
I've found that I get this when using a Xamarin library that is dependent on System.Reactive 4.1.0. There's a bug in there associated with System.Threading.Tasks.Extensions, and since it is a library I'm writing, I had to roll back to System.Reactive 4.0.0.
For me the error is as follows.
one of the package is mentioned in package.config file but it was not available in packages. So i added the missing package from nuget and the app works fine

Xamarin, updating app to Unified mvvmCross not compiling

After update existing app to the Unified API, and update the mvvmCross libraries to 3.5, when I try to compile in Iphone the nex error is show:
Failed to resolve "System.Boolean Cirrious.VvvmCross.ViewModels.MvxNavigatingObject::ShowViewModel(Cirrious.MvvmCross.ViewModels.IMvxBundle,Cirrious.MvvmCross.ViewModels.MvxBundle,Cirrious.MvvmCross.ViewModels.MvxRequestedBy)" reference from "Cirrious.MvvmCross, Version=1.0.0.0, Culture=neutral, PublickKeyToken = e16445fd9b451819" (MT2002)
Archive: MTOUCHTASK
And if I double click in the error, then I get the message:
File not found: /User/Admin/Desktop/Project/iPhoneProject/MTOUCHTASK
What I'm missing? I have to update somthing else?
P.D.: I Updated Xamarin as well.
It was all a problem with the Profile of the PCL that I used in the xamarin.
I changed all the PCL to use Profile78 and then all worked so far.

Xamarin.Forms with custom renderer for Android yields compiler error

After upgrading to Xamarin.Forms 1.2.3 I'm getting the following compiler error related to the definition of a custom renderer:
Error CS0012: The type `Xamarin.Forms.Platform.Android.FormsViewGroup' is
defined in an assembly that is not referenced. Consider adding a reference to
assembly `FormsViewGroup, Version=1.2.3.0, Culture=neutral,
PublicKeyToken=null' (CS0012) (XFormsNavigation.Android)
What is wrong and how can I fix it?
Not sure, why you have to add a Xamarin.Forms library manually. But here's what to do:
In packages/Xamarin.Forms.1.2.3.6256-pre4/lib/MonoAndroid10/ (or similar depending on your Xamarin.Forms version) you'll find the library FormsViewGroup.dll. Add it to the references of your Android project and it should compile.

Assembly generation failed - does not have a strong name

Im getting the following error in the Portable Class Library (PCL) in Xamarin, how to resolve this,?
Assembly generation failed -- Referenced assembly 'Xamarin.Forms.Core' does not have a strong name
Xamarin.Forms assemblies distributed through nuget.org are not strong-signed.
You're trying to strong-sign your application assembly, and this require all dependencies to be strong-signed too. That's the problem you're seeing.
IMHO, strong-signing application adds none to very little value in mobile, esp on Android and iOS.

Resources