-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Template option '--applicationId' doesn't work in standard maui template #13297
Comments
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
This issue seems to be caused by the fact that the template's A simple solution would be to change the AppIdentifier to a string that's not the sourceName, but I'll investigate further if we can add conditionals such that the |
@rolfbjarne @mauroa @emaf @tondat if we removed the @jonathanpeppers @dellis1972 same question for anything android? |
I think they have to be unique ids on the Apple App Store. So, if you just did "helloworld", it's likely going to be taken by someone else already. Android, it actually might not matter? @dellis1972 do you know? |
The package name/app id MUST be a uri on android in the form of xxx.xxxx.xxx otherwise it won't work. |
Ok yeah, the package name is unique on Google Play, too: https://play.google.com/store/apps/details?id=com.nvsgames.snap So if someone just named their app "snap" it might be taken. |
@phenning @sayedihashimi is there any sort of validation / cleansing of parameter input we are able to do with templates? Ideally we could restrict the value to some lowercase, alphanumeric (plus . and maybe hyphen? i forget) value, so basically a regex pattern, and give an appropriate error message when running dotnet new to ensure the template is inflated with a valid value. |
Also adding @baronfel for the template question above. |
Unfortunately we don't, though I agree this would be a pretty necessary ability. The tracking issue is dotnet/templating#2038, we may end up needing it for the interactive prompting work so I'll see if we can slot it in. You can specify regex-based transforms, but I'm not sure that those would be able to solve your validation need in the current state. |
I think we would also want to do the validation at multiple layers. It would be useful if the core engine would do the validation but also be able to expose the validation rule and the error message so that hosts could pre-validate before passing the parameter to the core engine. I’ll add this comment to the other issue |
@Redth I think the main focus should be the suffix of the AppId, and not the My suggested solution is to change the template such that all maui apps are created with the applicationId It seems we can't do much validation from the templating side if the user specifies an invalid AppID, but I believe we could do something from the SDK side. For example, we could prevent a build if the AppID is not in the desired format. This would also guard against situations where the user manually edits the cproj and changes the AppID to be something invalid. |
Here's the documentation for You don't need to follow the If you are publishing to the App Store, then you must choose a CFBundleIdentifier for your app in the App Store Connect site, and I believe the site enforces the |
Description
When I create my maui app from cli via command
dotnet new maui -n TestApp -ap com.my.app
it has wrong application id.It should be 'com.my.app' but it is
com.companyname.testapp
.Steps to Reproduce
dotnet new maui -n TestApp -ap com.my.app
TestApp/TestApp.csproj
fileTag
ApplicationId
has valuecom.companyname.testapp
but should becom.my.app
.Link to public reproduction project repository
not required
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS, Android, I was not able test on other platforms
Affected platform versions
all
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: