Skip to content

[Xamarin.Android.Build.Tasks] Crash - NetStandard library - could not load assembly during startup registration. #706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 4, 2017

Conversation

dellis1972
Copy link
Contributor

@dellis1972 dellis1972 commented Jul 27, 2017

Context https://bugzilla.xamarin.com/show_bug.cgi?id=57342

The investigation in the bug suggests that we are pickin up a
reference assembly rather than a the actual implementation.
This is to do with the way netstandard nuget packages work, they
include both 'ref' and 'lib' folders.

In this case 'ref' was being included in the package rather than
'lib'. This commit alters the _ResolveAssemblies to use

`@(ReferenceCopyLocalPaths)`

This ItemGroup is populated with the correct items.

We also add a new Warning to detect if we attempt to package a reference assembly.

@dellis1972
Copy link
Contributor Author

build

@dellis1972 dellis1972 force-pushed the Bug57342 branch 3 times, most recently from 7c93527 to 8bf82bd Compare August 1, 2017 11:15
@dellis1972
Copy link
Contributor Author

build

1 similar comment
@dellis1972
Copy link
Contributor Author

build

@dellis1972
Copy link
Contributor Author

@jonpryor looks like the new @(ReferenceCopyLocalPaths) included Satallite Assemblies which we did not expect. So had to filter those out as well.

@jonpryor
Copy link
Member

jonpryor commented Aug 1, 2017

@dellis1972: I'm still not sure how that explains the assemblies/assets/LibraryResources.resources.dll entry your .apk had...but it kinda makes sense?

@jonpryor
Copy link
Member

jonpryor commented Aug 1, 2017

There's a failure in AndroidUpdateResourcesTest.DesignTimeBuild(True):

Zip should have been downloaded to /Users/builder/.local/share/Xamarin/zips/5861EDAEF0DBBD53741DEC5BAF1CE67E.zip

@dellis1972
Copy link
Contributor Author

@jonpryor That unit test has a problem.. I'm gonna fix it in a new PR

@dellis1972
Copy link
Contributor Author

#711

… load assembly during startup registration.

Context https://bugzilla.xamarin.com/show_bug.cgi?id=57342

The investigation in the bug suggests that we are pickin up a
reference assembly rather than a the actual implementation.
This is to do with the way netstandard nuget packages work, they
include both 'ref' and 'lib' folders.

In this case 'ref' was being included in the package rather than
'lib'. This commit alters the `_ResolveAssemblies` to use

	`@(ReferenceCopyLocalPaths)`

This ItemGroup is populated with the correct items.
@jonpryor jonpryor merged commit 8f2ae24 into dotnet:master Aug 4, 2017
jonpryor pushed a commit that referenced this pull request Aug 4, 2017
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=57342

The investigation in the bug suggests that we are picking up a
reference assembly rather than a the actual implementation.
This is to do with the way netstandard nuget packages work, they
include both `ref` and `lib` folders.

In this case `ref` was being included in the package rather than
`lib`. This commit alters the `_ResolveAssemblies` to use

	@(ReferenceCopyLocalPaths)

This ItemGroup is populated with the correct items.
jonpryor added a commit that referenced this pull request Aug 9, 2017
…ies (#706)"

This reverts commit d15-4/0bd26fd3c19fb973316172c10aa2c9e9ae43c1e3.

Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=58679

Turns Out™ that `@(ReferenceCopyLocalPaths)` isn't a "drop-in"
replacement for `@(ReferencePaths)`: `@(ReferenceCopyLocalPaths)`
doesn't contain `Mono.Android.Export.dll`, which means that every app
which uses `Mono.Android.Export.dll` and properly contains a
`<Reference Include="Mono.Android.Export" />` now elicits the
packaging error:

	error XA4210: You need to add a reference to Mono.Android.Export.dll when you use ExportAttribute or ExportFieldAttribute.

Revert the fix for now until we can create a better fix.
radekdoulik added a commit to radekdoulik/xamarin-android that referenced this pull request Sep 9, 2020
To get "[jnimarshalmethod-gen] Fix type resolution crash (dotnet#706)" fix.
radekdoulik added a commit to radekdoulik/xamarin-android that referenced this pull request Sep 10, 2020
To get "[jnimarshalmethod-gen] Fix type resolution crash (dotnet#706)" fix.
jonpryor pushed a commit that referenced this pull request Oct 20, 2020
Fixes: dotnet/java-interop#461
Fixes: dotnet/java-interop#682
Fixes: dotnet/java-interop#717
Fixes: dotnet/java-interop#719
Fixes: dotnet/java-interop#728

Changes: dotnet/java-interop@ac914ce...b991bb8

  * dotnet/java-interop@b991bb86: [generator] Revert change to use auto-properties in EventArgs classes (#736)
  * dotnet/java-interop@ee50d89b: Bump to xamarin/xamarin-android-tools/master@f2af06f2 (#733)
  * dotnet/java-interop@a0b895c1: [build] Suppress NuGet warnings (#730)
  * dotnet/java-interop@8b1b0507: [generator] Fix parsing of complex generic types (#729)
  * dotnet/java-interop@ee7afeed: [generator] Prevent generating duplicate EventArgs classes (#726)
  * dotnet/java-interop@1f21f38c: [generator] Use GC.KeepAlive for reference type method parameters. (#725)
  * dotnet/java-interop@5136ef98: [Xamarin.Android.Tools.Bytecode] Hide Kotlin nested types inside (#723)
  * dotnet/java-interop@53d60513: [jnimarshalmethod-gen] Fix registration on Windows (#721)
  * dotnet/java-interop@5a834d42: [jnimarshalmethod-gen] Avoid creating AppDomains (#720)
  * dotnet/java-interop@a76edb8c: [Xamarin.Android.Tools.ApiXmlAdjuster] Find app.android.IntentService (#718)
  * dotnet/java-interop@6cde0877: [Java.Interop] Emit a reference assembly for Java.Interop.dll (#716)
  * dotnet/java-interop@b858dc59: [generator] Provide line/col numbers for api.xml warnings (#715)
  * dotnet/java-interop@9be92a04: [ci] Don't kick off CI for documentation only changes. (#712)
  * dotnet/java-interop@03c22722: [jnimarshalmethod-gen] Fix type resolution crash (#706)
@github-actions github-actions bot locked and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants