Xamarin.Forms 2.3.4.247

DavidOrtinauDavidOrtinau David OrtinauUSXamarin Team, Insider, University Xamurai
edited May 16 in Xamarin.Forms

We've published service release 2.3.4.231 to address some priority issues based on your feedback. Thank you!

Important notes

  • Behavior Change (iOS): ViewDidDisappear may not be reliably called in custom renderers. Please be sure to override Dispose to do any object cleanup that you may be doing in ViewDidDisappear to prevent any possible memory leaks in your custom renderers. (53351)
  • Behavior Change (UWP): Desktop is now a supported Idiom, so your UWP apps will return this value on desktop contexts. Please be aware that Phone will still be returned in continuum scenarios.
  • Behavior Change: Merged ResourceDictionaries will now return a Count that is consistent with the content in the enumeration instead of the total Count of Resources.
  • Breaking Change: Attached Properties are now compiled when XamlC is enabled! If you have XamlC enabled, you must implement a public getter/setter for all attached properties to prevent a compile time error.

2.3.4.247-sr2

  • Fix XAMLC build errors in mono 5.0
  • Fix 55365 – ~VisualElement crashes with System.Runtime.InteropServices.COMException

2.3.4.231-sr1

  • [2.3.4] [Android] OnResume assumed that _application had been set (PR)
  • [Xaml] [2.3.4] Do not emit implict_op if from/to are same type (PR)
  • [C] [2.3.4] Lookup in ResourceDictionary also performans a lookup in merged ResourceDictionary (PR)
  • 54334 - "Styles will override properties on UI-Elements when changing resource dictionaries" (PR)

2.3.4.224

For highlights check out the blog announcement and for all the details review the full release notes.

If you have a bug to report, drop us a detailed report here so we can investigate.

«134

Posts

  • NMackayNMackay Norman Mackay GBInsider, University ✭✭✭✭✭
    edited April 5

    @DavidOrtinau

    Thanks, there's a lot of fixes and good stuff in 2.3.4.

    Any ideas what happened regarding this PR this was breaking the maps renderer in pre6 that was fine in pre5?

    https://github.com/xamarin/Xamarin.Forms/pull/824

  • EmmanuelVazquezEmmanuelVazquez Emmanuel Vazquez USMember ✭✭

    Any word on this bug? I would like to update our Android version however this crashes our app. Thanks.

  • MartSMartS Mart Somermaa USMember

    Thanks for your good efforts!

    I attempted to upgrade NuGet packages, but the upgrade failed with the following error:

    Unable to resolve dependencies. 'Xamarin.Android.Support.Design 25.1.1' is not compatible with 'Xamarin.Forms 2.3.4.224 constraint: Xamarin.Android.Support.Design (= 23.3.0)'.

    Any plans to update Xamarin.Android version compatibility?

  • DavidOrtinauDavidOrtinau David Ortinau USXamarin Team, Insider, University Xamurai

    @NMackay said:
    @DavidOrtinau

    Thanks, there's a lot of fixes and good stuff in 2.3.4.

    Any ideas what happened regarding this PR this was breaking the maps renderer in pre6 that was fine in pre5?

    https://github.com/xamarin/Xamarin.Forms/pull/824

    I spoke with the team about your issue. Apologies for now getting right back to you previously. Changing to GetMapAsync and the resulting underlying Google Map implementation changes how it behaves, so you may need to make adjustments to when you expect or access things in your implementation. I apologize that's a bit of telephone game in that answer, so if you're not able to readily figure out what changes you might need, shoot me your sample and we'll see if we can determine what's going on.

  • DavidOrtinauDavidOrtinau David Ortinau USXamarin Team, Insider, University Xamurai

    @EmmanuelVazquez said:
    Any word on this bug? I would like to update our Android version however this crashes our app. Thanks.

    If you can wait for an updated CarouselView, we are working on that now and will confirm it address this issue. Otherwise, it looks like @PhilippSumi identified a workaround that you might be able to leverage.

  • JimmyGarridoJimmyGarrido Jimmy Garrido USXamarin Team Xamurai
    edited April 5

    @MartS You should now be able to update the Android Support packages if your project's Target Framework is set to Android 7.0 or higher.

    If you were using Forms 2.3.3.180, be sure to update the Forms package first before trying to update the other ones. That version still required the hard dependencies for all Android versions and the package manager may be updating the support packages before installing the compatible Forms version.

  • NMackayNMackay Norman Mackay GBInsider, University ✭✭✭✭✭

    @DavidOrtinau

    Hi David, I can pass on the renderer code directly tomorrow if that helps, I'll test with 2.3.4 stable, I just followed the recommended renderer guidelines although I found a few issues in the iOS one that affects newer iOS versions so it wouldn't hurt to update the iOS sample.

    Thanks.

  • MiguelCervantesMiguelCervantes Miguel Cervantes MXMember ✭✭✭
    edited April 5

    Is SetBinding < T > obsolete?? Why?

  • rogiheerogihee Rogier van der Hee NLMember ✭✭✭

    @MiguelCervantes I recall Jason Smith telling that somehow the generic binding generates a lot of IL code and is app size / performance hit.

  • MellsonMellson Anders Bech Mellson DKUniversity ✭✭

    @JimmyGarrido after upgrading I can no longer run my Android build (targeting 7.1)

    I get a nullpointer ref when I try to start the app from Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:235 at Android.App.Activity.n_OnResume

    I get the same error no matter if I use support libraries version 23.3.0 or 25.1.1

    Any ideas as to what could cause this problem?
    My iOS build works fine after the upgrade.

  • EugenRichterEugenRichter Eugen Richter DEMember

    How do I get the resources from merged dictionary programmatically?
    In the 2.3.3 version the following worked well to get a resource from merged dictionary:

    object res = null;
    resourceDict.TryGetValue(resourceKey, out res);
    // Or
    var res = resourceDict.Any(f => f.Key == resourceKey) ? (T)resourceDict[resourceKey] : defaultValue;
    

    In 2.3.4 it is not possible anymore. Is there a working workaround? All posibilities to access the merged resources are declared as internal :(

    We need the possibility to get resources also from merged dictionaries in code.

  • ChristianSvrdChristianSvrd Christian Svärd SEMember ✭✭

    what is attached properties? I keep getting XamlC error when trying to build with the latest Xamarin.Forms

  • JKayJKay James Kennedy USMember ✭✭✭
    edited April 6

    @DavidOrtinau Device.OS is now marked as obsolete, It says use Device.RuntimePlatform instead which is of type string I can't see any information in any release notes about this. Can you give a bit more info and what we should be using instead?

    Other than that. Looks good!

  • MellsonMellson Anders Bech Mellson DKUniversity ✭✭

    @JKay said:
    @DavidOrtinau Device.OS is now marked as obsolete, It says use Device.RuntimePlatform instead which is of type string I can't see any information in any release notes about this. Can you give a bit more info and what we should be using instead?

    Other than that. Looks good!

    Have a look at the thread in this pull request - https://github.com/xamarin/Xamarin.Forms/pull/658

  • JKayJKay James Kennedy USMember ✭✭✭

    @mellson Thanks for the link. I've had a quick look but am still pretty confused.

    What would the following become?

    if (Device.OS == TargetPlatform.Android)

    would be...?

    if (Device.RuntimePlatform == ?)

  • NMackayNMackay Norman Mackay GBInsider, University ✭✭✭✭✭

    @JKay

                string imagePath;
                switch (Device.RuntimePlatform)
                {
                    case Device.Android:
                        imagePath = SourceImage;
                        break;
                    case Device.iOS:
                        imagePath = SourceImage + ".png";
                        break;
                    case Device.WinPhone:
                        imagePath = "Images/" + SourceImage + ".png";
                        break;
                    case Device.Windows:
                        imagePath = "Images/" + SourceImage + ".png";
                        break;
    
  • JKayJKay James Kennedy USMember ✭✭✭

    @NMackay Excellent! Cheers

  • NMackayNMackay Norman Mackay GBInsider, University ✭✭✭✭✭

    In XAML you'd do something like this

                <Grid.Padding>
                        <OnPlatform x:TypeArguments="Thickness">
                          <On Platform="iOS">10,5,10,5</On>
                          <On Platform="Android,WinPhone">5,5,5,5</On>
                        </OnPlatform>
                      </Grid.Padding>
    
  • MellsonMellson Anders Bech Mellson DKUniversity ✭✭

    @JKay said:
    @mellson Thanks for the link. I've had a quick look but am still pretty confused.

    What would the following become?

    if (Device.OS == TargetPlatform.Android)

    would be...?

    if (Device.RuntimePlatform == ?)

    That would now be if (Device.RuntimePlatform == Device.Android)

  • BobbyTablesBobbyTables first last GBMember ✭✭

    Using Device.RuntimePlatform == Device.Android throws an exception when I try to use it (''Xamarin.Forms.Device.get_RuntimePlatform' not found'). All projects are using the latest nuget package.

  • ThomasFlemmingThomasFlemming Thomas Flemming DEMember ✭✭

    After upgrading to 2.3.4.224 I get this error on UWP on start of debugging:

    System.NullReferenceException occurred
    Message: Exception thrown: 'System.NullReferenceException' in Xamarin.Forms.Platform.UAP.dll
    Additional information: Object reference not set to an instance of an object.

    Xamarin.Forms.Platform.UAP.dll!Xamarin.Forms.Platform.UWP.ButtonRenderer.UpdateContent.AnonymousMethod__0(object sender, Windows.UI.Xaml.RoutedEventArgs args) Unknown

    But only with target x86 or x64 on local mashine. Target mobile emulator works with no error.
    Moving back to 2.3.4.221-pre6 doesn't solve the problem, although it was fine before upgrading to 2.3.4.224

    Any ideas?

  • MellsonMellson Anders Bech Mellson DKUniversity ✭✭

    @BobbyTables said:
    Using Device.RuntimePlatform == Device.Android throws an exception when I try to use it (''Xamarin.Forms.Device.get_RuntimePlatform' not found'). All projects are using the latest nuget package.

    Try to clean your build and remove all existing versions of the app on simulators / devices. Maybe that could help?

  • DavidOrtinauDavidOrtinau David Ortinau USXamarin Team, Insider, University Xamurai

    @ChristianSvrd said:
    what is attached properties? I keep getting XamlC error when trying to build with the latest Xamarin.Forms

    Attached Properties: https://developer.xamarin.com/guides/xamarin-forms/xaml/attached-properties/

    More XAML features are now compiled, so some things like these needing a public getter and setter will be more strictly enforced. That may not be your exact issue, but it is an example that came up during the pre-release process.

  • DavidOrtinauDavidOrtinau David Ortinau USXamarin Team, Insider, University Xamurai

    @JKay @Mellson yes, the PR you referenced is to allow adding other platforms with greater ease. I'll add a comment to the release notes.

    @BobbyTables your issue looks related, but I believe that should still work. As suggested, obliterate (delete bin/obj), clean and rebuild.

  • DavidOrtinauDavidOrtinau David Ortinau USXamarin Team, Insider, University Xamurai

    @EugenRichter I believe what you want is more easily access in code with Application.Current.Resources["resourceName"].

  • EugenRichterEugenRichter Eugen Richter DEMember

    @DavidOrtinau Yes. this exactly what we used till 2.3.4 version (with chekc for existance bevor access). But this dowsn't work anymore, if the resource is located in a merged resource of the application.

  • BobbyTablesBobbyTables first last GBMember ✭✭

    On both Android and iOS I now get an exception when trying to access Application.Current.Resources["resourceName"]:
    System.Collections.Generic.KeyNotFoundException: The resource 'resourceName' is not present in the dictionary. I am using a merged ResourceDictionary.

  • BobbyTablesBobbyTables first last GBMember ✭✭

    @DavidOrtinau thanks for your prompt response, very much appreciated. I've tried deleting all the things/clean/rebuild but still get the 'get_RuntimePlatform' not found message.

  • BrightLeeBrightLee Bright Lee KRMember ✭✭✭

    @BobbyTables Did you try to delete app too?

  • BobbyTablesBobbyTables first last GBMember ✭✭

    @BrightLee yes, and also tried on a brand new simulator in case somehow there was still anything hanging around.

  • JimmyGarridoJimmyGarrido Jimmy Garrido USXamarin Team Xamurai

    @Mellson Based on that bit of stack trace, the crash is happening here which doesn't seem like it should be affected by the target version.

    Is this also happening with a new project that targets Android 7.1? Does it still happen if you target another version? What emulator or device are you also testing on? If you downgrade to Forms 2.3.3.193, does the app launch successfully again?

  • MellsonMellson Anders Bech Mellson DKUniversity ✭✭
    edited April 6

    @JimmyGarrido said:
    @Mellson Based on that bit of stack trace, the crash is happening here which doesn't seem like it should be affected by the target version.

    Is this also happening with a new project that targets Android 7.1? Does it still happen if you target another version? What emulator or device are you also testing on? If you downgrade to Forms 2.3.3.193, does the app launch successfully again?

    Hi @JimmyGarrido thanks for reply! I actually just tracked the error to that exact location :smile:
    I have created a pull request that just adds a null check before the _application instance is used.

    The reason the application is not set is that I have a splash activity that I show before loading my main activity containing the application.

    Yes it used to work before this change was merged.

  • kikolopes90kikolopes90 Jorge Lopes PTMember ✭✭

    I tested my app the "MasterDetailPage" does not appear, do not know why.

    XF 2.3.4.214-pre5 already works!

  • PaulDiPietroPaulDiPietro Paul DiPietro USXamarin Team Xamurai

    @kikolopes90 can you elaborate on which platform and if this is from a template or an app you're already working on? Have you tried the usual clearing of bin/obj and rebuilding?

  • MiguelCervantesMiguelCervantes Miguel Cervantes MXMember ✭✭✭

    @StephaneDelcroix said:
    @MiguelCervantes:

    Why is SetBinding<T> obsolete

    Well, there are multiple reasons...

    1. Because all the BindableProperties.Create<,> were obsoleted (see why in 2.)
    2. Because the Expressions used as arguments are evaluated at runtime, and on runtimes without a JIT, they rely on an IL interpreter which is kinda slow (we shaved a few 100ms of startup time by changing all of our internals BP.Create<,> to the non-generic version.
    3. Because you can achieve the same level of source safety (making sure that a property rename refactoring doesn't break all of your code) by using nameof()

    @StephaneDelcroix and @rogihee

    Ok no that makes a lot of sense to me, and yes indeed I was worried about source safety! but performance enhancements are always welcome!

    So in general getting rid of generics is a boost on performance?

  • MarketAllyMarketAlly Dave Friedel USMember ✭✭

    now the "[global::Xamarin.Forms.Xaml.XamlFilePathAttribute" is erroring in all my views.

    XamlFilePathAttribute is not found :(

  • DavidOrtinauDavidOrtinau David Ortinau USXamarin Team, Insider, University Xamurai

    @EugenRichter @BobbyTables We've revisited the design discussion around ResourceDictionary and merged dictionary key lookup behavior. We are going to make an adjustment and will push out a service release that remedies your situation.

    In general, ResourceDictionaries are designed as a XAML feature and we recommend you only use them in code when required. A static variable would be easier and more efficient.

  • ClayZuvichClayZuvich Clay Zuvich USMember ✭✭

    Is there any guidance on how to get a reference to the Android MapRenderer NativeMap when the map is ready to consume? It looks like the IOnMapReadyCallback is implemented explicitly and there are not any events nor methods that notify subclasses.

    I am currently drawing routes on the GoogleMap; however, I can't figure out how to get a reference to the NativeMap at the right time.

«134
Sign In or Register to comment.