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

[tools] AndroidAppBuilder dx dependence breaks on Android SDK 31.0.0 and up #65087

Closed
mdh1418 opened this issue Feb 9, 2022 · 1 comment · Fixed by #68084
Closed

[tools] AndroidAppBuilder dx dependence breaks on Android SDK 31.0.0 and up #65087

mdh1418 opened this issue Feb 9, 2022 · 1 comment · Fixed by #68084
Assignees
Milestone

Comments

@mdh1418
Copy link
Member

mdh1418 commented Feb 9, 2022

/Users/mdhwang/runtime_droid/src/tests/build.proj(245,5): error MSB4018: The "AndroidAppBuilderTask" task failed unexpectedly.
/Users/mdhwang/runtime_droid/src/tests/build.proj(245,5): error MSB4018: System.ComponentModel.Win32Exception (2): An error occurred trying to start process '/Users/mdhwang/android-sdk/build-tools/32.0.0/dx' with working directory '/Users/mdhwang/runtime_droid/artifacts/tests/coreclr/obj/Android.x64.Debug/Managed/./build/AndroidApps/tracing_eventpipe/apk'. No such file or directory
/Users/mdhwang/runtime_droid/src/tests/build.proj(245,5): error MSB4018:    at System.Diagnostics.Process.ForkAndExecProcess(ProcessStartInfo startInfo, String resolvedFilename, String[] argv, String[] envp, String cwd, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
/Users/mdhwang/runtime_droid/src/tests/build.proj(245,5): error MSB4018:    at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
/Users/mdhwang/runtime_droid/src/tests/build.proj(245,5): error MSB4018:    at System.Diagnostics.Process.Start()
/Users/mdhwang/runtime_droid/src/tests/build.proj(245,5): error MSB4018:    at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
/Users/mdhwang/runtime_droid/src/tests/build.proj(245,5): error MSB4018:    at Utils.TryRunProcess(TaskLoggingHelper logger, String path, String args, IDictionary`2 envVars, String workingDir, Boolean silent, Boolean logStdErrAsMessage, MessageImportance debugMessageImportance, String label) in /Users/mdhwang/runtime_droid/src/tasks/Common/Utils.cs:line 144
/Users/mdhwang/runtime_droid/src/tests/build.proj(245,5): error MSB4018:    at Utils.RunProcess(TaskLoggingHelper logger, String path, String args, IDictionary`2 envVars, String workingDir, Boolean ignoreErrors, Boolean silent, MessageImportance debugMessageImportance) in /Users/mdhwang/runtime_droid/src/tasks/Common/Utils.cs:line 88
/Users/mdhwang/runtime_droid/src/tests/build.proj(245,5): error MSB4018:    at ApkBuilder.BuildApk(String abi, String mainLibraryFileName, String monoRuntimeHeaders) in /Users/mdhwang/runtime_droid/src/tasks/AndroidAppBuilder/ApkBuilder.cs:line 387
/Users/mdhwang/runtime_droid/src/tests/build.proj(245,5): error MSB4018:    at AndroidAppBuilderTask.Execute() in /Users/mdhwang/runtime_droid/src/tasks/AndroidAppBuilder/AndroidAppBuilder.cs:line 110
/Users/mdhwang/runtime_droid/src/tests/build.proj(245,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
/Users/mdhwang/runtime_droid/src/tests/build.proj(245,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)

It looks like dx has officially been removed from Android SDK since version 31.0.0.
The plan to switch to d8 has finally finished its last phase https://android-developers.googleblog.com/2018/04/android-studio-switching-to-d8-dexer.html, so if we plan to support newer devices using these higher API levels, we should update the AndroidAppBuilder to work with d8.

@dotnet-issue-labeler dotnet-issue-labeler bot added area-Infrastructure-mono untriaged New issue has not been triaged by the area owner labels Feb 9, 2022
@ghost
Copy link

ghost commented Feb 9, 2022

Tagging subscribers to this area: @directhex
See info in area-owners.md if you want to be subscribed.

Issue Details
/Users/mdhwang/runtime_droid/src/tests/build.proj(245,5): error MSB4018: The "AndroidAppBuilderTask" task failed unexpectedly.
/Users/mdhwang/runtime_droid/src/tests/build.proj(245,5): error MSB4018: System.ComponentModel.Win32Exception (2): An error occurred trying to start process '/Users/mdhwang/android-sdk/build-tools/32.0.0/dx' with working directory '/Users/mdhwang/runtime_droid/artifacts/tests/coreclr/obj/Android.x64.Debug/Managed/./build/AndroidApps/tracing_eventpipe/apk'. No such file or directory
/Users/mdhwang/runtime_droid/src/tests/build.proj(245,5): error MSB4018:    at System.Diagnostics.Process.ForkAndExecProcess(ProcessStartInfo startInfo, String resolvedFilename, String[] argv, String[] envp, String cwd, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
/Users/mdhwang/runtime_droid/src/tests/build.proj(245,5): error MSB4018:    at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
/Users/mdhwang/runtime_droid/src/tests/build.proj(245,5): error MSB4018:    at System.Diagnostics.Process.Start()
/Users/mdhwang/runtime_droid/src/tests/build.proj(245,5): error MSB4018:    at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
/Users/mdhwang/runtime_droid/src/tests/build.proj(245,5): error MSB4018:    at Utils.TryRunProcess(TaskLoggingHelper logger, String path, String args, IDictionary`2 envVars, String workingDir, Boolean silent, Boolean logStdErrAsMessage, MessageImportance debugMessageImportance, String label) in /Users/mdhwang/runtime_droid/src/tasks/Common/Utils.cs:line 144
/Users/mdhwang/runtime_droid/src/tests/build.proj(245,5): error MSB4018:    at Utils.RunProcess(TaskLoggingHelper logger, String path, String args, IDictionary`2 envVars, String workingDir, Boolean ignoreErrors, Boolean silent, MessageImportance debugMessageImportance) in /Users/mdhwang/runtime_droid/src/tasks/Common/Utils.cs:line 88
/Users/mdhwang/runtime_droid/src/tests/build.proj(245,5): error MSB4018:    at ApkBuilder.BuildApk(String abi, String mainLibraryFileName, String monoRuntimeHeaders) in /Users/mdhwang/runtime_droid/src/tasks/AndroidAppBuilder/ApkBuilder.cs:line 387
/Users/mdhwang/runtime_droid/src/tests/build.proj(245,5): error MSB4018:    at AndroidAppBuilderTask.Execute() in /Users/mdhwang/runtime_droid/src/tasks/AndroidAppBuilder/AndroidAppBuilder.cs:line 110
/Users/mdhwang/runtime_droid/src/tests/build.proj(245,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
/Users/mdhwang/runtime_droid/src/tests/build.proj(245,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)

It looks like dx has officially been removed from Android SDK since version 31.0.0.
The plan to switch to d8 has finally finished its last phase https://android-developers.googleblog.com/2018/04/android-studio-switching-to-d8-dexer.html, so if we plan to support newer devices using these higher API levels, we should update the AndroidAppBuilder to work with d8.

Author: mdh1418
Assignees: -
Labels:

untriaged, area-Infrastructure-mono

Milestone: -

@steveisok steveisok removed the untriaged New issue has not been triaged by the area owner label Apr 15, 2022
@steveisok steveisok added this to the 7.0.0 milestone Apr 15, 2022
@akoeplinger akoeplinger self-assigned this Apr 15, 2022
akoeplinger added a commit to akoeplinger/runtime that referenced this issue Apr 15, 2022
dx has officially been removed from Android SDK since build-tools version 31.0.0.

Fixes dotnet#65087
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Apr 15, 2022
akoeplinger added a commit that referenced this issue Apr 17, 2022
dx has officially been removed from Android SDK since build-tools version 31.0.0.

Fixes #65087
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Apr 17, 2022
@ghost ghost locked as resolved and limited conversation to collaborators May 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants