Skip to content
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

[Xamarin.Android.Build.Tasks] !Embed Assemblies == Debug Runtime #654

Conversation

jonpryor
Copy link
Member

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

Scenario: Create an app, then change $(Optimize) in the Debug
configuration to be True, with $(EmbedAssembliesIntoApk)=False
(default for Debug configuration).

Build, deploy, run the app.

Expected results: it works!

Actual results: Not so much:

F/monodroid: No assemblies found in '(null)' or '<unavailable>'.  Assuming this is part of Fast Deployment. Exiting..

What went wrong is Commit 1e0e083: making $(Optimize) the
switch to control whether the Debug or Release runtime is used means
that a "Debug" configuration with $(Optimize)=True is treated as
requiring a Release runtime, which means the external assembly
directory isn't used and doesn't exist.

Attempt to address this by bringing $(EmbedAssembliesIntoApk) into
the picture: if it's False -- i.e. fast deployment -- then it
"overrides" the $(Optimize) value when it comes to the
$(AndroidIncludeDebugSymbols) property.

(The $(AndroidIncludeDebugSymbols) property controls whether the
Debug or Release runtime is used. Yes, this name doesn't make sense.)

This means for greater sanity we now need a truth table:

Input Property:                                                      || Output Property
DebugSymbols    | DebugType  | EmbedAssembliesIntoApk   | Optimize   || AndroidIncludeDebugSymbols
================+============+==========================+============++===========================
True              *any*        True                       True          False      (Release runtime)
True              *any*        True                       False         True       (Debug runtime)
True              *any*        False                      True          True       (Debug runtime)
True              *any*        False                      False         True       (Debug runtime)
True              *empty*      True                       True          True       (Debug runtime)
True              *empty*      True                       False         True       (Debug runtime)
True              *empty*      False                      True          True       (Debug runtime)
True              *empty*      False                      False         True       (Debug runtime)
False             -            -                          -             False      (Release runtime)

Question: Should $(DebugSymbols) truly be the controlling factor,
i.e. when $(DebugSymbols)=False the Release runtime is always used.

Additionally, update $(AndroidUseDebugRuntime) so that it also
takaes $(EmbedAssembliesIntoApk) into consideration.

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

Scenario: Create an app, then change `$(Optimize)` in the Debug
configuration to be True, with `$(EmbedAssembliesIntoApk)`=False
(default for Debug configuration).

Build, deploy, run the app.

Expected results: it works!

Actual results: Not so much:

	F/monodroid: No assemblies found in '(null)' or '<unavailable>'.  Assuming this is part of Fast Deployment. Exiting..

What went wrong is Commit 1e0e083: making `$(Optimize)` *the*
switch to control whether the Debug or Release runtime is used means
that a "Debug" configuration with `$(Optimize)`=True is treated as
requiring a *Release runtime*, which means the external assembly
directory isn't used and doesn't exist.

Attempt to address this by bringing `$(EmbedAssembliesIntoApk)` into
the picture: if it's False -- i.e. fast deployment -- then it
"overrides" the `$(Optimize)` value when it comes to the
`$(AndroidIncludeDebugSymbols)` property.

(The `$(AndroidIncludeDebugSymbols)` property controls whether the
Debug or Release runtime is used. Yes, this name doesn't make sense.)

This means for greater sanity we now need a truth table:

	Input Property:                                                      || Output Property
	DebugSymbols    | DebugType  | EmbedAssembliesIntoApk   | Optimize   || AndroidIncludeDebugSymbols
	================+============+==========================+============++===========================
	True              *any*        True                       True          False      (Release runtime)
	True              *any*        True                       False         True       (Debug runtime)
	True              *any*        False                      True          True       (Debug runtime)
	True              *any*        False                      False         True       (Debug runtime)
	True              *empty*      True                       True          True       (Debug runtime)
	True              *empty*      True                       False         True       (Debug runtime)
	True              *empty*      False                      True          True       (Debug runtime)
	True              *empty*      False                      False         True       (Debug runtime)
	False             -            -                          -             False      (Release runtime)

Question: Should `$(DebugSymbols)` *truly* be the controlling factor,
i.e. when `$(DebugSymbols)`=False the Release runtime is always used.

Additionally, update `$(AndroidUseDebugRuntime)` so that it also
takaes `$(EmbedAssembliesIntoApk)` into consideration.
@dellis1972 dellis1972 merged commit edabe8a into dotnet:master Jun 20, 2017
jonpryor added a commit that referenced this pull request Jun 20, 2017
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=56485

Scenario: Create an app, then change `$(Optimize)` in the Debug
configuration to be True, with `$(EmbedAssembliesIntoApk)`=False
(default for Debug configuration).

Build, deploy, run the app.

Expected results: it works!

Actual results: Not so much:

	F/monodroid: No assemblies found in '(null)' or '<unavailable>'.  Assuming this is part of Fast Deployment. Exiting..

What went wrong is Commit 1e0e083: making `$(Optimize)` *the*
switch to control whether the Debug or Release runtime is used means
that a "Debug" configuration with `$(Optimize)`=True is treated as
requiring a *Release runtime*, which means the external assembly
directory isn't used and doesn't exist.

Attempt to address this by bringing `$(EmbedAssembliesIntoApk)` into
the picture: if it's False -- i.e. fast deployment -- then it
"overrides" the `$(Optimize)` value when it comes to the
`$(AndroidIncludeDebugSymbols)` property.

(The `$(AndroidIncludeDebugSymbols)` property controls whether the
Debug or Release runtime is used. Yes, this name doesn't make sense.)

This means for greater sanity we now need a truth table:

	Input Property:                                                      || Output Property
	DebugSymbols    | DebugType  | EmbedAssembliesIntoApk   | Optimize   || AndroidIncludeDebugSymbols
	================+============+==========================+============++===========================
	True              *any*        True                       True          False      (Release runtime)
	True              *any*        True                       False         True       (Debug runtime)
	True              *any*        False                      True          True       (Debug runtime)
	True              *any*        False                      False         True       (Debug runtime)
	True              *empty*      True                       True          True       (Debug runtime)
	True              *empty*      True                       False         True       (Debug runtime)
	True              *empty*      False                      True          True       (Debug runtime)
	True              *empty*      False                      False         True       (Debug runtime)
	False             -            -                          -             False      (Release runtime)

Question: Should `$(DebugSymbols)` *truly* be the controlling factor,
i.e. when `$(DebugSymbols)`=False the Release runtime is always used.

Additionally, update `$(AndroidUseDebugRuntime)` so that it also
takaes `$(EmbedAssembliesIntoApk)` into consideration.
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Jun 15, 2020
Changes: dotnet/java-interop@b00e644...1de5501

  * dotnet/java-interop@1de5501: [CI] Add an "macOS .NET Core" build (dotnet#655)
  * dotnet/java-interop@9a56465: [generator] Use proper syntax for nested classes for DIM invokers (dotnet#662)
  * dotnet/java-interop@267c3f3: [generator] Support XML defined enums with no JNI info (dotnet#659)
  * dotnet/java-interop@5dcf896: [generator] Don't invalidate interface if static method is invalidated (dotnet#660)
  * dotnet/java-interop@1b59dcc: [java-interop] Update to SDK style project (dotnet#657)
  * dotnet/java-interop@b136ac9: [param-name-importer] Bump to Microsoft.Xml.SgmlReader 1.8.16 (dotnet#656)
  * dotnet/java-interop@eb39a3a: Bump to xamarin/xamarin-android-tools/master@3974fc38 (dotnet#658)
  * dotnet/java-interop@a99b451: [logcat-parse] Update to Mono.Terminal 5.4.0 (dotnet#654)
  * dotnet/java-interop@425f79d: [Java.Interop] Fix C# warnings (dotnet#652)
  * dotnet/java-interop@2e0f55d: [Java.Interop.Tools.Generator] Specify $(OutputPath) (dotnet#650)
  * dotnet/java-interop@4b266fa: [Xamarin.Android.Tools.Bytecode] Support @jvmoverloads (dotnet#651)
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Jun 15, 2020
Changes: dotnet/java-interop@b00e644...1de5501

  * dotnet/java-interop@1de5501: [CI] Add an "macOS .NET Core" build (dotnet#655)
  * dotnet/java-interop@9a56465: [generator] Use proper syntax for nested classes for DIM invokers (dotnet#662)
  * dotnet/java-interop@267c3f3: [generator] Support XML defined enums with no JNI info (dotnet#659)
  * dotnet/java-interop@5dcf896: [generator] Don't invalidate interface if static method is invalidated (dotnet#660)
  * dotnet/java-interop@1b59dcc: [java-interop] Update to SDK style project (dotnet#657)
  * dotnet/java-interop@b136ac9: [param-name-importer] Bump to Microsoft.Xml.SgmlReader 1.8.16 (dotnet#656)
  * dotnet/java-interop@eb39a3a: Bump to xamarin/xamarin-android-tools/master@3974fc38 (dotnet#658)
  * dotnet/java-interop@a99b451: [logcat-parse] Update to Mono.Terminal 5.4.0 (dotnet#654)
  * dotnet/java-interop@425f79d: [Java.Interop] Fix C# warnings (dotnet#652)
  * dotnet/java-interop@2e0f55d: [Java.Interop.Tools.Generator] Specify $(OutputPath) (dotnet#650)
  * dotnet/java-interop@4b266fa: [Xamarin.Android.Tools.Bytecode] Support @jvmoverloads (dotnet#651)
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Jun 15, 2020
Changes: dotnet/java-interop@b00e644...1de5501

  * dotnet/java-interop@1de5501: [CI] Add an "macOS .NET Core" build (dotnet#655)
  * dotnet/java-interop@9a56465: [generator] Use proper syntax for nested classes for DIM invokers (dotnet#662)
  * dotnet/java-interop@267c3f3: [generator] Support XML defined enums with no JNI info (dotnet#659)
  * dotnet/java-interop@5dcf896: [generator] Don't invalidate interface if static method is invalidated (dotnet#660)
  * dotnet/java-interop@1b59dcc: [java-interop] Update to SDK style project (dotnet#657)
  * dotnet/java-interop@b136ac9: [param-name-importer] Bump to Microsoft.Xml.SgmlReader 1.8.16 (dotnet#656)
  * dotnet/java-interop@eb39a3a: Bump to xamarin/xamarin-android-tools/master@3974fc38 (dotnet#658)
  * dotnet/java-interop@a99b451: [logcat-parse] Update to Mono.Terminal 5.4.0 (dotnet#654)
  * dotnet/java-interop@425f79d: [Java.Interop] Fix C# warnings (dotnet#652)
  * dotnet/java-interop@2e0f55d: [Java.Interop.Tools.Generator] Specify $(OutputPath) (dotnet#650)
  * dotnet/java-interop@4b266fa: [Xamarin.Android.Tools.Bytecode] Support @jvmoverloads (dotnet#651)
jonpryor added a commit that referenced this pull request Jun 16, 2020
Changes: dotnet/java-interop@b00e644...1de5501

  * dotnet/java-interop@1de5501: [CI] Add an "macOS .NET Core" build (#655)
  * dotnet/java-interop@9a56465: [generator] Use proper syntax for nested classes for DIM invokers (#662)
  * dotnet/java-interop@267c3f3: [generator] Support XML defined enums with no JNI info (#659)
  * dotnet/java-interop@5dcf896: [generator] Don't invalidate interface if static method is invalidated (#660)
  * dotnet/java-interop@1b59dcc: [java-interop] Update to SDK style project (#657)
  * dotnet/java-interop@b136ac9: [param-name-importer] Bump to Microsoft.Xml.SgmlReader 1.8.16 (#656)
  * dotnet/java-interop@eb39a3a: Bump to xamarin/xamarin-android-tools/master@3974fc38 (#658)
  * dotnet/java-interop@a99b451: [logcat-parse] Update to Mono.Terminal 5.4.0 (#654)
  * dotnet/java-interop@425f79d: [Java.Interop] Fix C# warnings (#652)
  * dotnet/java-interop@2e0f55d: [Java.Interop.Tools.Generator] Specify $(OutputPath) (#650)
  * dotnet/java-interop@4b266fa: [Xamarin.Android.Tools.Bytecode] Support @jvmoverloads (#651)
@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