Repository navigation
Closed
Description
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
Xyncgas commentedon Mar 9, 2023
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
BuildAotApplicationWithSpecialCharactersInProjectin the error displayedakoeplinger commentedon Mar 10, 2023
I tried reproducing on the Mac and it seems to work fine there, so it is probably a Windows-specific issue:
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.
akoeplinger commentedon Mar 10, 2023
@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.
dellis1972 commentedon Mar 10, 2023
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.
SamMonoRT commentedon Aug 4, 2023
@lambdageek - this is a Windows only issue, not sure about the priority for 8.0?
lambdageek commentedon Aug 4, 2023
@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
BrzVlad commentedon Aug 14, 2023
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.
SamMonoRT commentedon Aug 15, 2023
@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.
BrzVlad commentedon Aug 22, 2023
After further investigation it seems like llvm tools work as expected. We actually have a wrapper around
llvm-mcin 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.dellis1972 commentedon Aug 22, 2023
There is also a related issue upstream in the aapt2 tool https://issuetracker.google.com/issues/188679588
SamMonoRT commentedon Sep 7, 2023
cc @ilonatommy who is investigating somewhat related WASM tooling issue
ilonatommy commentedon Sep 8, 2023
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.
BrzVlad commentedon Feb 13, 2024
I'm expecting this to be fixed starting in .net 9 Preview 2