-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[bug] Inconsistent handling of app identifiers containing hyphens when building for Android #9707
Comments
Hi, I think it is related to this change tauri-apps/cargo-mobile2@29921ff, but I am really not sure as I don't have a deep knowledge of the way tauri works. |
@FabianLars It looks like you don't have the manpower to handle that. What would be your preferred solution?
|
I personally would lean towards the first option, but not sure. Let's ask @lucasfernog and @amrbashir |
I wonder how you manage to do so 😂 looks like we need even more changes to support |
I am good enough to break anything 😂 There was a few modifications required for my app in the I know it is not something very standard, so I am ready to help if you need. |
* feat(macros): allow Android domain parts to have underscores Ref tauri-apps/tauri#9707 * fill change file * no need to unescape package * Update .changes/android-package-underscores.md
Fix will be released soon. Note that you'll need to run |
Thanks a lot for the quick fix! |
I can confirm that the fix works with tauri-cli rc7. Thanks for your help! |
Describe the bug
Like most app development frameworks, Tauri uses reverse domain notation for the app identifiers.
Tauri only allows letters (
a-z
,A-Z
), digits (0-9
) and hyphens (-
) in app identifiers. However, Android only allows underscores (_
) in app identifiers, not hyphens; iOS, on the other hand, does allow hyphens, but no underscores.Right now, this means that running
cargo tauri android init
panics if the app identifier contains hyphens or alternatively only contains of two parts (I think the latter is unintended, anyway).To illustrate, let's assume I have an app identifier like
tech.almost-senseless.jack-point
. Trying to build this app for Android fails with a panic due to the hyphen inalmost-senseless
. Renaming it totech.almostsenseless.jack-point
ortech.almost-senseless
works fine, though: In the first case, the generated Android package name and identifier would betech.almostsenseless.jack_point
, and in the latter case it would betech.jack_point
.Evidently, the last part of the app identifier gets silently dropped and replaced with the product name, and in the product name, hyphens get replaced with underscores.
This has the side effect that running
cargo tauri android init
when the app identifier iscom.tauri.dev
works, by the way, because it becomescom.tauri.jack_point
- I think that's not intended that way, is it?So my problem boils down to that
Reproduction
cargo create-tauri-app --beta
. Please make sure mobile support was enabled.tauri.conf.json
and change the identifier tocom.some-domain.some-app
.cargo tauri android init
.Expected behavior
The command should complete successfully, generating an Android project with the identifier
com.some_domain.some_app
.Full
tauri info
outputAdditional context
No response
The text was updated successfully, but these errors were encountered: