You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Putting project in a folder/directory containing some non-ASCII chars, like Czech alphabet (tested with á) breaks Android build.
This does not affect any other C# projects. I have beeing using WinForms, Blazor, WPF on this path and all has been working fine for years.
Even VS Solution, folder names and class and property names can contain these special symbols fine.
It seems like the problem is in Android tools.
I have experienced these issues with C++ compilers and other UNIX tools which live in the ASCII-only world.
Severity Code Description Project File Line Suppression State
Error APT2000 System cannot find file. (2). Tempus.Mobile.GUI C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\31.0.200-preview.14.106\tools\Xamarin.Android.Aapt2.targets 217
Steps to Reproduce
Put project in any path containing "á" symbol.
I created a minimal repro with C:/á/ProjectFolder
However the commands you provided are not MAUI. They are some Android project commands (probably Xamarin) and they created an Android project, not MAUI.
The APT2000 build error happens for MAUI projects.
I think it does reproduce with dotnet new maui and not dotnet new android:
dotnet\packs\Microsoft.Android.Sdk.Windows\32.0.300-rc.2.27\tools\Xamarin.Android.Aapt2.targets(217,3): error APT2000: The system cannot find the file specified.
I think it does reproduce with dotnet new maui and not dotnet new android:
dotnet\packs\Microsoft.Android.Sdk.Windows\32.0.300-rc.2.27\tools\Xamarin.Android.Aapt2.targets(217,3): error APT2000: The system cannot find the file specified.
This may well be down to aapt2 . It is odd that certain characters are triggering this though. We do have unit tests specifically for accentent characters and they are passing.
Sure, it was C:\Users\adam_\source\repos...
When I moved it to C:\sourcenew\repos...
Everything started working. I'm extremely new to and bad at Xamarin/MAUI so apologies if this isn't helpful, but this thread helped me identify the underscore as an outlier and the fact that it built immediately upon moving led me to share. So to answer your question the underscore was above the project.
Get Outlook for Android<https://aka.ms/AAb9ysg>
Thats good to know thanks. I'll add a test for that. We can't "fix" it because the issue is upstream in one of google's tools.
But we can log a better error message.
Two days ago, we moved our Windows sessions to Azure Entra and I started having this issue when building in Release mode.
The same day, I also updated VS to 17.13.3 version.
I noticed that my account folder had a non-ASCII character in it, so I decided to move my repo on D drive (also using takeown to be the rightful owner of the directory)
D:\Git\MyCompany\MyProduct\MyProduct.Mobile
I moved it back to the root of C drive but it still happens.
I also tried : dotnet workload repair
It's strange because it was working perfectly before the latest VS Update + Entra migration.
I don't know where the issue comes from ?
VS 17.13.3 regression ?
aapt bug ?
Some obscure right issue ?
Unless the dot in the path is the culprit here ?
Any help would be appreciated.
Edit : looking at the build output, it's looking at my nuget package cache in my session folder (with non-ASCII character), could that be the issue ?
Two days ago, we moved our Windows sessions to Azure Entra and I started having this issue when building in Release mode.
The same day, I also updated VS to 17.13.3 version.
I noticed that my account folder had a non-ASCII character in it, so I decided to move my repo on D drive (also using takeown to be the rightful owner of the directory)
D:\Git\MyCompany\MyProduct\MyProduct.Mobile
I moved it back to the root of C drive but it still happens.
I also tried : dotnet workload repair
It's strange because it was working perfectly before the latest VS Update + Entra migration.
I don't know where the issue comes from ?
* VS 17.13.3 regression ?
* aapt bug ?
* Some obscure right issue ?
Unless the dot in the path is the culprit here ?
Any help would be appreciated.
Edit : looking at the build output, it's looking at my nuget package cache in my session folder (with non-ASCII character), could that be the issue ?
NuGet package cache has been a great serial killer of deterministic solution builds on new computers in our company. For example disabling/enabling package sources has no effects or when package is in two sources, Visual Studio does not find it at all. I suggest you definitely check the NuGet stuff
the log does not have the same error as this issue?
C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.50\targets\Microsoft.Android.Sdk.Aot.targets(110,5): Precompiling failed for C:\Git\Novogen\NDC\NDC.Mobile\obj\Release\net9.0-android\android-arm64\linked\NDC.Constants.dll with exit code 1.
The specified response file can not be read [C:\Git\Novogen\NDC\NDC.Mobile\NDC.Mobile.csproj]
Repro steps same as Eilon's bug, and error APT2265 when project path contains GB18030 string, error message: "error APT2265: This may be due to the project's file name or path containing non ASCII characters. For detailed information, please refer to https://learn.microsoft.com/dotnet/android/messages/apt2265."
Testing Environment Confirmation
• Ensure that the SimSun-ExtG font is installed on your Windows.
• Make sure that the Windows display language and system locale are set to Chinese (Simplified, China):
Go to Settings > Time & Language > Language & Region.
If the Chinese (Simplified) language pack is not already installed, add it from the Language & Region settings UI.
Change the display language to Simplified Chinese.
Navigate to Administrative language settings and change the system locale to Chinese (Simplified, China).
Repro steps:
Create folder named as "唉", create a new sub folder named as "maui1".
Go to the folder "maui1", run from command line: dotnet new maui
Activity
jonathanpeppers commentedon Apr 19, 2022
@janseris this works for me:
If that doesn't work for you, can you attach the
msbuild.binlogfile that command creates? Thanks!I did find that
Releasebuilds fail, but different error:Disabling AOT with
-p:RunAOTCompilation=falseworks around this one. ^^janseris commentedon Apr 19, 2022
@jonathanpeppers confirmed your behavior on my machine as well.
But for .NET MAUI the error still persists.
APT2000.MAUI.MP4
jonathanpeppers commentedon Apr 19, 2022
@janseris can you build command line and share
msbuild.binlog?janseris commentedon Apr 19, 2022
@jonathanpeppers can you please provide the command for CLI build for Android in MAUI? I am not familiar with that.
Thank you
jonathanpeppers commentedon Apr 20, 2022
@janseris yes, it is above.
Try making a folder named
testáandcdinto it:These commands will create a
debug.binlogandrelease.binlog, we can see what both Debug & Release do.janseris commentedon Apr 21, 2022
testá logs.zip
However the commands you provided are not MAUI. They are some Android project commands (probably Xamarin) and they created an Android project, not MAUI.
The APT2000 build error happens for MAUI projects.
jonathanpeppers commentedon Apr 21, 2022
@janseris can you do the same for
dotnet new maui, then? Thanks!jonathanpeppers commentedon Apr 21, 2022
I think it does reproduce with
dotnet new mauiand notdotnet new android:janseris commentedon Apr 21, 2022
@jonathanpeppers yes that's it.
Here is my output for building dotnet new maui template with the commands:
testá MAUI.zip
dellis1972 commentedon Apr 21, 2022
This may well be down to
aapt2. It is odd that certain characters are triggering this though. We do have unit tests specifically for accentent characters and they are passing.dellis1972 commentedon Apr 21, 2022
@janseris
Can you add the following to your project
then build (from clean) on the command line again and post the logs?
This will give us more verbose
aapt2output. It should help narrow down which file is causing the error.16 remaining items
jonathanpeppers commentedon Jun 12, 2023
@BernhardPollerspoeck Xamarin ships a very old version of
aapt2that appears to be before Google introduced this issue.If you want to get the old version somehow, you can try setting
$(Aapt2ToolPath)in your project:https://github.com/xamarin/xamarin-android/blob/4125c0ce14549623df7e860bf4ad67d0d9738aad/src/Xamarin.Android.Build.Tasks/MSBuild/Xamarin/Android/Xamarin.Android.Aapt2.targets#L132
spanko commentedon Mar 1, 2025
aapt2 fails for file paths containing underscores as well
dellis1972 commentedon Mar 1, 2025
@spanko are the underscores in the path above the project or in the Resources folder? Can you give an example?
spanko commentedon Mar 1, 2025
dellis1972 commentedon Mar 1, 2025
Thats good to know thanks. I'll add a test for that. We can't "fix" it because the issue is upstream in one of google's tools.
But we can log a better error message.
LeDahu22 commentedon Mar 14, 2025
Two days ago, we moved our Windows sessions to Azure Entra and I started having this issue when building in Release mode.
The same day, I also updated VS to 17.13.3 version.
I noticed that my account folder had a non-ASCII character in it, so I decided to move my repo on D drive (also using takeown to be the rightful owner of the directory)
I moved it back to the root of C drive but it still happens.
I also tried : dotnet workload repair
It's strange because it was working perfectly before the latest VS Update + Entra migration.
I don't know where the issue comes from ?
Unless the dot in the path is the culprit here ?
Any help would be appreciated.
Edit : looking at the build output, it's looking at my nuget package cache in my session folder (with non-ASCII character), could that be the issue ?
dellis1972 commentedon Mar 14, 2025
@LeDahu22 we'd need a diagnostic build log to see what your specific issue is. See https://aka.ms/binlog for details on how to provide that.
The path name should be in the error message though.
For reference we added some new error messaging for this issue via #9809.
LeDahu22 commentedon Mar 14, 2025
Hi @dellis1972
Here is my Release binlog (after reviewing it, it doesn't had much though)
Edit : zip removed for privacy.
janseris commentedon Mar 14, 2025
NuGet package cache has been a great serial killer of deterministic solution builds on new computers in our company. For example disabling/enabling package sources has no effects or when package is in two sources, Visual Studio does not find it at all. I suggest you definitely check the NuGet stuff
LeDahu22 commentedon Mar 14, 2025
@janseris I've also tried to move the cache location using the following in Nuget.config, but it didn't solve the root issue.
dellis1972 commentedon Mar 14, 2025
@LeDahu22
the log does not have the same error as this issue?
LeDahu22 commentedon Mar 14, 2025
@dellis1972
Well it might be a bit different now yes, but at first, I had the same issue as the one mentionned in this topic.
dellis1972 commentedon Mar 14, 2025
We will need to open a new issue for that one.
v-yanfw commentedon Jul 18, 2025
Repro steps same as Eilon's bug, and error APT2265 when project path contains GB18030 string, error message: "error APT2265: This may be due to the project's file name or path containing non ASCII characters. For detailed information, please refer to https://learn.microsoft.com/dotnet/android/messages/apt2265."
Testing Environment Confirmation
• Ensure that the SimSun-ExtG font is installed on your Windows.
• Make sure that the Windows display language and system locale are set to Chinese (Simplified, China):
Repro steps:
Actually Result: error APT2265 appears:
maui1 net10.0-android 失败,出现 1 错误 (46.5 秒) → bin\Debug\net10.0-android\maui1.dll
C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\36.0.0-preview.6.169\tools\Xamarin.Android.Aapt2.targets(214,3): error APT2265: 这可能是由于项目的文件名或路径中包含非 ASCII 字符。有关详细信息,请参阅 https://learn.microsoft.com/dotnet/android/messages/apt2265。
jonathanpeppers commentedon Jul 18, 2025
For aapt2, we basically have to comment/upvote on Google's issue tracker.
This is one issue I found, but there could be more related: