Skip to content

MAUI project with non-ASCII project name cannot release to my Android phone #83203

Closed

Description

@dellis1972

Description

Context https://i.azdo.io/1714603

When a user tries to use certain non-ascii characters for the project name AOT fails with the following error

[随机生成器.dll] Running: C:\a\_work\1\s\xamarin-android\bin\Release\dotnet\packs\Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-arm\8.0.0-preview.2.23127.4\Sdk\..\tools\mono-aot-cross.exe --response="C:\Users\cloudtest\AppData\Local\Temp\tmp2we1dw.tmp" (TaskId:285)
                     [随机生成器.dll] Using working directory: C:\a\_work\1\a\TestRelease\03-08_16.56.43\temp\BuildAotApplicationWithSpecialCharactersInProject随机生成器True\随机生成器 (TaskId:285)
                     [随机生成器.dll] Setting environment variables for execution: (TaskId:285)
                     [随机生成器.dll] 	MONO_PATH = C:\a\_work\1\a\TestRelease\03-08_16.56.43\temp\BuildAotApplicationWithSpecialCharactersInProject随机生成器True\随机生成器\obj\Release\android-arm\linked; (TaskId:285)
                     [随机生成器.dll] 	MONO_ENV_OPTIONS =  (TaskId:285)
                     [随机生成器.dll] Exit code: 1 (TaskId:285)
                     [随机生成器.dll] Exec (with response file contents expanded) in C:\a\_work\1\a\TestRelease\03-08_16.56.43\temp\BuildAotApplicationWithSpecialCharactersInProject随机生成器True\随机生成器: MONO_PATH=C:\a\_work\1\a\TestRelease\03-08_16.56.43\temp\BuildAotApplicationWithSpecialCharactersInProject随机生成器True\随机生成器\obj\Release\android-arm\linked; MONO_ENV_OPTIONS= C:\a\_work\1\s\xamarin-android\bin\Release\dotnet\packs\Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-arm\8.0.0-preview.2.23127.4\Sdk\..\tools\mono-aot-cross.exe --debug --nollvm "--aot=asmwriter,temp-path=obj\Release\android-arm\aot\armeabi-v7a\随机生成器,mtriple=armv7-linux-gnueabi,tool-prefix=C:\a\_work\1\s\xamarin-android\bin\Release\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-ci.pr.gh7710.204\tools\binutils\bin\arm-linux-androideabi-,outfile=obj\Release\android-arm\aot\随机生成器.dll.so,ld-name=ld,ld-flags=--no-relax -s" "obj\Release\android-arm\linked\随机生成器.dll"
                      (TaskId:285)
17:04:39.276  1:12>C:\a\_work\1\s\xamarin-android\bin\Release\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-ci.pr.gh7710.204\targets\Microsoft.Android.Sdk.Aot.targets(110,5): error : Precompiling failed for C:\a\_work\1\a\TestRelease\03-08_16.56.43\temp\BuildAotApplicationWithSpecialCharactersInProject随机生成器True\随机生成器\obj\Release\android-arm\linked\随机生成器.dll with exit code 1. [C:\a\_work\1\a\TestRelease\03-08_16.56.43\temp\BuildAotApplicationWithSpecialCharactersInProject随机生成器True\随机生成器\随机生成器.csproj]
C:\a\_work\1\s\xamarin-android\bin\Release\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-ci.pr.gh7710.204\targets\Microsoft.Android.Sdk.Aot.targets(110,5): error : Unable to open file 'obj\Release\android-arm\aot\armeabi-v7a\随机生成器\temp.s': No such file or directory [C:\a\_work\1\a\TestRelease\03-08_16.56.43\temp\BuildAotApplicationWithSpecialCharactersInProject随机生成器True\随机生成器\随机生成器.csproj]
C:\a\_work\1\s\xamarin-android\bin\Release\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-ci.pr.gh7710.204\targets\Microsoft.Android.Sdk.Aot.targets(110,5): error : AOT of image C:\a\_work\1\a\TestRelease\03-08_16.56.43\temp\BuildAotApplicationWithSpecialCharactersInProject随机生成器True\随机生成器\obj\Release\android-arm\linked\随机生成器.dll failed. [C:\a\_work\1\a\TestRelease\03-08_16.56.43\temp\BuildAotApplicationWithSpecialCharactersInProject随机生成器True\随机生成器\随机生成器.csproj]
C:\a\_work\1\s\xamarin-android\bin\Release\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-ci.pr.gh7710.204\targets\Microsoft.Android.Sdk.Aot.targets(110,5): error : Mono Ahead of Time compiler - compiling assembly C:\a\_work\1\a\TestRelease\03-08_16.56.43\temp\BuildAotApplicationWithSpecialCharactersInProject随机生成器True\随机生成器\obj\Release\android-arm\linked\随机生成器.dll [C:\a\_work\1\a\TestRelease\03-08_16.56.43\temp\BuildAotApplicationWithSpecialCharactersInProject随机生成器True\随机生成器\随机生成器.csproj]
C:\a\_work\1\s\xamarin-android\bin\Release\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-ci.pr.gh7710.204\targets\Microsoft.Android.Sdk.Aot.targets(110,5): error : AOTID 2F8A7A33-8DCF-C9B3-0A30-14ACE4513839 [C:\a\_work\1\a\TestRelease\03-08_16.56.43\temp\BuildAotApplicationWithSpecialCharactersInProject随机生成器True\随机生成器\随机生成器.csproj]

Reproduction Steps

dotnet new android -o 随机生成器
cd 随机生成器
dotnet build -c Release -f net7.0-android

Expected behavior

The application should build without any errors.

Actual behavior

The following error is raised

[随机生成器.dll] Running: C:\a\_work\1\s\xamarin-android\bin\Release\dotnet\packs\Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-arm\8.0.0-preview.2.23127.4\Sdk\..\tools\mono-aot-cross.exe --response="C:\Users\cloudtest\AppData\Local\Temp\tmp2we1dw.tmp" (TaskId:285)
                     [随机生成器.dll] Using working directory: C:\a\_work\1\a\TestRelease\03-08_16.56.43\temp\BuildAotApplicationWithSpecialCharactersInProject随机生成器True\随机生成器 (TaskId:285)
                     [随机生成器.dll] Setting environment variables for execution: (TaskId:285)
                     [随机生成器.dll] 	MONO_PATH = C:\a\_work\1\a\TestRelease\03-08_16.56.43\temp\BuildAotApplicationWithSpecialCharactersInProject随机生成器True\随机生成器\obj\Release\android-arm\linked; (TaskId:285)
                     [随机生成器.dll] 	MONO_ENV_OPTIONS =  (TaskId:285)
                     [随机生成器.dll] Exit code: 1 (TaskId:285)
                     [随机生成器.dll] Exec (with response file contents expanded) in C:\a\_work\1\a\TestRelease\03-08_16.56.43\temp\BuildAotApplicationWithSpecialCharactersInProject随机生成器True\随机生成器: MONO_PATH=C:\a\_work\1\a\TestRelease\03-08_16.56.43\temp\BuildAotApplicationWithSpecialCharactersInProject随机生成器True\随机生成器\obj\Release\android-arm\linked; MONO_ENV_OPTIONS= C:\a\_work\1\s\xamarin-android\bin\Release\dotnet\packs\Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-arm\8.0.0-preview.2.23127.4\Sdk\..\tools\mono-aot-cross.exe --debug --nollvm "--aot=asmwriter,temp-path=obj\Release\android-arm\aot\armeabi-v7a\随机生成器,mtriple=armv7-linux-gnueabi,tool-prefix=C:\a\_work\1\s\xamarin-android\bin\Release\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-ci.pr.gh7710.204\tools\binutils\bin\arm-linux-androideabi-,outfile=obj\Release\android-arm\aot\随机生成器.dll.so,ld-name=ld,ld-flags=--no-relax -s" "obj\Release\android-arm\linked\随机生成器.dll"
                      (TaskId:285)
17:04:39.276  1:12>C:\a\_work\1\s\xamarin-android\bin\Release\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-ci.pr.gh7710.204\targets\Microsoft.Android.Sdk.Aot.targets(110,5): error : Precompiling failed for C:\a\_work\1\a\TestRelease\03-08_16.56.43\temp\BuildAotApplicationWithSpecialCharactersInProject随机生成器True\随机生成器\obj\Release\android-arm\linked\随机生成器.dll with exit code 1. [C:\a\_work\1\a\TestRelease\03-08_16.56.43\temp\BuildAotApplicationWithSpecialCharactersInProject随机生成器True\随机生成器\随机生成器.csproj]
C:\a\_work\1\s\xamarin-android\bin\Release\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-ci.pr.gh7710.204\targets\Microsoft.Android.Sdk.Aot.targets(110,5): error : Unable to open file 'obj\Release\android-arm\aot\armeabi-v7a\随机生成器\temp.s': No such file or directory [C:\a\_work\1\a\TestRelease\03-08_16.56.43\temp\BuildAotApplicationWithSpecialCharactersInProject随机生成器True\随机生成器\随机生成器.csproj]
C:\a\_work\1\s\xamarin-android\bin\Release\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-ci.pr.gh7710.204\targets\Microsoft.Android.Sdk.Aot.targets(110,5): error : AOT of image C:\a\_work\1\a\TestRelease\03-08_16.56.43\temp\BuildAotApplicationWithSpecialCharactersInProject随机生成器True\随机生成器\obj\Release\android-arm\linked\随机生成器.dll failed. [C:\a\_work\1\a\TestRelease\03-08_16.56.43\temp\BuildAotApplicationWithSpecialCharactersInProject随机生成器True\随机生成器\随机生成器.csproj]
C:\a\_work\1\s\xamarin-android\bin\Release\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-ci.pr.gh7710.204\targets\Microsoft.Android.Sdk.Aot.targets(110,5): error : Mono Ahead of Time compiler - compiling assembly C:\a\_work\1\a\TestRelease\03-08_16.56.43\temp\BuildAotApplicationWithSpecialCharactersInProject随机生成器True\随机生成器\obj\Release\android-arm\linked\随机生成器.dll [C:\a\_work\1\a\TestRelease\03-08_16.56.43\temp\BuildAotApplicationWithSpecialCharactersInProject随机生成器True\随机生成器\随机生成器.csproj]
C:\a\_work\1\s\xamarin-android\bin\Release\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-ci.pr.gh7710.204\targets\Microsoft.Android.Sdk.Aot.targets(110,5): error : AOTID 2F8A7A33-8DCF-C9B3-0A30-14ACE4513839 [C:\a\_work\1\a\TestRelease\03-08_16.56.43\temp\BuildAotApplicationWithSpecialCharactersInProject随机生成器True\随机生成器\随机生成器.csproj]

Regression?

Not sure if this is a regression, however the same dotnet new console -o 随机生成器 app will work correctly.

Known Workarounds

The only known workaround is to only use ASCII characters for project names.

Configuration

This can be re-produced on .net 7.0.200

Other information

No response

Activity

  1. ghost added
    untriaged
    on Mar 9, 2023
  2. Xyncgas commented on Mar 9, 2023

    @Xyncgas

    This likely to be a tool chain problem with android publishing, I had difficulty publishing with Japanese project name when I worked with Xamarin but it worked out some how (long ago)

    I suggest renaming the project with the name you want instead of creating the project with the name you wanted

    note BuildAotApplicationWithSpecialCharactersInProject in the error displayed

  3. akoeplinger commented on Mar 10, 2023

    @akoeplinger
    Member

    I tried reproducing on the Mac and it seems to work fine there, so it is probably a Windows-specific issue:

    image

    The only thing I noticed is that the non-ASCII characters in the .apk/.aab filename were replaced with underscores but I don't know whether that is an expected behavior from the Android toolchain @dellis1972

    The app on the device has the correct title and everything.

  4. added and removed
    untriaged
    on Mar 10, 2023
  5. added this to the 8.0.0 milestone on Mar 10, 2023
  6. akoeplinger commented on Mar 10, 2023

    @akoeplinger
    Member

    @vargaz @lambdageek @SamMonoRT this seems relevant related to what we discussed for #82187, it seems using non-ASCII in general works with the AOT compiler at least on the Mac.

  7. dellis1972 commented on Mar 10, 2023

    @dellis1972
    Author

    The underscores thing is an android tool chain issue I think, its not relatd to this issue.
    The reported error does only occur on windows.

  8. SamMonoRT commented on Aug 4, 2023

    @SamMonoRT
    Member

    @lambdageek - this is a Windows only issue, not sure about the priority for 8.0?

  9. lambdageek commented on Aug 4, 2023

    @lambdageek
    Member

    @SamMonoRT It's the AOT compiler running on Windows (ie: someone is using VS on Windows to develop an Android app). It's pretty high priority

  10. self-assigned this
    on Aug 7, 2023
  11. BrzVlad commented on Aug 14, 2023

    @BrzVlad
    Member

    This doesn't seem to be a regression. We do have some issues with handling of non-ascii characters in file names that easily fixable. The problem is that we need to compile some files with such characters and the compiler toolchain behind (some llvm tools) don't have support for wide chars. I'm not sure if this is intentional, will submit an issue on the llvm project to figure out if we can have a fix on their side. An alternative fix would be to rename all files so they can be processed by the toolchain, but that seems like a hack and rather risky this late in the release. Either way, seems like this issue should be left for net-9.0.

  12. SamMonoRT commented on Aug 15, 2023

    @SamMonoRT
    Member

    @BrzVlad - please can you add a link to the issue created on llvm project here for tracking.

    Moving this to 9.0 and will validate once llvm project owners have a suggestion.

  13. modified the milestones: 8.0.0, 9.0.0 on Aug 15, 2023
  14. BrzVlad commented on Aug 22, 2023

    @BrzVlad
    Member

    After further investigation it seems like llvm tools work as expected. We actually have a wrapper around llvm-mc in https://github.com/xamarin/xamarin-android-binutils which appears to be the culprit. Will fix it once I get in contact with the code owners and see if anything else is needed to make this scenario work.

  15. dellis1972 commented on Aug 22, 2023

    @dellis1972
    Author
  16. SamMonoRT commented on Sep 7, 2023

    @SamMonoRT
    Member

    cc @ilonatommy who is investigating somewhat related WASM tooling issue

  17. ilonatommy commented on Sep 8, 2023

    @ilonatommy
    Member

    cc @ilonatommy who is investigating somewhat related WASM tooling issue

    Thanks, for us it's AOT/relink case on Windows caused by emscripten not respecting wide chars: #83497. The fix for it seems to be on its way.

  18. BrzVlad commented on Feb 13, 2024

    @BrzVlad
    Member

    I'm expecting this to be fixed starting in .net 9 Preview 2

  19. locked and limited conversation to collaborators on Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions