Skip to content

Can't build in Release: Xamarin.AndroidX.Migration.targets(227,9): error : Symbols were found but are not matching the assembly #79

Closed

Description

@motoko89

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

  1. motoko89 commented on Mar 22, 2020

    @motoko89
    Author

    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:

    /Users/admin/.nuget/packages/xamarin.androidx.migration/1.0.0-preview03/build/Xamarin.AndroidX.Migration.targets(182,9): error : Source assembly does not exist: 'MyPackage.Android.dll'.
        /Users/admin/.nuget/packages/xamarin.androidx.migration/1.0.0-preview03/build/Xamarin.AndroidX.Migration.targets(182,9): error :   at Xamarin.AndroidX.Migration.CecilMigrator.Migrate (System.String source, System.String destination) [0x00283] in D:\a\1\s\source\Xamarin.AndroidX.Migration\Migration\CecilMigrator.cs:161 
        /Users/admin/.nuget/packages/xamarin.androidx.migration/1.0.0-preview03/build/Xamarin.AndroidX.Migration.targets(182,9): error :   at Xamarin.AndroidX.Migration.CecilMigrator.Migrate (System.Collections.Generic.IEnumerable`1[T] assemblies) [0x00012] in D:\a\1\s\source\Xamarin.AndroidX.Migration\Migration\CecilMigrator.cs:50 
        /Users/admin/.nuget/packages/xamarin.androidx.migration/1.0.0-preview03/build/Xamarin.AndroidX.Migration.targets(182,9): error :   at Xamarin.AndroidX.Migration.BuildTasks.CecilfyFiles.Execute () [0x00071] in D:\a\1\s\source\Xamarin.AndroidX.Migration\BuildTasks\CecilfyFiles.cs:35 
    
  2. moljac commented on Mar 23, 2020

    @moljac
    Contributor

    @motoko89
    Thanks for the report, but I have few questions:

    1. Why do you use AndroidX.Migration package v.1.0.1 in the first report and 1.0.0-preview03 in the second?
    2. Why downgarding Xamarin.Forms to <4.5? Namely 4.5 is the 1st AndroidX supported version, so below that - it simply will not work.
    3. So you tried version 4.5, then downgraded to < 4.5 and upgraded again to 4.5? I need to reproduce this.
    4. Can you provide sample solution/project, please?

    Thanks
    Kind regards
    Mel

  3. self-assigned this
    on Mar 23, 2020
  4. janusw commented on Mar 31, 2020

    @janusw

    I see exactly the same error here. I can build my project well in Debug mode, but in Release I get:

    Target _AndroidXCecilfy:
        Migrated assembly to 'obj/Release/androidx/cecil/WhatsThisDrone.Android.dll'.
        /Users/janus/.nuget/packages/xamarin.androidx.migration/1.0.0/buildTransitive/monoandroid90/Xamarin.AndroidX.Migration.targets(227,9): error : Symbols were found but are not matching the assembly
        /Users/janus/.nuget/packages/xamarin.androidx.migration/1.0.0/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/janus/.nuget/packages/xamarin.androidx.migration/1.0.0/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/janus/.nuget/packages/xamarin.androidx.migration/1.0.0/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/janus/.nuget/packages/xamarin.androidx.migration/1.0.0/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/janus/.nuget/packages/xamarin.androidx.migration/1.0.0/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/janus/.nuget/packages/xamarin.androidx.migration/1.0.0/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/janus/.nuget/packages/xamarin.androidx.migration/1.0.0/buildTransitive/monoandroid90/Xamarin.AndroidX.Migration.targets(227,9): error :   at Xamarin.AndroidX.Migration.CecilMigrator.Migrate (System.String source, System.String destination) [0x001c2] in <d7fed48e09644e5387b3c96b5e241b74>:0 
        /Users/janus/.nuget/packages/xamarin.androidx.migration/1.0.0/buildTransitive/monoandroid90/Xamarin.AndroidX.Migration.targets(227,9): error :   at Xamarin.AndroidX.Migration.CecilMigrator.Migrate (System.Collections.Generic.IEnumerable`1[T] assemblies) [0x00012] in <d7fed48e09644e5387b3c96b5e241b74>:0 
        /Users/janus/.nuget/packages/xamarin.androidx.migration/1.0.0/buildTransitive/monoandroid90/Xamarin.AndroidX.Migration.targets(227,9): error :   at Xamarin.AndroidX.Migration.BuildTasks.CecilfyFiles.Execute () [0x000e3] in <6e09a813e9e049ef988e9067c8e74b4c>:0 
    

    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.

  5. moljac commented on Mar 31, 2020

    @moljac
    Contributor

    @janusw Can you provide minimal repro sample please?

  6. janusw commented on Mar 31, 2020

    @janusw

    @janusw Can you provide minimal repro sample please?

    I will try, but it might take a moment.

    (Btw, I'm also on MacOS, in case it matters.)

  7. moljac commented on Mar 31, 2020

    @moljac
    Contributor

    @janusw
    MacOS oder Windows - is uns wurst. 🍺

  8. motoko89 commented on Apr 2, 2020

    @motoko89
    Author

    @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

  9. moljac commented on Apr 2, 2020

    @moljac
    Contributor

    @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.

    but I have another app using XE and XF and it upgrades just fine.

    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.

    think as soon as XF starts asking to add reference to AndroidX pkg directly, things go south

    But not for all apps. Right? (from your statement)

    I also tried to downgrade to 4.4 and then use the Right click > Migrate to AndroidX option to see what happens. No luck.

    No. This will most likely fail.

    I thought maybe I should try different AndroidX pkg version combinations. That's why you saw different versions in my copy.

    OK. I couldn't understand why suddenly different versions.

    I also tried the VS Preview update channel. Also no luck

    Channels change not only VS version, but Xamarin.Android and build tools, but I'm not sure what the problem might be.

    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.

    Could be, because some other dependency might need other dependency version, so nuget attempts to find compromise (the best solution/match).

    Another observation is that I tried to remove the direct references to retry, and XF give me a different reference requirement each time

    Again, it depends on your dependency tree/chain.

  10. moljac commented on Apr 2, 2020

    @moljac
    Contributor

    @janusw @motoko89

    Just of top of my head (trying to pinpoint the issue): Do you have Xamarin.AndroidX.AppCompat.Resources dependecy (somewhere in the tree)?
    Even as transitive dependency.

  11. janusw commented on Apr 3, 2020

    @janusw

    Just of top of my head (trying to pinpoint the issue): Do you have Xamarin.AndroidX.AppCompat.Resources dependecy (somewhere in the tree)?
    Even as transitive dependency.

    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:

    • A PCL based on .NET Standard 2.1 with a single package reference to Xamarin.Forms 4.5 (and very little actual code now).
    • An Android project targeting Android 10 that depends on the PCL and with package references to:
        <PackageReference Include="Xamarin.Forms" Version="4.5.0.495" />
        <PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData">
          <Version>2.2.0</Version>
        </PackageReference>
        <PackageReference Include="Xamarin.Google.Android.Material">
          <Version>1.1.0-rc3</Version>
        </PackageReference>
        <PackageReference Include="Xamarin.AndroidX.Legacy.Support.V4">
          <Version>1.0.0</Version>
        </PackageReference>
        <PackageReference Include="Xamarin.AndroidX.MediaRouter">
          <Version>1.1.0</Version>
        </PackageReference>
        <PackageReference Include="Xamarin.Android.Support.v7.AppCompat">
          <Version>28.0.0.3</Version>
        </PackageReference>
        <PackageReference Include="Xamarin.Android.Support.Media.Compat">
          <Version>28.0.0.3</Version>
        </PackageReference>
    

    Xamarin.Essentials was 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.

  12. janusw commented on Apr 3, 2020

    @janusw
    • An Android project targeting Android 10 that depends on the PCL and with package references to:
        <PackageReference Include="Xamarin.Forms" Version="4.5.0.495" />
        <PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData">
          <Version>2.2.0</Version>
        </PackageReference>
        <PackageReference Include="Xamarin.Google.Android.Material">
          <Version>1.1.0-rc3</Version>
        </PackageReference>
        <PackageReference Include="Xamarin.AndroidX.Legacy.Support.V4">
          <Version>1.0.0</Version>
        </PackageReference>
        <PackageReference Include="Xamarin.AndroidX.MediaRouter">
          <Version>1.1.0</Version>
        </PackageReference>
        <PackageReference Include="Xamarin.Android.Support.v7.AppCompat">
          <Version>28.0.0.3</Version>
        </PackageReference>
        <PackageReference Include="Xamarin.Android.Support.Media.Compat">
          <Version>28.0.0.3</Version>
        </PackageReference>
    

    So, I managed to get rid of most of them (while maintaining the error), except for these two:

        <PackageReference Include="Xamarin.Forms" Version="4.5.0.495" />
        <PackageReference Include="Xamarin.Android.Support.v7.AppCompat">
          <Version>28.0.0.3</Version>
        </PackageReference>
    

    Once I remove Xamarin.Android.Support.v7.AppCompat as 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?

  13. sereoja commented on Apr 3, 2020

    @sereoja

    I see exactly the same error here. I can build my project well in Debug mode, but in Release I get:

    Target _AndroidXCecilfy:
        Migrated assembly to 'obj/Release/androidx/cecil/WhatsThisDrone.Android.dll'.
        /Users/janus/.nuget/packages/xamarin.androidx.migration/1.0.0/buildTransitive/monoandroid90/Xamarin.AndroidX.Migration.targets(227,9): error : Symbols were found but are not matching the assembly
        /Users/janus/.nuget/packages/xamarin.androidx.migration/1.0.0/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/janus/.nuget/packages/xamarin.androidx.migration/1.0.0/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/janus/.nuget/packages/xamarin.androidx.migration/1.0.0/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/janus/.nuget/packages/xamarin.androidx.migration/1.0.0/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/janus/.nuget/packages/xamarin.androidx.migration/1.0.0/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/janus/.nuget/packages/xamarin.androidx.migration/1.0.0/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/janus/.nuget/packages/xamarin.androidx.migration/1.0.0/buildTransitive/monoandroid90/Xamarin.AndroidX.Migration.targets(227,9): error :   at Xamarin.AndroidX.Migration.CecilMigrator.Migrate (System.String source, System.String destination) [0x001c2] in <d7fed48e09644e5387b3c96b5e241b74>:0 
        /Users/janus/.nuget/packages/xamarin.androidx.migration/1.0.0/buildTransitive/monoandroid90/Xamarin.AndroidX.Migration.targets(227,9): error :   at Xamarin.AndroidX.Migration.CecilMigrator.Migrate (System.Collections.Generic.IEnumerable`1[T] assemblies) [0x00012] in <d7fed48e09644e5387b3c96b5e241b74>:0 
        /Users/janus/.nuget/packages/xamarin.androidx.migration/1.0.0/buildTransitive/monoandroid90/Xamarin.AndroidX.Migration.targets(227,9): error :   at Xamarin.AndroidX.Migration.BuildTasks.CecilfyFiles.Execute () [0x000e3] in <6e09a813e9e049ef988e9067c8e74b4c>:0 
    

    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.

    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.

  14. 12 remaining items

  15. added a commit that references this issue on May 4, 2020
    e32d28e
  16. motoko89 commented on Jun 6, 2020

    @motoko89
    Author

    @mattleibow @moljac how do I get this e32d28e? I still see the error

  17. motoko89 commented on Jul 23, 2020

    @motoko89
    Author

    @mattleibow @moljac has the fix been released? I still see the error

  18. motoko89 commented on Jul 30, 2020

    @motoko89
    Author

    To answer my own question, looks like adding Nuget pkg Xamarin.AndroidX.Migration and then other pkgs requested by the build process work now

  19. mark74 commented on Sep 5, 2020

    @mark74

    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

  20. GrupoGM commented on Sep 5, 2020

    @GrupoGM

    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

    I have the same issue

  21. WILSILPIN commented on Sep 8, 2020

    @WILSILPIN

    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?

  22. GrupoGM commented on Sep 8, 2020

    @GrupoGM

    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?

    Not yet

  23. alvynfash commented on Sep 10, 2020

    @alvynfash

    Had the same issue and switching channels to preview fixed it. sucks but builds now on vsmac

  24. RodSanford commented on Sep 14, 2020

    @RodSanford

    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>

  25. pellet commented on Oct 7, 2020

    @pellet

    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?

  26. moljac commented on Oct 7, 2020

    @moljac
    Contributor

    @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.

  27. mark74 commented on Oct 8, 2020

    @mark74

    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

    Last packages update solved the problem!

  28. moljac commented on Oct 8, 2020

    @moljac
    Contributor

    Thanks @mark74 for feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions