How can I use IDataErrorInfo with mvvmcross and monodroid - xamarin.android

I am trying to build a cross platform application. Currently I am setting up a project using Xamarin MonoDroid 4.7 and MVVMCross. I would like to be able to use INotifyDataErrorInfo but I get the following compilation error:
The type 'System.ComponentModel.INotifyDataErrorInfo' exists in both 'c:\Program Files(x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.dll' and 'c:\Users\MvvmCross.PortableSupport.3.0.6\lib\MonoAndroid16\System.Windows.dll
Has anyone come across this/developed a workaround or solution?
Thanks

We think Mono for Android/Xamarin.Android has recently added this support - but the situation isn't clear - see https://bugzilla.xamarin.com/show_bug.cgi?id=5340
When we get this confirmed and work out which versions do/don't have this - which is hopefully in the coming week or two - then MvvmCross will hopefully be able to remove its version.
Also, I hope but I don't know that the MvvmCross versions of System.Windows, System.Net, etc can be removed in the near future - see https://bugzilla.xamarin.com/show_bug.cgi?id=8035
This is not at all clear at present, and it's likely to be a source of issues while PCL support from Xamarin moves through none->alpha->beta->stable
I'm afraid those 'NEW' bugzilla issues above represent all the information I have on this at present.
In the meantime... if you need to resolve the INotifyDataErrorInfo within your own project and environment, then one route forwards is to branch the MvvmCross source and to change the MvvmCross shim System.Windows.dll to type forward instead of replacing this type - the code is in https://github.com/slodge/MvvmCross/tree/v3/PortableSupport/System.Windows
I am sorry about these problems... and I'm very much looking forwards to having official PCL support from Xamarin so I no longer have to work around them.

Related

Appcode doesn't autocomplete third party libraries

Recently I'm giving a hand to my iOs team(coming from Android) and I'm trying to use Appcode to keep all my IntelliJ keybinds and shortcuts. However, even if I can work with Appcode and everything compiles and works well. Some of the libraries that I use on the application doesn't work with AppCode autocomplete. I can't access the base code or do nothing. However if I write the code without any kind of autocomple/helper the code compiles and works well.
For example using RxSwift:
I have been reading and Jetbrains says that this issue was fixed on 2018 edition. But I'm using 2020 edition and I keep having this troubles.
So, my question is: how can I make Appcode show third party libraries methods and classes on the autocomplete?
Generally, AppCode does support completion in third-party libraries. In your case the problem most likely is specific to RxSwift or your particular project setup. For example, there is this known problem with RxSwift, see comments for a workaround: https://youtrack.jetbrains.com/issue/OC-19258
If the workaround doesn't help, feel free to contact AppCode support for more specific troubleshooting or create an issue in the issue tracker.

Problem when publishing an application on the App Store [Non-public API usage]

Until three weeks ago, my application could upload it to the App Store without any problem. However, Apple has refused to upload the app with a new message about Non-public API usage.
The application is developed with Xamarin in Visual Studio for Mac and has updated all the libraries and packages. Can anybody help me? Because I can not find what the problem is, nor do I see any solution. It will be something new?
Thank you all.
Non-public API usage:
The app references non-public selectors in AppAytoSS.iOS:
addTemporaryAttribute:value:forCharacterRange:,
addTemporaryAttributes:forCharacterRange:, behaviorWithType:,
defaultBaselineOffsetForFont:, defaultLineHeightForFont:, finished,
greekingThreshold, horizontalCornerRadius,
initWithSource:convolutionState:weights:, initWithType:,
postSession:didAddPlayer:, postSession:didReceiveData:fromPlayer:,
postSession:didReceiveMessage:withData:fromPlayer:,
postSession:didRemovePlayer:,
postSession:player:didChangeConnectionState:,
postSession:player:didSaveData:, preferredMetalContext, removeData:,
removeTemporaryAttribute:forCharacterRange:, setGreekingThreshold:,
setHorizontalCornerRadius:, setIsPrimary:, setShouldAntiAlias:, setUUID:,
setVerticalCornerRadius:, shouldAntiAlias,
temporaryAttribute:atCharacterIndex:effectiveRange:,
temporaryAttribute:atCharacterIndex:longestEffectiveRange:inRange:,
temporaryAttributesAtCharacterIndex:effectiveRange:,
temporaryAttributesAtCharacterIndex:longestEffectiveRange:inRange:,
textContainerChangedTextView:, toolTip, usesBackgroundSession,
verticalCornerRadius
We had the (exactly) same problem with an Xamarin iOS Project and where able to fix it via Setting Build/iOS Build/Linker Behaviour: Link Framework SDKs only (before Don't link) - what Jack Hua link shows as solution.
We where not able, to figure out the problem behind though. Two different MacBooks where used, one with the most recent version of XCode, Visual Studio and Xamarin Libs, the other with slightly older versions. The latter was able to create an IPA without the above described error, the updated machine was not.
However the used NugGet Packages where the same, so I think this issue is not related to them.
After filling an internal issue with the Xamarin team, they advised doing the following
adding --linksdkonly to the Additional mtouch arguments on the iOS Build settings page
As it seems that Visual Studio ignores the settings in GUI
I have tested it and now get my build accepted by Apple without the above error
This is the issue filed on Xamarin
https://github.com/xamarin/xamarin-macios/issues/5913
I find a thread where people meet the same problem with you recently:build-status-has-changed-to-invalid-binary.
So, I guess some third part nuget packages you are using has updated and using these non-public selectors that Apple not allow.
I would suggest you to get you code three weeks ago and don't update any third part nuget packages. Then submit again to check if it is the problem.
You can also compare your reference with the references people listed in that thread and find something similar. And any nuget packages related to Player(As I can see some player selector in the non-public selectors list)?

binding osmdroid/osmbonusback into xamarin library

At the moment I try to develope a simple maps Android application using Visual Studio 2012 and Xamarin.
For this reason I created a Binding Library, like it is desribed here:
http://developer.xamarin.com/guides/android/advanced_topics/java_integration_overview/binding_a_java_library_(.jar)/
For my app it is essential to display markers and ballons with a short title text. I did a lot of research and found out, that I should use the osmbonuspack for this purpose. I tried to implement the "osmbonuspack_v4.5.jar" in my binding project as "Embedded Jar" but I think it's the wrong attempt.
Did someone managed it already to create a Xamaring Binding Library of the osmbonuspack? I would appreciate every attempt!

Xamarin iOS Error on try debug application on iPhone 5

When we try to debug application on device (iPhone 5) get error
MT2002: Failed to resolve "System.Linq.Expressions.BlockExpression System.Linq.Expressions.Expression::Block(System.Type,System.Collections.Generic.IEnumerable`1)"
This bug marked as solved don't help us.
https://bugzilla.xamarin.com/show_bug.cgi?id=14765
There are a few things to consider if you use, even indirectly, System.Linq.Expressions (SLE).
This requires code generation and that's not something possible under iOS. This feature is not supported on Xamarin.iOS. SLE is part of the Dynamic Language Runtime (DLR);
There is partial support for SLE using an interpreter. That has been shipped with Xamarin.iOS for long time - but it only provide a subset of the features. Sadly the existing API is not 100% identical to the one used by MS and it can
cause issues when building (e.g. using PCL assemblies). This is why you're getting those MT2002 errors (your assembly tries to override an non-existing member).
A maintenance release of Xamarin.iOS (7.2.1+) includes a better (more features) and API-compatible SLE interpreter.
You need to change your Linq statement that is causing this. I faced this problem once (I was using a third party DB), Unfortunately the actual devices don't support JIT but the simulator does. Do your Linq statement differently.

WSHLST app Error in Android

I have downloaded WSHLST from GitHub and followed the project setup in Azure mobile services. It's worked with Windows Phone, but when i build against Android throws the below error page.
Note: The errors are something related to 'Android.Content.Context' error.
For the below code it shows the error. Kindly find below the image for your reference. Kindly help me to execute the solution in android.
var picker = new MediaPicker(activity.Activity);
I think WshLst and the assemblies in that repo were built before the Xamarin 2.0 launch. During that launch, Xamarin changed their strong name signing key - so that is probably the problem you are hitting.
If you want to use that code, then you'll need to update several assemblies/dependencies to get that working - see some info on threads like:
http://forums.xamarin.com/discussion/1476/changes-to-assembly-strongnames-in-xamarin-android-4-6-0
http://forums.xamarin.com/discussion/1475/changes-to-assembly-strongnames-in-xamarin-ios-6-2-0
That code is almost a year old now - and given the fast pace of development of all 3 of Xamarin, Azure Mobile Services and MvvmCross, then I expect you'll need to update quite a lot to make this codebase live again - but doing so could be very useful for others who follow you.

Resources