Skip to content

Conversation

@jonpryor
Copy link
Contributor

@jonpryor jonpryor commented Jun 7, 2022

Context: https://dl-ssl.google.com/android/repository/repository2-3.xml
Context: dotnet/android@e4b3adb

Update the preferred Android SDK component versions to the current latest
versions listed in the Android Repository file:

  • $(AndroidSdkBuildToolsVersion)/build-tools to 32.0.0
  • $(AndroidSdkPlatformToolsVersion)/platform-tools to 32.0.0
  • $(AndroidSdkPlatformVersion)/platform to android-32
  • $(AndroidCommandLineToolsVersion)/cmdline-tools to 7.0
  • $(AndroidNdkVersion)/NDK to 23.2.8568313

jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Jun 7, 2022
@jonpryor jonpryor marked this pull request as draft June 7, 2022 01:38
@jonpryor
Copy link
Contributor Author

jonpryor commented Jun 7, 2022

Do not merge until dotnet/android#7073 is green.

jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Jun 8, 2022
Context: dotnet/android-tools#169

Context: https://dl-ssl.google.com/android/repository/repository2-3.xml
Context: 22bc14b

Remove support for `dx` and ProGuard.

Commit xamarin/xamarin-android-tools@TODO_HASH bumps
`$(AndroidSdkBuildToolsVersion)` to 32.0.0, which was the latest non-
preview `build-tools` package version on 2022-06-06.  The "problem"
is that [build-tools 31.0.0 *removed* `dx`][0], and thus Classic
Xamarin.Android has stuck with build-tools 30.0.0 as the default
version for years.

Commit 22bc14b introduced warning XA1023 (an *error* in .NET 5+),
as we saw no reason to support `dx` in .NET 5 when it was already
deprecated.

Warning XA1023 has been emitted in Classic Xamarin.Android since
Visual Studio 16.9 (released 2021-Mar); we feel there has been ample
time to migrate away from `dx` and to the replacement of `d8`.

Turn XA1023 into an *error* for Classic Xamarin.Android builds,
ensuring things are consistent between Classic Xamarin.Android and
.NET 6+.

Remove all support for `dx`, as it cannot be used.

Remove all support for ProGuard, as it could only be used with `dx`;
trying to use `d8` with ProGuard results in an XA1011 error.

[0]: https://android-developers.googleblog.com/2020/02/the-path-to-dx-deprecation.html
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Jun 8, 2022
Context: dotnet/android-tools#169

Context: https://dl-ssl.google.com/android/repository/repository2-3.xml
Context: 22bc14b

Remove support for `dx` and ProGuard.

Commit xamarin/xamarin-android-tools@TODO_HASH bumps
`$(AndroidSdkBuildToolsVersion)` to 32.0.0, which was the latest non-
preview `build-tools` package version on 2022-06-06.  The "problem"
is that [build-tools 31.0.0 *removed* `dx`][0], and thus Classic
Xamarin.Android has stuck with build-tools 30.0.0 as the default
version for years.

Commit 22bc14b introduced warning XA1023 (an *error* in .NET 5+),
as we saw no reason to support `dx` in .NET 5 when it was already
deprecated.

Warning XA1023 has been emitted in Classic Xamarin.Android since
Visual Studio 16.9 (released 2021-Mar); we feel there has been ample
time to migrate away from `dx` and to the replacement of `d8`.

Turn XA1023 into an *error* for Classic Xamarin.Android builds,
ensuring things are consistent between Classic Xamarin.Android and
.NET 6+.

Remove all support for `dx`, as it cannot be used.

Remove all support for ProGuard, as it could only be used with `dx`;
trying to use `d8` with ProGuard results in an XA1011 error.

[0]: https://android-developers.googleblog.com/2020/02/the-path-to-dx-deprecation.html
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Jun 9, 2022
Context: dotnet/android-tools#169

Context: https://dl-ssl.google.com/android/repository/repository2-3.xml
Context: 22bc14b

Remove support for `dx` and ProGuard.

Commit xamarin/xamarin-android-tools@TODO_HASH bumps
`$(AndroidSdkBuildToolsVersion)` to 32.0.0, which was the latest non-
preview `build-tools` package version on 2022-06-06.  The "problem"
is that [build-tools 31.0.0 *removed* `dx`][0], and thus Classic
Xamarin.Android has stuck with build-tools 30.0.0 as the default
version for years.

Commit 22bc14b introduced warning XA1023 (an *error* in .NET 5+),
as we saw no reason to support `dx` in .NET 5 when it was already
deprecated.

Warning XA1023 has been emitted in Classic Xamarin.Android since
Visual Studio 16.9 (released 2021-Mar); we feel there has been ample
time to migrate away from `dx` and to the replacement of `d8`.

Turn XA1023 into an *error* for Classic Xamarin.Android builds,
ensuring things are consistent between Classic Xamarin.Android and
.NET 6+.

Remove all support for `dx`, as it cannot be used.

Remove all support for ProGuard, as it could only be used with `dx`;
trying to use `d8` with ProGuard results in an XA1011 error.

[0]: https://android-developers.googleblog.com/2020/02/the-path-to-dx-deprecation.html
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Jun 9, 2022
Context: dotnet/android-tools#169

Context: https://dl-ssl.google.com/android/repository/repository2-3.xml
Context: 22bc14b

Turn XA1023 into an error.

Commit xamarin/xamarin-android-tools@TODO_HASH bumps
`$(AndroidSdkBuildToolsVersion)` to 32.0.0, which was the latest non-
preview `build-tools` package version on 2022-06-06.  The "problem"
is that [build-tools 31.0.0 *removed* `dx`][0], and thus Classic
Xamarin.Android has stuck with build-tools 30.0.0 as the default
version for years.

Commit 22bc14b introduced warning XA1023 (an *error* in .NET 5+),
as we saw no reason to support `dx` in .NET 5 when it was already
deprecated.

Warning XA1023 has been emitted in Classic Xamarin.Android since
Visual Studio 16.9 (released 2021-Mar); we feel there has been ample
time to migrate away from `dx` and to the replacement of `d8`.

Turn XA1023 into an *error* for Classic Xamarin.Android builds,
ensuring things are consistent between Classic Xamarin.Android and
.NET 6+.

TODO:

Remove support for `dx` and ProGuard.

[0]: https://android-developers.googleblog.com/2020/02/the-path-to-dx-deprecation.html
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Jun 9, 2022
Context: dotnet/android-tools#169

Context: https://dl-ssl.google.com/android/repository/repository2-3.xml
Context: 22bc14b

Turn XA1023 into an error.

Commit xamarin/xamarin-android-tools@TODO_HASH bumps
`$(AndroidSdkBuildToolsVersion)` to 32.0.0, which was the latest non-
preview `build-tools` package version on 2022-06-06.  The "problem"
is that [build-tools 31.0.0 *removed* `dx`][0], and thus Classic
Xamarin.Android has stuck with build-tools 30.0.0 as the default
version for years.

Commit 22bc14b introduced warning XA1023 (an *error* in .NET 5+),
as we saw no reason to support `dx` in .NET 5 when it was already
deprecated.

Warning XA1023 has been emitted in Classic Xamarin.Android since
Visual Studio 16.9 (released 2021-Mar); we feel there has been ample
time to migrate away from `dx` and to the replacement of `d8`.

Turn XA1023 into an *error* for Classic Xamarin.Android builds,
ensuring things are consistent between Classic Xamarin.Android and
.NET 6+.

Commit xamarin/xamarin-android-tools@TODO_HASH *also* bumps
`$(AndroidCommandLineToolsVersion)` to 7.0.  Update
`$(CommandLineToolsVersion)` in `Configuration.props` accordingly.

The `cmdline-tools` package v7.0 contains contains [`lint` 7.2][1],
which introduces a new `lint` check called `RedundantLabel`:

> Redundant label on activity in manifest

meaning that the `//actviity/@android:label` value is identical to
the `//application/@android:label` value, and thus isn't needed.

This causes a warning from `BuildTest.CheckLintErrorsAndWarnings()`:

	obj/Debug/android/AndroidManifest.xml(12,44): warning XA0102:
	Redundant label can be removed [RedundantLabel]

For now, update `BuildTest.CheckLintErrorsAndWarnings()` to ignore
`RedundantLabel` warnings.

TODO:

Remove support for `dx` and ProGuard.

[0]: https://android-developers.googleblog.com/2020/02/the-path-to-dx-deprecation.html
[1]: http://googlesamples.github.io/android-custom-lint-rules/usage/changes.md.html
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Jun 9, 2022
Context: dotnet/android-tools#169

Context: https://dl-ssl.google.com/android/repository/repository2-3.xml
Context: 22bc14b

Turn XA1023 into an error.

Commit xamarin/xamarin-android-tools@TODO_HASH bumps
`$(AndroidSdkBuildToolsVersion)` to 32.0.0, which was the latest non-
preview `build-tools` package version on 2022-06-06.  The "problem"
is that [build-tools 31.0.0 *removed* `dx`][0], and thus Classic
Xamarin.Android has stuck with build-tools 30.0.0 as the default
version for years.

Commit 22bc14b introduced warning XA1023 (an *error* in .NET 5+),
as we saw no reason to support `dx` in .NET 5 when it was already
deprecated.

Warning XA1023 has been emitted in Classic Xamarin.Android since
Visual Studio 16.9 (released 2021-Mar); we feel there has been ample
time to migrate away from `dx` and to the replacement of `d8`.

Turn XA1023 into an *error* for Classic Xamarin.Android builds,
ensuring things are consistent between Classic Xamarin.Android and
.NET 6+.

Commit xamarin/xamarin-android-tools@TODO_HASH *also* bumps
`$(AndroidCommandLineToolsVersion)` to 7.0.  Update
`$(CommandLineToolsVersion)` in `Configuration.props` accordingly.

The `cmdline-tools` package v7.0 contains contains [`lint` 7.2][1],
which introduces a new `lint` check called `RedundantLabel`:

> Redundant label on activity in manifest

meaning that the `//actviity/@android:label` value is identical to
the `//application/@android:label` value, and thus isn't needed.

This causes a warning from `BuildTest.CheckLintErrorsAndWarnings()`:

	obj/Debug/android/AndroidManifest.xml(12,44): warning XA0102:
	Redundant label can be removed [RedundantLabel]

For now, update `BuildTest.CheckLintErrorsAndWarnings()` to ignore
`RedundantLabel` warnings.

TODO:

Remove support for `dx` and ProGuard.

[0]: https://android-developers.googleblog.com/2020/02/the-path-to-dx-deprecation.html
[1]: http://googlesamples.github.io/android-custom-lint-rules/usage/changes.md.html
@jonpryor jonpryor force-pushed the jonp-bump-versions-2022-06-06 branch from 248a036 to 7375063 Compare June 11, 2022 02:02
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Jun 11, 2022
Context: dotnet/android-tools#169

Context: https://dl-ssl.google.com/android/repository/repository2-3.xml
Context: 22bc14b

Turn XA1023 into an error.

Commit xamarin/xamarin-android-tools@TODO_HASH bumps
`$(AndroidSdkBuildToolsVersion)` to 32.0.0, which was the latest non-
preview `build-tools` package version on 2022-06-06.  The "problem"
is that [build-tools 31.0.0 *removed* `dx`][0], and thus Classic
Xamarin.Android has stuck with build-tools 30.0.0 as the default
version for years.

Commit 22bc14b introduced warning XA1023 (an *error* in .NET 5+),
as we saw no reason to support `dx` in .NET 5 when it was already
deprecated.

Warning XA1023 has been emitted in Classic Xamarin.Android since
Visual Studio 16.9 (released 2021-Mar); we feel there has been ample
time to migrate away from `dx` and to the replacement of `d8`.

Turn XA1023 into an *error* for Classic Xamarin.Android builds,
ensuring things are consistent between Classic Xamarin.Android and
.NET 6+.

Commit xamarin/xamarin-android-tools@TODO_HASH *also* bumps
`$(AndroidCommandLineToolsVersion)` to 7.0.  Update
`$(CommandLineToolsVersion)` in `Configuration.props` accordingly.

The `cmdline-tools` package v7.0 contains contains [`lint` 7.2][1],
which introduces a new `lint` check called `RedundantLabel`:

> Redundant label on activity in manifest

meaning that the `//actviity/@android:label` value is identical to
the `//application/@android:label` value, and thus isn't needed.

This causes a warning from `BuildTest.CheckLintErrorsAndWarnings()`:

	obj/Debug/android/AndroidManifest.xml(12,44): warning XA0102:
	Redundant label can be removed [RedundantLabel]

For now, update `BuildTest.CheckLintErrorsAndWarnings()` to ignore
`RedundantLabel` warnings.

TODO:

Remove support for `dx` and ProGuard.

[0]: https://android-developers.googleblog.com/2020/02/the-path-to-dx-deprecation.html
[1]: http://googlesamples.github.io/android-custom-lint-rules/usage/changes.md.html
@jonpryor jonpryor force-pushed the jonp-bump-versions-2022-06-06 branch from 9f99fb0 to 7f86290 Compare June 13, 2022 10:33
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Jun 13, 2022
Context: dotnet/android-tools#169

Context: https://dl-ssl.google.com/android/repository/repository2-3.xml
Context: 22bc14b

Turn XA1023 into an error.

Commit xamarin/xamarin-android-tools@TODO_HASH bumps
`$(AndroidSdkBuildToolsVersion)` to 32.0.0, which was the latest non-
preview `build-tools` package version on 2022-06-06.  The "problem"
is that [build-tools 31.0.0 *removed* `dx`][0], and thus Classic
Xamarin.Android has stuck with build-tools 30.0.0 as the default
version for years.

Commit 22bc14b introduced warning XA1023 (an *error* in .NET 5+),
as we saw no reason to support `dx` in .NET 5 when it was already
deprecated.

Warning XA1023 has been emitted in Classic Xamarin.Android since
Visual Studio 16.9 (released 2021-Mar); we feel there has been ample
time to migrate away from `dx` and to the replacement of `d8`.

Turn XA1023 into an *error* for Classic Xamarin.Android builds,
ensuring things are consistent between Classic Xamarin.Android and
.NET 6+.

Commit xamarin/xamarin-android-tools@TODO_HASH *also* bumps
`$(AndroidCommandLineToolsVersion)` to 7.0.  Update
`$(CommandLineToolsVersion)` in `Configuration.props` accordingly.

The `cmdline-tools` package v7.0 contains contains [`lint` 7.2][1],
which introduces a new `lint` check called `RedundantLabel`:

> Redundant label on activity in manifest

meaning that the `//actviity/@android:label` value is identical to
the `//application/@android:label` value, and thus isn't needed.

This causes a warning from `BuildTest.CheckLintErrorsAndWarnings()`:

	obj/Debug/android/AndroidManifest.xml(12,44): warning XA0102:
	Redundant label can be removed [RedundantLabel]

For now, update `BuildTest.CheckLintErrorsAndWarnings()` to ignore
`RedundantLabel` warnings.

TODO:

Remove support for `dx` and ProGuard.

[0]: https://android-developers.googleblog.com/2020/02/the-path-to-dx-deprecation.html
[1]: http://googlesamples.github.io/android-custom-lint-rules/usage/changes.md.html
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Jun 14, 2022
Context: dotnet/android-tools#169

Context: https://dl-ssl.google.com/android/repository/repository2-3.xml
Context: 22bc14b

Turn XA1023 into an error.

Commit xamarin/xamarin-android-tools@TODO_HASH bumps
`$(AndroidSdkBuildToolsVersion)` to 32.0.0, which was the latest non-
preview `build-tools` package version on 2022-06-06.  The "problem"
is that [build-tools 31.0.0 *removed* `dx`][0], and thus Classic
Xamarin.Android has stuck with build-tools 30.0.0 as the default
version for years.

Commit 22bc14b introduced warning XA1023 (an *error* in .NET 5+),
as we saw no reason to support `dx` in .NET 5 when it was already
deprecated.

Warning XA1023 has been emitted in Classic Xamarin.Android since
Visual Studio 16.9 (released 2021-Mar); we feel there has been ample
time to migrate away from `dx` and to the replacement of `d8`.

Turn XA1023 into an *error* for Classic Xamarin.Android builds,
ensuring things are consistent between Classic Xamarin.Android and
.NET 6+.

Commit xamarin/xamarin-android-tools@TODO_HASH *also* bumps
`$(AndroidCommandLineToolsVersion)` to 7.0.  Update
`$(CommandLineToolsVersion)` in `Configuration.props` accordingly.

The `cmdline-tools` package v7.0 contains contains [`lint` 7.2][1],
which introduces a new `lint` check called `RedundantLabel`:

> Redundant label on activity in manifest

meaning that the `//actviity/@android:label` value is identical to
the `//application/@android:label` value, and thus isn't needed.

This causes a warning from `BuildTest.CheckLintErrorsAndWarnings()`:

	obj/Debug/android/AndroidManifest.xml(12,44): warning XA0102:
	Redundant label can be removed [RedundantLabel]

For now, update `BuildTest.CheckLintErrorsAndWarnings()` to ignore
`RedundantLabel` warnings.

TODO:

Remove support for `dx` and ProGuard.

[0]: https://android-developers.googleblog.com/2020/02/the-path-to-dx-deprecation.html
[1]: http://googlesamples.github.io/android-custom-lint-rules/usage/changes.md.html
jonpryor added 6 commits June 15, 2022 07:46
Context: https://dl-ssl.google.com/android/repository/repository2-3.xml
Context: dotnet/android@e4b3adb

Update the preferred Android SDK component versions to the current latest
versions listed in the [Android Repository file][0]:

  * `$(AndroidSdkBuildToolsVersion)`/build-tools to 32.0.0
  * `$(AndroidSdkPlatformToolsVersion)`/platform-tools to 32.0.0
  * `$(AndroidSdkPlatformVersion)`/platform to android-32
  * `$(AndroidCommandLineToolsVersion)`/cmdline-tools to 7.0
  * `$(AndroidNdkVersion)`/NDK to 23.2.8568313

[0]: https://dl-ssl.google.com/android/repository/repository2-3.xml
Context: dotnet/android#7073 (comment)

I *think* this will fix `InstallAndroidDependenciesTest()`.
Context? https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml

Trying to use either NDK 23.2.8568313 or 21.4.7075529 results in lots
of unit test failures, none of which actually make sense:

	[CC] "C:\a\_work\1\a\TestRelease\06-11_16.01.37\temp\SDK Ümläüts\ndk\toolchains\llvm\prebuilt\windows-x86_64\bin\armv7a-linux-androideabi19-clang.CMD" -c -D__ANDROID_API__=19 -DANDROID -o obj\Release\bundles\armeabi-v7a\temp.o -I "C:\a\_work\1\a\TestRelease\06-11_16.01.37\temp\SDK Ümläüts\ndk\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\arm-linux-androideabi" -I "C:\a\_work\1\a\TestRelease\06-11_16.01.37\temp\SDK Ümläüts\ndk\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include" obj\Release\bundles\armeabi-v7a\temp.c (TaskId:259)
	[cc stderr] 'C:\a\_work\1\a\TestRelease\06-11_16.01.37\temp\SDK' is not recognized as an internal or external command, (TaskId:259)
	[cc stderr] operable program or batch file. (TaskId:259)

NDK 21.4.7075529 *does* have
`toolchains/llvm/prebuilt/windows-x86_64/bin/armv7a-linux-androideabi19-clang.cmd`,
so I'm not sure why this would fail?  `readelf` also can't be found?

Nothing makes sense.

Revert the NDK change, see if that fixes the tests.

(I currently expect it to *not* fix the failures, and that something
else is going wrong, but…)
This reverts commit 7f86290.

Context: actions/runner-images@2950cbf
Context: https://github.com/actions/virtual-environments/blob/9cf1ebd754807fba137c8ce9fa2140311609fdd6/images/win/Windows2022-Readme.md

wrt 7f86290, the problems observed
weren't due to the NDK version, it was due inadvertently building
on an updated VM Image which set NDK r24 as
`$(ANDROID_NDK_LATEST_HOME)`, which had unanticipated breakages.

Set `$(AndroidNdkVersion)`=23.2.8568313, which is also the default
GitHub Actions `$(ANDROID_NDK_HOME)` default version.
build-tools 33.0.0 is the current latest version.  Try that.
Now that we've figured out the NDK failures on xamarin-android,
let's try latest.
@jonpryor jonpryor force-pushed the jonp-bump-versions-2022-06-06 branch from d800d07 to da5e26f Compare June 15, 2022 11:49
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Jun 15, 2022
Context: dotnet/android-tools#169

Context: https://dl-ssl.google.com/android/repository/repository2-3.xml
Context: 22bc14b

Turn XA1023 into an error.

Commit xamarin/xamarin-android-tools@TODO_HASH bumps
`$(AndroidSdkBuildToolsVersion)` to 32.0.0, which was the latest non-
preview `build-tools` package version on 2022-06-06.  The "problem"
is that [build-tools 31.0.0 *removed* `dx`][0], and thus Classic
Xamarin.Android has stuck with build-tools 30.0.0 as the default
version for years.

Commit 22bc14b introduced warning XA1023 (an *error* in .NET 5+),
as we saw no reason to support `dx` in .NET 5 when it was already
deprecated.

Warning XA1023 has been emitted in Classic Xamarin.Android since
Visual Studio 16.9 (released 2021-Mar); we feel there has been ample
time to migrate away from `dx` and to the replacement of `d8`.

Turn XA1023 into an *error* for Classic Xamarin.Android builds,
ensuring things are consistent between Classic Xamarin.Android and
.NET 6+.

Commit xamarin/xamarin-android-tools@TODO_HASH *also* bumps
`$(AndroidCommandLineToolsVersion)` to 7.0.  Update
`$(CommandLineToolsVersion)` in `Configuration.props` accordingly.

The `cmdline-tools` package v7.0 contains contains [`lint` 7.2][1],
which introduces a new `lint` check called `RedundantLabel`:

> Redundant label on activity in manifest

meaning that the `//actviity/@android:label` value is identical to
the `//application/@android:label` value, and thus isn't needed.

This causes a warning from `BuildTest.CheckLintErrorsAndWarnings()`:

	obj/Debug/android/AndroidManifest.xml(12,44): warning XA0102:
	Redundant label can be removed [RedundantLabel]

For now, update `BuildTest.CheckLintErrorsAndWarnings()` to ignore
`RedundantLabel` warnings.

TODO:

Remove support for `dx` and ProGuard.

[0]: https://android-developers.googleblog.com/2020/02/the-path-to-dx-deprecation.html
[1]: http://googlesamples.github.io/android-custom-lint-rules/usage/changes.md.html
33.0.0 causes issues w/ multidex, as it doesn't contain
`mainDexClasses.rules`, which results in unit test failures as d8
fails.

Go back to 32.0.0.
"23.1.7779620",
"24.0.8215888",
};
string expectedVersion = "23.1.7779620";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to update this number to fix the test?

Ndk_MultipleNdkVersionsInSdk
AndroidNdkPath not found inside sdk!
String lengths are both 77. Strings differ at index 66.
Expected: "...nistrator\AppData\Local\Temp\tmp51D5.tmp\sdk\ndk\23.1.7779620"
But was:  "...nistrator\AppData\Local\Temp\tmp51D5.tmp\sdk\ndk\24.0.8215888"

@jonpryor jonpryor marked this pull request as ready for review June 15, 2022 21:17
@jonpryor jonpryor merged commit 9c641b3 into main Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants