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

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

Merged
merged 8 commits into from
Sep 15, 2023

Conversation

dellis1972
Copy link
Contributor

@dellis1972 dellis1972 commented Jan 17, 2023

Context https://i.azdo.io/1714603
Context https://issuetracker.google.com/issues/188679588

There is a known issue with aapt2, AndroidAsset and non-ASCII paths/project names.
aapt2 has a bug where it cannot correctly traverse a directory which contains non-ASCII
characters. We curently have no way to work around this issue.

So the PR adds some more detail to the specific error message which aapt2 raises in
these cases. It suggests the user check their paths to make sure it does not contain
non-ASCII characters.

We also add some unit tests to cover this senario.

Copy link
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The overall code changes look good. 👍

src/Xamarin.Android.Build.Tasks/Properties/Resources.resx Outdated Show resolved Hide resolved
… phone

Context https://i.azdo.io/1714603
Context https://issuetracker.google.com/issues/188679588

There is a known issue with `aapt2`, `AndroidAsset` and non-ASCII paths/project names.
`aapt2` has a bug where it cannot correctly traverse a directory which contains non-ASCII
characters. We curently have no way to work around this issue.

So the PR adds some more detail to the specific error message which `aapt2` raises in
these cases. It suggests the user check their paths to make sure it does not contain
non-ASCII characters.

We also add some unit tests to cover this senario.
proj.SetAndroidSupportedAbis ("armeabi-v7a", "arm64-v8a", "x86", "x86_64");
using (var builder = CreateApkBuilder (Path.Combine (rootPath, proj.ProjectName))){
builder.ThrowOnBuildFailure = false;
Assert.AreEqual (expectedResult, builder.Build (proj), "Build should have succeeded.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also verify the build error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@jonpryor jonpryor merged commit 40c609d into dotnet:main Sep 15, 2023
47 checks passed
@dellis1972 dellis1972 deleted the WI1714603 branch September 15, 2023 22:18
grendello added a commit to grendello/xamarin-android that referenced this pull request Sep 18, 2023
* main:
  LEGO: Merge pull request 8343
  [ci] Run more MSBuild tests on Linux (dotnet#8335)
  [Xamarin.Android.Build.Tasks] Improve aapt2 error messages for paths (dotnet#7710)
grendello added a commit to grendello/xamarin-android that referenced this pull request Sep 19, 2023
* main:
  Localized file check-in by OneLocBuild Task (dotnet#8350)
  [ci] Install signing plugin after building (dotnet#8346)
  Bump to dotnet/installer@e1fd7d9649 8.0.100-rc.2.23468.1 (dotnet#8330)
  Localized file check-in by OneLocBuild Task (dotnet#8341)
  LEGO: Merge pull request 8344
  LEGO: Merge pull request 8343
  [ci] Run more MSBuild tests on Linux (dotnet#8335)
  [Xamarin.Android.Build.Tasks] Improve aapt2 error messages for paths (dotnet#7710)
  Bump to dotnet/installer@a6b9030047 8.0.100-rc.2.23462.1 (dotnet#8327)
  Bump to dotnet/installer@476310d94a 8.0.100-rc.2.23456.6 (dotnet#8325)
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants