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

[bug] plugin command failing for mobile plugins #10082

Closed
FabianLars opened this issue Jun 18, 2024 · 3 comments · Fixed by #10128
Closed

[bug] plugin command failing for mobile plugins #10082

FabianLars opened this issue Jun 18, 2024 · 3 comments · Fixed by #10128
Assignees
Labels
scope: cli.js The @tauri-apps/cli npm package scope: cli.rs The tauri-cli rust crate status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@FabianLars
Copy link
Member

FabianLars commented Jun 18, 2024

Describe the bug

Mainly reporting this because i have no time to look into it right now.

plugin new --mobile (partially) fails with failed to render plugin Android template: No such file or directory - i don't see which file it's talking about.
plugin new --ios also fails(?) or at least complains about the Android template.
plugin new - so no mobile - still creates most mobile code, just without the ios and android folders, i get the idea behind it but it looks like it can cause issues.

Edit: The iOS folder is always empty even if i just use the --ios flag (because of it failing on the android template i assume).

Reproduction

No response

Expected behavior

No response

Full tauri info output

I'm not inside a tauri project but i'm on latest macos with the latest tauri cli, tried both the released version and from git after Tillmann told me that there were recent changes.

Stack trace

No response

Additional context

I assigned Amr for now (blame Tillmann lol) but i think i can take a look next week or the week after too.

@FabianLars FabianLars added type: bug scope: cli.js The @tauri-apps/cli npm package scope: cli.rs The tauri-cli rust crate status: needs triage This issue needs to triage, applied to new issues labels Jun 18, 2024
@pyranota
Copy link

Have the same problem

1 similar comment
@songjiachao
Copy link

Have the same problem

@amrbashir
Copy link
Member

looks like an issue with iOS template as plugin new --android works just fine, will open a PR to fix this.

amrbashir added a commit that referenced this issue Jun 26, 2024
…of `PathBuf::join`

fixes #10082

The problem that we were calling `PathBuf::join()` with value of collecting an empty iterator of path components which was equivalent to `PathBuf::from("ios").join("")` which will result in `ios/` with a trailing slash.

This is fixed by chaining iterators of path components and collecting only once into `PathBuf`, which will never append empy path component and will never append trailing slash.
```rs
              [
                Component::Normal(OsStr::new("ios")),
              ]
              .into_iter()
              .chain(other_components_iterator)
              .collect::<PathBuf>()
```
amrbashir added a commit that referenced this issue Jun 26, 2024
…of `PathBuf::join`

fixes #10082

The problem that we were calling `PathBuf::join()` with value of collecting an empty iterator of path components which was equivalent to `PathBuf::from("ios").join("")` which will result in `ios/` with a trailing slash.

This is fixed by chaining iterators of path components and collecting only once into `PathBuf`, which will never append empy path component and will never append trailing slash.
```rs
[
  Component::Normal(OsStr::new("ios")),
  Component::Normal(&some_folder_name),
]
.into_iter()
.chain(other_components_iterator)
.collect::<PathBuf>()
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: cli.js The @tauri-apps/cli npm package scope: cli.rs The tauri-cli rust crate status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
4 participants