HMS-Core / hms-xamarin-bindings

This repo contains all of Xamarin HMS plugins.
https://developer.huawei.com/consumer/en/doc/overview/HMS-Core-Plugin?ha_source=hms1
Apache License 2.0
36 stars 11 forks source link

Xamarin Forms Project does not compile when use Hianalytics #10

Open rotsen24154 opened 2 years ago

rotsen24154 commented 2 years ago

I am trying to integrate Huawei Analytics on my Xamarin Forms App, I added the nugets, and if I compile the project everything works well, but when I add this line:

Huawei.Hms.Analytics.HiAnalyticsInstance instance;

I got this message

The process cannot access the file 'ProjectRoute\obj\Debug\120\androidx\cecil\Huawei.Hms.Hianalytics.dll' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
   at Xamarin.AndroidX.Migration.CecilMigrator.ReadAssembly(AssemblyResolver resolver, String path)
   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()  

I am using the last nuget version from HiAnalytics.

image

This is the code that cause all the problem