Skip to content

Conversation

@jonpryor
Copy link
Contributor

Context: dotnet/android#8514

The scenario is as follows:

  1. Install Visual Studio 17.9 Preview 2 on a clean machine. This installs Android SDK build-tools 34.0.0, cmdline-tools v11.0.
  2. Create a new Xamarin.Android project.
  3. Build the project.

(3) prompts the user to install Android SDK build-tools 32.0.0 and cmdline-tools 7.0, because Xamarin.Android contains default values of $(AndroidSdkBuildToolsVersion)=32.0.0 and
$(AndroidCommandLineToolsVersion)=7.0.

This isn't a blocker; the user need only accept the license and install the downlevel package versions. It's just not ideal.

Update $(AndroidSdkBuildToolsVersion),
$(AndroidCommandLineToolsVersion) and
$(AndroidSdkPlatformToolsVersion) to be consistent with .NET 8:

  • $(AndroidCommandLineToolsVersion)/cmdline-tools to 11.0
  • $(AndroidSdkBuildToolsVersion)/build-tools to 34.0.0
  • $(AndroidSdkPlatformToolsVersion)/platform-tools to 34.0.5

This ensures that new classic Xamarin.Android projects won't require the installation of additional packages to install.

Context: dotnet/android#8514

The scenario is as follows:

 1. Install Visual Studio 17.9 Preview 2 on a clean machine.
    This installs Android SDK build-tools 34.0.0, cmdline-tools v11.0.
 2. Create a new Xamarin.Android project.
 3. Build the project.

(3) prompts the user to install Android SDK build-tools 32.0.0 and
cmdline-tools 7.0, because Xamarin.Android contains default values of
`$(AndroidSdkBuildToolsVersion)`=32.0.0 and
`$(AndroidCommandLineToolsVersion)`=7.0.

This isn't a *blocker*; the user need only accept the license and
install the downlevel package versions.  It's just not *ideal*.

Update `$(AndroidSdkBuildToolsVersion)`,
`$(AndroidCommandLineToolsVersion)` and
`$(AndroidSdkPlatformToolsVersion)` to be consistent with .NET 8:

  * `$(AndroidCommandLineToolsVersion)`/cmdline-tools to 11.0
  * `$(AndroidSdkBuildToolsVersion)`/build-tools to 34.0.0
  * `$(AndroidSdkPlatformToolsVersion)`/platform-tools to 34.0.5

This ensures that new classic Xamarin.Android projects won't require
the installation of additional packages to install.
jonpryor added a commit to dotnet/android that referenced this pull request Dec 11, 2023
Context: dotnet/android#8580 (comment)

> it doesn't build:
>
> ```
> MSBUILD : java error JAVA0000: Error in /Users/builder/android-toolchain/sdk/build-tools/34.0.0/mainDexClasses.rules: [/Users/builder/azdo/_work/4/s/xamarin-android/tests/Mono.Android-Tests/Runtime-MultiDex/Mono.Android-TestsMultiDex.csproj]
> MSBUILD : java error JAVA0000: Failed to read file: /Users/builder/android-toolchain/sdk/build-tools/34.0.0/mainDexClasses.rules [/Users/builder/azdo/_work/4/s/xamarin-android/tests/Mono.Android-Tests/Runtime-MultiDex/Mono.Android-TestsMultiDex.csproj]
> MSBUILD : java error JAVA0000: Compilation failed [/Users/builder/azdo/_work/4/s/xamarin-android/tests/Mono.Android-Tests/Runtime-MultiDex/Mono.Android-TestsMultiDex.csproj]
> MSBUILD : java error JAVA0000: java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin [/Users/builder/azdo/_work/4/s/xamarin-android/tests/Mono.Android-Tests/Runtime-MultiDex/Mono.Android-TestsMultiDex.csproj]
> MSBUILD : java error JAVA0000:  /Users/builder/android-toolchain/sdk/build-tools/34.0.0/mainDexClasses.rules [/Users/builder/azdo/_work/4/s/xamarin-android/tests/Mono.Android-Tests/Runtime-MultiDex/Mono.Android-TestsMultiDex.csproj]
> ```
jonpryor added a commit to dotnet/android that referenced this pull request Dec 19, 2023
jonpryor added a commit to dotnet/android that referenced this pull request Dec 20, 2023
@jonpryor
Copy link
Contributor Author

I no longer think this is a good idea: dotnet/android#8580 (comment)

Closing.

@jonpryor jonpryor closed this Dec 20, 2023
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.

2 participants