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.

@dellis1972 dellis1972 force-pushed the WI1714603 branch 2 times, most recently from 43c1333 to fd4faf5 Compare February 21, 2023 15:36
@dellis1972 dellis1972 force-pushed the WI1714603 branch 3 times, most recently from fa74273 to 519d497 Compare March 1, 2023 11:07
@dellis1972 dellis1972 force-pushed the WI1714603 branch 3 times, most recently from 151a91d to 0ee0602 Compare March 10, 2023 09:51
@dellis1972 dellis1972 force-pushed the WI1714603 branch 2 times, most recently from a98eac2 to 1dcffb3 Compare March 15, 2023 13:10
@dellis1972 dellis1972 force-pushed the WI1714603 branch 2 times, most recently from c43c162 to e2396eb Compare March 20, 2023 14:19
@dellis1972 dellis1972 force-pushed the WI1714603 branch 2 times, most recently from 8b1f657 to b5d6f8f Compare May 19, 2023 11:53
@dellis1972 dellis1972 force-pushed the WI1714603 branch 3 times, most recently from 7d898d2 to e3cacb1 Compare June 30, 2023 06:42
@dellis1972 dellis1972 force-pushed the WI1714603 branch 3 times, most recently from a5ec2f1 to 0b53dc8 Compare August 10, 2023 14:15
@dellis1972 dellis1972 force-pushed the WI1714603 branch 4 times, most recently from 5aaff27 to f1c8765 Compare August 22, 2023 08:42
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. 👍

@dellis1972 dellis1972 requested a review from jonpryor September 8, 2023 15:24
… 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
@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