-
Notifications
You must be signed in to change notification settings - Fork 532
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] reorder two targets to fix AndroidX.Migration #4151
Merged
dellis1972
merged 1 commit into
dotnet:master
from
jonathanpeppers:androidxmigrationbug
Jan 22, 2020
Merged
[Xamarin.Android.Build.Tasks] reorder two targets to fix AndroidX.Migration #4151
dellis1972
merged 1 commit into
dotnet:master
from
jonathanpeppers:androidxmigrationbug
Jan 22, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dellis1972
reviewed
Jan 21, 2020
jonathanpeppers
force-pushed
the
androidxmigrationbug
branch
from
January 21, 2020 14:34
0ee3982
to
9fe854e
Compare
mattleibow
reviewed
Jan 21, 2020
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/KnownPackages.cs
Outdated
Show resolved
Hide resolved
…tion Context: https://github.com/xamarin/XamarinAndroidXMigration Fixes: dotnet#4068 Developers have been reporting an error when using AndroidX.Migration: The "CopyGeneratedJavaResourceClasses" task was not given a value for the required parameter "SourceTopDirectory". It is reported another build fixes the issue, and it "randomly" happens on incremental builds. The error seems to indicate either `$(AaptTemporaryDirectory)` or `$(ResgenTemporaryDirectory)` are blank? But it only happens when using the AndroidX.Migration NuGet package. From a user's build log: Skipping target "_PrepareCreateBaseApk" because all output files are up-to-date with respect to the input files. Which would indicate in the case of AndroidX.Migration: * `_PrepareCreateBaseApk` was skipped. * `_AndroidXJetifyManifest` was injected, it came along and modified `$(IntermediateOutputPath)android\AndroidManifest.xml`. * `_CreateBaseApk` ran (with updated inputs), and `$(AaptTemporaryDirectory)` is blank! I could reproduce the problem in a test: * Build a project with AndroidX.Migration * Change C# code (a non-Java.Lang.Object class) * Build the project again Reviewing the MSBuild targets: `_PrepareCreateBaseApk` and `_CreateBaseApk`. They define a property that is passed between two targets. The following sets of targets have nearly identical `Input`/`Output`: * `_PrepareCreateBaseApk` and `_CreateBaseApk` * `_PrepareUpdateAndroidResgen` and `_UpdateAndroidResgen` This was done to workaround a long-lived bug in MSBuild: dotnet/msbuild#1006 A fix that doesn't seem break anything is to just run `_PrepareCreateBaseApk` *after* `$(AfterGenerateAndroidManifest)`. So if something triggers `_CreateBaseApk`, `_PrepareCreateBaseApk` will always run as well. I wrote a test for this scenario, and updated the AndroidX NuGets in our tests to use the RC now.
jonathanpeppers
force-pushed
the
androidxmigrationbug
branch
from
January 21, 2020 17:37
9fe854e
to
bb0a349
Compare
jonathanpeppers
changed the title
[Xamarin.Android.Build.Tasks] merge two targets to fix AndroidX.Migration
[Xamarin.Android.Build.Tasks] reorder two targets to fix AndroidX.Migration
Jan 21, 2020
dellis1972
approved these changes
Jan 22, 2020
Sorry about not reviewing. I though I hit the submit button. Looked good to me. |
jonpryor
pushed a commit
that referenced
this pull request
Jan 27, 2020
…tion (#4151) Context: https://github.com/xamarin/XamarinAndroidXMigration Fixes: #4068 Developers have been reporting an error when using AndroidX.Migration: The "CopyGeneratedJavaResourceClasses" task was not given a value for the required parameter "SourceTopDirectory". It is reported another build fixes the issue, and it "randomly" happens on incremental builds. The error seems to indicate either `$(AaptTemporaryDirectory)` or `$(ResgenTemporaryDirectory)` are blank? But it only happens when using the AndroidX.Migration NuGet package. From a user's build log: Skipping target "_PrepareCreateBaseApk" because all output files are up-to-date with respect to the input files. Which would indicate in the case of AndroidX.Migration: * `_PrepareCreateBaseApk` was skipped. * `_AndroidXJetifyManifest` was injected, it came along and modified `$(IntermediateOutputPath)android\AndroidManifest.xml`. * `_CreateBaseApk` ran (with updated inputs), and `$(AaptTemporaryDirectory)` is blank! I could reproduce the problem in a test: * Build a project with AndroidX.Migration * Change C# code (a non-Java.Lang.Object class) * Build the project again Reviewing the MSBuild targets: `_PrepareCreateBaseApk` and `_CreateBaseApk`. They define a property that is passed between two targets. The following sets of targets have nearly identical `Input`/`Output`: * `_PrepareCreateBaseApk` and `_CreateBaseApk` * `_PrepareUpdateAndroidResgen` and `_UpdateAndroidResgen` This was done to workaround a long-lived bug in MSBuild: dotnet/msbuild#1006 A fix that doesn't seem break anything is to just run `_PrepareCreateBaseApk` *after* `$(AfterGenerateAndroidManifest)`. So if something triggers `_CreateBaseApk`, `_PrepareCreateBaseApk` will always run as well. I wrote a test for this scenario, and updated the AndroidX NuGets in our tests to use the RC now.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context: https://github.com/xamarin/XamarinAndroidXMigration
Fixes: #4068
Developers have been reporting an error when using AndroidX.Migration:
It is reported another build fixes the issue, and it "randomly"
happens on incremental builds.
The error seems to indicate either
$(AaptTemporaryDirectory)
or$(ResgenTemporaryDirectory)
are blank? But it only happens whenusing the AndroidX.Migration NuGet package.
From a user's build log:
Which would indicate in the case of AndroidX.Migration:
_PrepareCreateBaseApk
was skipped._AndroidXJetifyManifest
was injected, it came along and modified$(IntermediateOutputPath)android\AndroidManifest.xml
._CreateBaseApk
ran (with updated inputs), and$(AaptTemporaryDirectory)
is blank!I could reproduce the problem in a test:
Reviewing the MSBuild targets:
_PrepareCreateBaseApk
and_CreateBaseApk
. They define a property that is passed between twotargets. The following sets of targets have nearly identical
Input
/Output
:_PrepareCreateBaseApk
and_CreateBaseApk
_PrepareUpdateAndroidResgen
and_UpdateAndroidResgen
This was done to workaround a long-lived bug in MSBuild:
dotnet/msbuild#1006
A fix that doesn't seem break anything is to just run
_PrepareCreateBaseApk
after$(AfterGenerateAndroidManifest)
. Soif something triggers
_CreateBaseApk
,_PrepareCreateBaseApk
willalways run as well.
I wrote a test for this scenario, and updated the AndroidX NuGets in
our tests to use the RC now.