NuGet lokális Cache törlés egyszerűen

Amennyiben azt feltételezzük, hogy a Visual Studio a nugetek cachelése miatt nem működik úgy, ahogy az elvárt lenne, abban az esetben lehetőségünk van a lokális cache-t üríteni.

GUI megoldás:
ToolsOptionsNuGet Package ManagerPackage manager settings Clear All Nuget cache

CLI megoldás:
1. nuget.exe beszerzése – https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
2. Parancs kiadása

nuget locals all -clear
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.

Android: Application auto backup ki/be kapcsolása (Xamarin is)

Android 6.0 óta (API verzió v23) bevezették az Androidba, hogy az alkalmazás fájljairól biztonsági mentést készít az operációs rendszer a felhasználó Google drive-jára. A backupok mérete maximum 25MB lehet, és az Android a JobScheduler API-jával készülnek 24 órás időintervallumban. További információk itt: https://developer.android.com/guide/topics/data/autobackup

Az érintett fájlok:

  • Shared preferences files
  • Files in the directory returned by getFilesDir()
  • Files in the directory returned by getDatabasePath(String)
  • Files in directories created with getDir(String, int)
  • Files on external storage in the directory returned by getExternalFilesDir(String)

Mivel a Xamarin Essentials a SharedPreferencesbe teszi a Preferences statikus osztály által tárolt adatokat, ezért azok is mentésre kerülnek.

A be/ki kapcsoláshoz az AndroidManifest.xml-ben a következő propertyre van szükség az application tagben:

android:allowBackup="true"
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.

Android: Alkalmazás aláíró kulcs ujjlenyomatának megtekintése Windowson

Nyissunk egy ADB.exe-t.

Keressük meg a .apk kiterjesztésű fájlunkat, és csomagoljuk ki, mintha egy zip állomány lenne. Én a WinRaR programot használtam ehhez. Keressük ki a META/INF mappát, és ott lesz egy .RSA kiterjesztésű fájl. Másoljuk olyan helyre, ahonnan könnyen írhatunk elérési útvonalat hozzá.

Gépeljük az ADB-be a következőt:

keytool -printcert -file <elérési út / "C:\good.RSA">

A végeredmény valahogy így néz ki (Nem eltakarva az adatokat):

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.