Giter Site home page Giter Site logo

Comments (5)

amrbashir avatar amrbashir commented on August 30, 2024

Looking at the error, it is related to permissions and specifically shell:allow-open which is included by default in the create-tauri-app template. It may not be able to find the permissions either because you removed tauri-plugin-shell from Cargo.toml or maybe you need to add patch for tauri-plugin crate as well so try adding the following in Cargo.toml then run cargo update inside src-tauri:

[patch.crates-io]
tauri-plugin = { path = "path/to/local/tauri/core/tauri-plugin" }

from tauri.

stijnfrishert avatar stijnfrishert commented on August 30, 2024

Thanks, @amrbashir! I did remove tauri-plugin-shell, because I had version mismatches. I tried re-adding it as well as the taur-plugin redirect, but that doesn't seem to be enough. Here are my dependencies:

[build-dependencies]
# tauri-build = {version = "2.0.0-beta", features = []}
tauri-build = {path = "/Users/stijn/Development/tauri/core/tauri-build", features = []}

[dependencies]
serde = {version = "1", features = ["derive"]}
serde_json = "1"
# tauri = { version = "2.0.0-beta", features = [] }
tauri = {path = "/Users/stijn/Development/tauri/core/tauri", features = []}
tauri-plugin-shell = "2.0.0-beta"

[patch.crates-io]
tauri-plugin = {path = "/Users/stijn/Development/tauri/core/tauri-plugin"}

Running cargo update I still get a mismatch on versions. Do I need to reroute tauri-plugin-shell to my local copy as well? Because I can't find that package in the repo.

stijn@Leviathan ~/D/t/src-tauri [101]> cargo update
    Blocking waiting for file lock on package cache
    Updating crates.io index
error: failed to select a version for `tauri`.
    ... required by package `tauri-plugin-shell v2.0.0-beta.0`
    ... which satisfies dependency `tauri-plugin-shell = "^2.0.0-beta"` of package `tauri-test v0.0.0 (/Users/stijn/Desktop/tauri-test/src-tauri)`
versions that meet the requirements `^2.0.0-beta.1` are: 2.0.0-beta.22, 2.0.0-beta.21, 2.0.0-beta.20, 2.0.0-beta.19, 2.0.0-beta.18, 2.0.0-beta.17, 2.0.0-beta.16, 2.0.0-beta.15, 2.0.0-beta.14, 2.0.0-beta.13, 2.0.0-beta.12, 2.0.0-beta.11, 2.0.0-beta.10, 2.0.0-beta.9, 2.0.0-beta.8, 2.0.0-beta.7, 2.0.0-beta.6, 2.0.0-beta.5, 2.0.0-beta.4, 2.0.0-beta.3, 2.0.0-beta.2, 2.0.0-beta.1

the package `tauri` links to the native library `Tauri`, but it conflicts with a previous package which links to `Tauri` as well:
package `tauri v2.0.0-beta.22 (/Users/stijn/Development/tauri/core/tauri)`
    ... which satisfies path dependency `tauri` of package `tauri-test v0.0.0 (/Users/stijn/Desktop/tauri-test/src-tauri)`
Only one package in the dependency graph may specify the same links value. This helps ensure that only one copy of a native library is linked in the final binary. Try to adjust your dependencies so that only one package uses the `links = "Tauri"` value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.

failed to select a version for `tauri` which could resolve this conflict

from tauri.

pewsheen avatar pewsheen commented on August 30, 2024

tauri-plugin-shell also depends on tauri-plugin, but you have it points to another place in the Cargo.toml

You'll need to clone https://github.com/tauri-apps/plugins-workspace and modify the Cargo.toml:

[workspace.dependencies]
tauri-plugin = { path = "/Users/stijn/Development/tauri/core/tauri-plugin" }

and also in your projcet's Cargo.toml

[dependencies]
tauri-plugin-shell = { path = "[path to plugin-workspace]/plugins-workspace/plugins/shell" }

from tauri.

amrbashir avatar amrbashir commented on August 30, 2024

you can just remove tauri-plugin-shell, I was just demonstrating a fix for version mismatch if you want to use tauri-plugin-shell.

Anyways, the problem in your original post is that your capability file has shell:allow-open permission and since you removed tauri-plugin-shell, you will need to remove that permission as well

from tauri.

stijnfrishert avatar stijnfrishert commented on August 30, 2024

Yes! I got it working and the app runs on my phone now with a locally sourced Tauri. :)

Thank you both for your patience. πŸ™ Hope to continue the work on my PR now.

from tauri.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.