Repository navigation
Can't build in Release: Xamarin.AndroidX.Migration.targets(227,9): error : Symbols were found but are not matching the assembly #79
Description
Xamarin.Android Version (eg: 6.0):
Operating System & Version (eg: Mac OSX 10.11):
MacOS 10.15.3
Support Libraries Version (eg: 23.3.0):
=== Visual Studio Community 2019 for Mac (Preview) ===
Version 8.5 Preview (8.5 build 3178)
Installation UUID: 33ba9349-a2e6-4f41-b8f4-0ead5fc49e6e
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 6.14.1.39 (d16-5 / 30e8706b4)
Package version: 608000123
=== Mono Framework MDK ===
Runtime:
Mono 6.8.0.123 (2019-10/1d0d939dc30) (64-bit)
Package version: 608000123
=== Xamarin Designer ===
Version: 16.5.0.471
Hash: 35aa4889d
Branch: remotes/origin/d16-5
Build date: 2020-02-25 00:52:08 UTC
=== Roslyn (Language Service) ===
3.5.0-beta4-20125-04+1baa0b3063238ed752ad1f0368b1df6b6901373e
=== NuGet ===
Version: 5.4.0.6315
=== .NET Core SDK ===
SDK: /usr/local/share/dotnet/sdk/3.1.200/Sdks
SDK Versions:
3.1.200
3.1.102
3.1.101
3.1.100
3.0.101
3.0.100
2.1.701
2.1.700
2.1.505
2.1.504
2.1.503
2.1.302
2.1.301
2.1.4
2.0.0
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.8.0/lib/mono/msbuild/Current/bin/Sdks
=== .NET Core Runtime ===
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
3.1.2
3.1.1
3.1.0
3.0.1
3.0.0
2.1.16
2.1.15
2.1.14
2.1.13
2.1.12
2.1.11
2.1.9
2.1.8
2.1.7
2.1.2
2.1.1
2.0.5
2.0.0
=== Xamarin.Profiler ===
Version: 1.6.12.26
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
=== Updater ===
Version: 11
=== Apple Developer Tools ===
Xcode 11.3.1 (15715)
Build 11C504
=== Xamarin.Mac ===
Version: 6.14.1.39 (Visual Studio Community)
Hash: 30e8706b4
Branch: d16-5
Build date: 2020-02-20 16:41:47-0500
=== Xamarin.iOS ===
Version: 13.14.1.39 (Visual Studio Community)
Hash: 30e8706b4
Branch: d16-5
Build date: 2020-02-20 16:41:48-0500
=== Xamarin.Android ===
Version: 10.2.0.100 (Visual Studio Community)
Commit: xamarin-android/d16-5/988c811
Android SDK: /Users/admin/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
7.1 (API level 25)
8.1 (API level 27)
SDK Tools Version: 26.1.1
SDK Platform Tools Version: 29.0.6
SDK Build Tools Version: 29.0.2
Build Information:
Mono: c0c5c78
Java.Interop: xamarin/java.interop/d16-5@fc18c54
ProGuard: xamarin/proguard@905836d
SQLite: xamarin/sqlite@46204c4
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-5@9f4ed4b
=== Microsoft Mobile OpenJDK ===
Java SDK: /Users/admin/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL
=== Android SDK Manager ===
Version: 16.5.0.39
Hash: 6fb4c79
Branch: remotes/origin/d16-5
Build date: 2020-02-20 23:25:56 UTC
=== Android Device Manager ===
Version: 16.5.0.71
Hash: 49194e8
Branch: remotes/origin/d16-5
Build date: 2020-02-20 23:26:18 UTC
=== Xamarin Inspector ===
Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1
=== Build Information ===
Release ID: 805003178
Git revision: bc5bb028e622b0bf8cd8eb52fd97add17f20c9ca
Build date: 2020-03-18 15:20:43-04
Build branch: release-8.5
Xamarin extensions: bc5bb028e622b0bf8cd8eb52fd97add17f20c9ca
=== Operating System ===
Mac OS X 10.15.3
Darwin 19.3.0 Darwin Kernel Version 19.3.0
Thu Jan 9 20:58:23 PST 2020
root:xnu-6153.81.5~1/RELEASE_X86_64 x86_64
Describe your Issue:
Please see below stacktrace
Steps to Reproduce (with link to sample solution if possible):
Below is the packages I have in my Android csproj project:
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{43094198-9F89-4143-ACC7-F4A1BE97CB05}</ProjectGuid>
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace></RootNamespace>
<AssemblyName></AssemblyName>
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
<AndroidApplication>true</AndroidApplication>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<AppDesignerFolder>Properties</AppDesignerFolder>
<FileAlignment>512</FileAlignment>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<TargetFrameworkVersion>v10.0</TargetFrameworkVersion>
<AndroidStoreUncompressedFileExtensions />
<MandroidI18n />
<JavaMaximumHeapSize>4G</JavaMaximumHeapSize>
<JavaOptions />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<AndroidEnableMultiDex>true</AndroidEnableMultiDex>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>
<AndroidLinkMode>None</AndroidLinkMode>
<AndroidSupportedAbis>armeabi-v7a;x86</AndroidSupportedAbis>
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
<JavaMaximumHeapSize>4G</JavaMaximumHeapSize>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>RELEASE;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
<AndroidLinkMode>SdkOnly</AndroidLinkMode>
<JavaMaximumHeapSize>8G</JavaMaximumHeapSize>
<AotAssemblies>true</AotAssemblies>
<EnableLLVM>true</EnableLLVM>
<BundleAssemblies>true</BundleAssemblies>
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
<AndroidSupportedAbis>armeabi-v7a;arm64-v8a</AndroidSupportedAbis>
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Android" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Xml" />
<Reference Include="System.Json" />
<Reference Include="Java.Interop" />
<Reference Include="System.Collections" />
<Reference Include="System.IdentityModel" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Threading.Tasks" />
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CarouselView.FormsPlugin" Version="5.2.0" />
<PackageReference Include="Microsoft.AppCenter.Crashes">
<Version>3.0.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.AppCenter.Analytics">
<Version>3.0.0</Version>
</PackageReference>
<PackageReference Include="Plugin.CurrentActivity" Version="2.1.0.4" />
<PackageReference Include="SQLiteNetExtensions.Async">
<Version>2.1.0</Version>
</PackageReference>
<PackageReference Include="Syncfusion.Xamarin.SfPicker" Version="17.4.0.55" />
<PackageReference Include="Syncfusion.Xamarin.SfChart" Version="17.4.0.55" />
<PackageReference Include="Syncfusion.Xamarin.SfListView" Version="17.4.0.55" />
<PackageReference Include="Xamarin.Essentials" Version="1.5.1" />
<PackageReference Include="Xamarin.FFImageLoading.Forms" Version="2.4.11.982" />
<PackageReference Include="Xamarin.Forms" Version="4.5.0.396" />
<PackageReference Include="Xamarin.GooglePlayServices.Ads.Lite" Version="71.1720.1" />
<PackageReference Include="Plugin.InAppBilling">
<Version>2.0.0</Version>
</PackageReference>
<PackageReference Include="AndHUD">
<Version>1.4.2</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Work.Runtime">
<Version>2.3.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Migration">
<Version>1.0.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.AppCompat">
<Version>1.1.0</Version>
</PackageReference>
</ItemGroup>
Include any relevant Exception Stack traces, build logs, adb logs:
Target _AndroidXCecilfy:
Migrated assembly to 'obj/Release/androidx/cecil/CarouselView.FormsPlugin.Android.dll'.
Migrated assembly to 'obj/Release/androidx/cecil/Com.Android.DeskClock.dll'.
Migrated assembly to 'obj/Release/androidx/cecil/Com.ViewPagerIndicator.dll'.
Migrated assembly to 'obj/Release/androidx/cecil/Syncfusion.SfListView.XForms.Android.dll'.
Migrated assembly to 'obj/Release/androidx/cecil/Xamarin.GooglePlayServices.Basement.dll'.
/Users/admin/.nuget/packages/xamarin.androidx.migration/1.0.1/buildTransitive/monoandroid90/Xamarin.AndroidX.Migration.targets(227,9): error : Symbols were found but are not matching the assembly
/Users/admin/.nuget/packages/xamarin.androidx.migration/1.0.1/buildTransitive/monoandroid90/Xamarin.AndroidX.Migration.targets(227,9): error : at Mono.Cecil.ModuleDefinition.ReadSymbols (Mono.Cecil.Cil.ISymbolReader reader, System.Boolean throwIfSymbolsAreNotMaching) [0x0003c] in <1b16609822914d769fb771c1bb74cd3b>:0
/Users/admin/.nuget/packages/xamarin.androidx.migration/1.0.1/buildTransitive/monoandroid90/Xamarin.AndroidX.Migration.targets(227,9): error : at Mono.Cecil.ModuleReader.ReadSymbols (Mono.Cecil.ModuleDefinition module, Mono.Cecil.ReaderParameters parameters) [0x00060] in <1b16609822914d769fb771c1bb74cd3b>:0
/Users/admin/.nuget/packages/xamarin.androidx.migration/1.0.1/buildTransitive/monoandroid90/Xamarin.AndroidX.Migration.targets(227,9): error : at Mono.Cecil.ModuleReader.CreateModule (Mono.Cecil.PE.Image image, Mono.Cecil.ReaderParameters parameters) [0x00081] in <1b16609822914d769fb771c1bb74cd3b>:0
/Users/admin/.nuget/packages/xamarin.androidx.migration/1.0.1/buildTransitive/monoandroid90/Xamarin.AndroidX.Migration.targets(227,9): error : at Mono.Cecil.ModuleDefinition.ReadModule (Mono.Disposable`1[T] stream, System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x0000d] in <1b16609822914d769fb771c1bb74cd3b>:0
/Users/admin/.nuget/packages/xamarin.androidx.migration/1.0.1/buildTransitive/monoandroid90/Xamarin.AndroidX.Migration.targets(227,9): error : at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x0006c] in <1b16609822914d769fb771c1bb74cd3b>:0
/Users/admin/.nuget/packages/xamarin.androidx.migration/1.0.1/buildTransitive/monoandroid90/Xamarin.AndroidX.Migration.targets(227,9): error : at Mono.Cecil.AssemblyDefinition.ReadAssembly (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00000] in <1b16609822914d769fb771c1bb74cd3b>:0
/Users/admin/.nuget/packages/xamarin.androidx.migration/1.0.1/buildTransitive/monoandroid90/Xamarin.AndroidX.Migration.targets(227,9): error : at Xamarin.AndroidX.Migration.CecilMigrator.Migrate (System.String source, System.String destination) [0x001c2] in <a0fc649a8e4a40aab84691110eb542cb>:0
/Users/admin/.nuget/packages/xamarin.androidx.migration/1.0.1/buildTransitive/monoandroid90/Xamarin.AndroidX.Migration.targets(227,9): error : at Xamarin.AndroidX.Migration.CecilMigrator.Migrate (System.Collections.Generic.IEnumerable`1[T] assemblies) [0x00012] in <a0fc649a8e4a40aab84691110eb542cb>:0
/Users/admin/.nuget/packages/xamarin.androidx.migration/1.0.1/buildTransitive/monoandroid90/Xamarin.AndroidX.Migration.targets(227,9): error : at Xamarin.AndroidX.Migration.BuildTasks.CecilfyFiles.Execute () [0x000e3] in <1b449a83137d4707a3ad83671affa396>:0
Activity
motoko89 commentedon Mar 22, 2020
It appears that when I downgrade to Forms < 4.5, I have the option to migrate to AndroidX through right click, which did the migration correctly I think. I can build and run the app now.
However, if I upgrade to Xamarin Form 4.5 I got the below build error:
moljac commentedon Mar 23, 2020
@motoko89
Thanks for the report, but I have few questions:
Thanks
Kind regards
Mel
janusw commentedon Mar 31, 2020
I see exactly the same error here. I can build my project well in Debug mode, but in Release I get:
IIRC this happens since upgrading to Xamarin.Essentials 1.5, which depends on AndroidX. What I find strange is that the above error mentions
monoandroid90, although I'm targeting Android 10.moljac commentedon Mar 31, 2020
@janusw Can you provide minimal repro sample please?
janusw commentedon Mar 31, 2020
I will try, but it might take a moment.
(Btw, I'm also on MacOS, in case it matters.)
moljac commentedon Mar 31, 2020
@janusw
MacOS oder Windows - is uns wurst. 🍺
motoko89 commentedon Apr 2, 2020
@moljac I don't want to use AndroidX, at all. The only reason I got this is because after upgrading Xamarin Essentials (XE) and Xamarin.Forms (XF) to the latest version, I suddenly have all these errors. I understand that after XF 4.5 it will start switching to AndroidX, but I have another app using XE and XF and it upgrades just fine. The other app doesn't ask for direct ref
I think as soon as XF starts asking to add reference to AndroidX pkg directly, things go south
I also tried to downgrade to 4.4 and then use the Right click > Migrate to AndroidX option to see what happens. No luck.
I thought maybe I should try different AndroidX pkg version combinations. That's why you saw different versions in my copy.
I also tried the VS Preview update channel. Also no luck
One thing I notice is that the pkg references created by Right click > Migrate to AndroidX option are not the same as XF 4.5's AndroidX direct reference requirement.
Another observation is that I tried to remove the direct references to retry, and XF give me a different reference requirement each time
moljac commentedon Apr 2, 2020
@motoko89
AndroidX itself cannot force you to use it. Xamarin.Forms 4.5+ and Xamarin.Essentials (not sure which version) could force you to use AndroidX, but this is not AndroidX issue.
You see - this is app specific, because upgrade depends on dependencies used (nuget packages) and it can cause issues for SOME apps. Without details we cannot help.
But not for all apps. Right? (from your statement)
No. This will most likely fail.
OK. I couldn't understand why suddenly different versions.
Channels change not only VS version, but Xamarin.Android and build tools, but I'm not sure what the problem might be.
Could be, because some other dependency might need other dependency version, so nuget attempts to find compromise (the best solution/match).
Again, it depends on your dependency tree/chain.
moljac commentedon Apr 2, 2020
@janusw @motoko89
Just of top of my head (trying to pinpoint the issue): Do you have
Xamarin.AndroidX.AppCompat.Resourcesdependecy (somewhere in the tree)?Even as transitive dependency.
janusw commentedon Apr 3, 2020
I don't (not as a direct dependency at least; not sure how to easily determine all transitive dependencies).
I'm still in the process of reducing to a minimal reproducer that I can publish. What I currently have is a solution with two projects:
Xamarin.Essentialswas also among these originally, but was removed in the reduction process. I will try to get rid of further references, and will publish the reproducer here as soon as it is reasonably small.janusw commentedon Apr 3, 2020
So, I managed to get rid of most of them (while maintaining the error), except for these two:
Once I remove
Xamarin.Android.Support.v7.AppCompatas well, the error disappears, so I'd conclude that this package is somehow the culprit here.@moljac Do you still need a reproducer project, or is this information sufficient?
sereoja commentedon Apr 3, 2020
I have similar error when building in App Center, what is odd I can build release version in Visual Studio without problems. Let me know if you got any solution.
12 remaining items
Allow migration to continue when symbols are bad (#98)
motoko89 commentedon Jun 6, 2020
@mattleibow @moljac how do I get this e32d28e? I still see the error
motoko89 commentedon Jul 23, 2020
@mattleibow @moljac has the fix been released? I still see the error
motoko89 commentedon Jul 30, 2020
To answer my own question, looks like adding Nuget pkg Xamarin.AndroidX.Migration and then other pkgs requested by the build process work now
mark74 commentedon Sep 5, 2020
If I upgrade Xamarin.AndroidX.Legacy.Support.V4 from 1.0.0.1 to 1.0.0.3 then I have an error while compiling because Mono.Cecil or some dependency is missing.
Even updating Xamarin.AndroidX.Migration before other packages the error remains
GrupoGM commentedon Sep 5, 2020
I have the same issue
WILSILPIN commentedon Sep 8, 2020
i have this problem in my Xamarin app.
Severity Code Description Project File Line Suppression State
Error The "CecilfyFiles" task could not be initialized with its input parameters.
How does one correct this?
GrupoGM commentedon Sep 8, 2020
Not yet
alvynfash commentedon Sep 10, 2020
Had the same issue and switching channels to preview fixed it. sucks but builds now on vsmac
RodSanford commentedon Sep 14, 2020
Had the same issue this morning...on an older solution. I had a more recent project I was working on, that did not have the issue, so I decided to compare Android project files to see if I could see any differences. Seems my old solution had a LOT of extra Android packages that the new solution did not include, so I backed up the old Android project file and removed the extra Xamarin.Android files, and it worked!
Old Android project file had these lines:
<PackageReference Include="Xamarin.AndroidX.MediaRouter"> <Version>1.1.0.2</Version> </PackageReference> <PackageReference Include="Xamarin.Android.Support.ViewPager" Version="28.0.0.3" /> <PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.3" /> <PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.3" /> <PackageReference Include="Xamarin.Android.Support.v4" Version="28.0.0.3" /> <PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="28.0.0.3" /> <PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="28.0.0.3" /> <PackageReference Include="Newtonsoft.Json" Version="12.0.3" /> <PackageReference Include="Xamarin.Android.Support.Core.Utils" Version="28.0.0.3" /> <PackageReference Include="Xamarin.Android.Support.CustomTabs" Version="28.0.0.3" /> <PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" /> <PackageReference Include="Xamarin.Forms"> <Version>4.8.0.1269</Version> </PackageReference> <PackageReference Include="Xamarin.Forms.Visual.Material"> <Version>4.8.0.1269</Version> </PackageReference>Which I reduced to
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" /> <PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" /> <PackageReference Include="Xamarin.Forms"> <Version>4.8.0.1269</Version> </PackageReference> <PackageReference Include="Xamarin.Forms.Visual.Material"> <Version>4.8.0.1269</Version> </PackageReference>pellet commentedon Oct 7, 2020
Removing an unnecessary dependency to Xamarin.AndroidX.Core and upgrading Xamarin.AndroidX.Migration from preview to 1.0.7.1 fixed it for me! maybe it was an issue with cecil?
moljac commentedon Oct 7, 2020
@pellet
Yes it was issue with Cecil. Some projects referenced version 0.11.1 while other referenced 0.11.2 (I think, if I recall corectly).
Updating/cosolidating versions in bindings seems to fix the issue.
mark74 commentedon Oct 8, 2020
Last packages update solved the problem!
moljac commentedon Oct 8, 2020
Thanks @mark74 for feedback