Xamarin Android: “Program type already present”

AndroidX migráció után a következő hibaüzenettel nem fordul le az alkalmazás:

D8 : error : Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy

Próbáltam mindent, kitöröltem a lokális NuGet Cache-t, az összes bin és obj mappát, Cleanelni a Solutiont, Restoreolni a NuGet-eket. Nem járt eredménnyel semmi sem. Aztán nyitottam egy hibát az AndroidX repo-n (https://github.com/xamarin/AndroidX/issues/100) , ahol a megszokotthoz képest lassan reagáltak, akkor sem tudtak érdemben segíteni, így magamnak kellett megoldást találni a problémára.

Elsőre feltelepítettem egy virtuális gépre friss Windows 10-et, rá pedig egy 2019-es Visual Studio Community-t. Lecloneoztam a repositoryt, megfordítottam, és sikeresen lefordult. Itt már gondoltam, hogy valami specifikus hiba lesz. Pár hétre jegelve lett a projekt, majd végül a megoldása az lett, hogy a host gépen teljesen eltávolítottam fizikailag az Azure DevOps GIT alapú repositoryt, majd újra leszedtem a remote-ról, és működött.

This content has 4 years. Some of the information in this post may be out of date or no longer work. Please, read this page keeping its age in your mind.

Xamarin Forms: “AllowUnsecureUrls” by “XamarinDownloadArchives”

Fordításnál (jellemzően Windowsos Visual Studioban git alapú branch váltásnál) a következő hibát kapjuk:

MSB4064: The "AllowUnsecureUrls" parameter is not supported by the "XamarinDownloadArchives" task. Verify the parameter exists on the task, and it is a settable public instance property.

Számomra minden esetben az IDE újraindítása odja meg a problémát.

This content has 4 years. Some of the information in this post may be out of date or no longer work. Please, read this page keeping its age in your mind.

Xamarin iOS: UIWebView Deprecation megoldása

Április 30-tól az AppStore-ba nem tölthetjük fel az UIWebView implementációt tartalmazó binárisainkat. Erről korábban írtam már a blogon, hogy miért problémás, a Xamarin fejlesztésnél ez a történet.

Amennyiben sikerült felimádkoznunk a legfrissebb csomagokat a Solutionre, abban az esetben az iOS projekt mtouch argumentumai közé a következőt kell beállítanunk:

--optimize=experimental-xforms-product-type 

Figyelni kell rá, hogy ahol CustomWebViewRenderer-t használunk, ott az ősosztály ne WebViewRenderer legyen, hanem WKWebViewRenderer.

Ezen felül a linking-nél a linker behaviourt vagy Link all, vagy Link Framework SDK-s only-ra kell állítani.

This content has 4 years. Some of the information in this post may be out of date or no longer work. Please, read this page keeping its age in your mind.

Xamarin Android: Symbols were found but are not matching the assembly

Android app fordítása meghal a következő hibával:

Symbols were found but are not matching the assembly
at Mono.Cecil.ModuleDefinition.ReadSymbols(ISymbolReader reader, Boolean throwIfSymbolsAreNotMaching)
at Mono.Cecil.ModuleReader.ReadSymbols(ModuleDefinition module, ReaderParameters parameters)
at Mono.Cecil.ModuleReader.CreateModule(Image image, ReaderParameters parameters)
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
at Xamarin.AndroidX.Migration.CecilMigrator.Migrate(String source, String destination)
at Xamarin.AndroidX.Migration.CecilMigrator.Migrate(IEnumerable`1 assemblies)
at Xamarin.AndroidX.Migration.BuildTasks.CecilfyFiles.Execute()

Xamarin Forms verzió növelés (4.5), és AndroidX csomag telepítés után.

Frissen telepített Windowson, és friss VisualStudion nem jött a hiba. A bin/obj könyvtárak törlése nem oldja meg a problémát.

A hiba a hibás PDB fájlokból származhat. GitHub-on nyitottam hozzá egy Issue-t, ami itt található: https://github.com/xamarin/AndroidX/issues/93

Xamarin/AndroidXMigration 1.0.6-ban javítva.

This content has 4 years. Some of the information in this post may be out of date or no longer work. Please, read this page keeping its age in your mind.

Xamarin iOS: Nem reagál az alkalmazás az értintésekre

Konzolban a hibaüzenet található, de az alkalmazás hiba nélkül kifordul, de az iOS 13.4.1-es verziót futtató eszközökön az érintések nem működnek.

Hiba a konzolban:

2020-04-12 15:25:09.177 PROJNAME.iOS[521:71276] <_UISystemGestureGateGestureRecognizer: 0x283c60b00>: Touch: Failed to receive system gesture state notification before next touch
2020-04-12 15:25:09.177 PROJNAME.iOS[521:71276] <_UISystemGestureGateGestureRecognizer: 0x283c60900>: Gesture: Failed to receive system gesture state notification before next touch

Megoldás: Visual Studio for Mac 8.5.1-es verzióról (vagy ennél kisebb verzióról) fel kell frissíteni a MacVS-t, a Windowsos verzójában a hiba a 16.5.2-től lett orvosolva.

https://github.com/xamarin/Xamarin.Forms/issues/10162

This content has 4 years. Some of the information in this post may be out of date or no longer work. Please, read this page keeping its age in your mind.