xamarin / GooglePlayServicesComponents

Other
315 stars 148 forks source link

Suddenly started getting error on archive of app, could not AOT the assembly Xamarin.GooglePlayServices.Vision.dll #484

Open mjbedford2017 opened 3 years ago

mjbedford2017 commented 3 years ago

Xamarin.Android Version (eg: 6.0):

Xamarin.Android 11.3.0.4

Operating System & Version (eg: Mac OSX 10.11):

WIndows 10 Pro Visual Studio 2019 Version 16.10.2

Google Play Services Version

71.1700.4

Describe your Issue

When I say suddenly started getting this error it is because between the last time I was able to archive successfully, just a few days ago and today, I did not change any code, packages, etc... I can do a clean and rebuild successfully for both debug and release and even debug the app on my device. It isn't until I go to archive the app to package it for apk that I get the following error:

XA3001: Could not AOT the assembly: Xamarin.GooglePlayServices.Vision.dll Done building project "PacTracMobile.Droid.csproj" -- FAILED. Build FAILED

Yes, I do have AOT compilation turned on but I have had that turned on for over a year now and have not changed any of my csproj settings in a while. So, I am not sure why this started happening.

Things I have tried:

  1. Updated Visual Studio
  2. Delete bin and obj folders
  3. Clean and rebuild. Again, this works, I can build.
  4. Restart Visual Studio
  5. Removed nuget package, deleted the cache of files in the .nuget folder and then re-added the nuget package.
  6. I did try to upgrade the nuget package to 124.1.0 but it looks like I need to reference AndroidX components for that version and I cannot do that yet.

Relevant information

Add relevant project settings from *.csproj file:

Packages used:

3.3.0
<PackageReference Include="Microsoft.AppCenter.Crashes">
  <Version>3.3.0</Version>
</PackageReference>
<PackageReference Include="Newtonsoft.Json">
  <Version>12.0.3</Version>
</PackageReference>
<PackageReference Include="Polly">
  <Version>7.2.1</Version>
</PackageReference>
<PackageReference Include="Serilog">
  <Version>2.9.0</Version>
</PackageReference>
<PackageReference Include="Serilog.Sinks.Async">
  <Version>1.4.0</Version>
</PackageReference>
<PackageReference Include="Serilog.Sinks.File">
  <Version>4.1.0</Version>
</PackageReference>
<PackageReference Include="Serilog.Sinks.RollingFile">
  <Version>3.3.0</Version>
</PackageReference>
<PackageReference Include="sqlite-net-sqlcipher">
  <Version>1.7.335</Version>
</PackageReference>
<PackageReference Include="Symbol.XamarinEMDK">
  <Version>6.0.0.58</Version>
</PackageReference>
<PackageReference Include="Syncfusion.Xamarin.SfCarousel.Android">
  <Version>18.1.0.56</Version>
</PackageReference>
<PackageReference Include="Syncfusion.Xamarin.SfDataGrid.Android">
  <Version>18.1.0.56</Version>
</PackageReference>
<PackageReference Include="Syncfusion.Xamarin.SfPopupLayout.Android">
  <Version>18.1.0.56</Version>
</PackageReference>
<PackageReference Include="Xam.Plugin.Media">
  <Version>5.0.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.Transition">
  <Version>28.0.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.Android.Support.v17.Leanback">
  <Version>28.0.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.Android.Support.v4">
  <Version>28.0.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat">
  <Version>28.0.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.Controls.SignaturePad">
  <Version>3.0.0</Version>
</PackageReference>
<PackageReference Include="Xamarin.Essentials">
  <Version>1.6.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.Firebase.ML.Vision">
  <Version>71.1700.4</Version>
</PackageReference>

Build settings (tools)

Dex is set to D8

<AndroidUseAapt2>true</AndroidUseAapt2>
<DebugSymbols>false</DebugSymbols>
<DebugType>portable</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;RELEASE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidManagedSymbols>true</AndroidManagedSymbols>
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
<AndroidLinkMode>SdkOnly</AndroidLinkMode>
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
<BundleAssemblies>true</BundleAssemblies>
<AndroidCreatePackagePerAbi>false</AndroidCreatePackagePerAbi>
<AndroidPackageFormat>apk</AndroidPackageFormat>
<AndroidStoreUncompressedFileExtensions>.mp3;.wav;.sqlite</AndroidStoreUncompressedFileExtensions>
<AotAssemblies>true</AotAssemblies>
<EnableLLVM>true</EnableLLVM>
<AndroidEnableProfiledAot>false</AndroidEnableProfiledAot>
<AndroidSupportedAbis />
<AndroidLinkTool>
</AndroidLinkTool>
<MandroidI18n />

or even better - links to the existing code:

NOTE: Please DO NOT submit screenshot images. Images are not searchable!

Minimal Repro Code Sample

If you want to speed up investigation and bug fixing: please provide minimal repro sample for tests.

Steps to Reproduce (with link to sample solution if possible):

Include any relevant Exception Stack traces, build logs, adb logs:

mjbedford2017 commented 3 years ago

I set the output verbosity to diagnostic and collected this. The AOT is going fine the whole time, notice the one before worked just fine but then it gets to this one and fails to AOT. Here is the detailed log:

[AOT] response file obj\Release\90\aot\arm64-v8a\Xamarin.Google.AutoValue.Annotations.dll\response.txt: --llvm "--aot=outfile=obj\Release\90\aot\arm64-v8a\libaot-Xamarin.Google.AutoValue.Annotations.dll.so,asmwriter,mtriple=aarch64-linux-android,tool-prefix=C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\aarch64-linux-android-4.9\prebuilt\windows-x86_64\bin\aarch64-linux-android-,llvm-path=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\Android,temp-path=obj\Release\90\aot\arm64-v8a\Xamarin.Google.AutoValue.Annotations.dll,ld-name=ld.exe,ld-flags=\"C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\aarch64-linux-android-4.9\prebuilt\windows-x86_64\lib\gcc\aarch64-linux-android\4.9.x\libgcc.a\";\"C:\Program Files (x86)\Android\android-sdk
dk-bundle\platforms\android-21\arch-arm64\usr\lib\libc.so\";\"C:\Program Files (x86)\Android\android-sdk
dk-bundle\platforms\android-21\arch-arm64\usr\lib\libm.so\"" C:\OdenRepo\Applications\OdenIndustries.PacTracMobile-RecipientSearch\PacTracMobile.Droid\obj\Release\90\android\assets\shrunk\Xamarin.Google.AutoValue.Annotations.dll

[AOT] response file obj\Release\90\aot\arm64-v8a\Xamarin.GooglePlayServices.Base.dll\response.txt: --llvm "--aot=outfile=obj\Release\90\aot\arm64-v8a\libaot-Xamarin.GooglePlayServices.Base.dll.so,asmwriter,mtriple=aarch64-linux-android,tool-prefix=C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\aarch64-linux-android-4.9\prebuilt\windows-x86_64\bin\aarch64-linux-android-,llvm-path=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\Android,temp-path=obj\Release\90\aot\arm64-v8a\Xamarin.GooglePlayServices.Base.dll,ld-name=ld.exe,ld-flags=\"C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\aarch64-linux-android-4.9\prebuilt\windows-x86_64\lib\gcc\aarch64-linux-android\4.9.x\libgcc.a\";\"C:\Program Files (x86)\Android\android-sdk
dk-bundle\platforms\android-21\arch-arm64\usr\lib\libc.so\";\"C:\Program Files (x86)\Android\android-sdk
dk-bundle\platforms\android-21\arch-arm64\usr\lib\libm.so\"" C:\OdenRepo\Applications\OdenIndustries.PacTracMobile-RecipientSearch\PacTracMobile.Droid\obj\Release\90\android\assets\shrunk\Xamarin.GooglePlayServices.Base.dll

XA3001: Could not AOT the assembly: Xamarin.GooglePlayServices.Vision.dll
Done executing task "Aot" -- FAILED.
Done building target "_BuildApkEmbed" in project "PacTracMobile.Droid.csproj" -- FAILED.
Done building project "PacTracMobile.Droid.csproj" -- FAILED.
Build FAILED.