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][v2][macos] Can't build Android - vanilla install #10065

Closed
oddpxl opened this issue Jun 15, 2024 · 2 comments
Closed

[bug][v2][macos] Can't build Android - vanilla install #10065

oddpxl opened this issue Jun 15, 2024 · 2 comments
Labels
platform: Android status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@oddpxl
Copy link

oddpxl commented Jun 15, 2024

Describe the bug

1 - Clean install
2 - Changing tauri.conf.json identifier --> ""identifier": "com.myname.dev"
3 - Deleting gen/android folder and running "tauri android init"
4 - pnpm tauri android build

Error Project directory .../tauri-app/src-tauri/gen/android/app/src/main/java/com/myname/dev does not exist. Did you update the package name in `Cargo.toml` or the bundle identifier in `tauri.conf.json > identifier`? Save your changes, delete the `gen/android` folder and run `tauri android init` to recreate the Android project.
 ELIFECYCLE  Command failed with exit code 1.

Reproduction

1 - Clean install --> pnpm create tauri-app --beta
2 - Name tauri-app / TypeScript / JavaScript / pnpm / Solid / Typescript / Mobile YES
3 - cd tauri-app - pnpm install - pnpm tauri android init
4 - Change tauri.conf.json identifier
5 - Delete gen/android folder and run "tauri android init"
6 - pnpm tauri android build

Expected behavior

It would build as usual.

Full tauri info output

[✔] Environment
    - OS: Mac OS 14.4.1 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.79.0 (129f3b996 2024-06-10)
    ✔ cargo: 1.79.0 (ffa9cf99a 2024-06-03)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 21.7.1
    - pnpm: 8.15.5
    - npm: 10.5.1

[-] Packages
    - tauri [RUST]: 2.0.0-beta.22
    - tauri-build [RUST]: 2.0.0-beta.17
    - wry [RUST]: 0.40.1
    - tao [RUST]: 0.28.1
    - tauri-cli [RUST]: 1.5.11
    - @tauri-apps/api : not installed!
    - @tauri-apps/cli [NPM]: 2.0.0-beta.20

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: https://localhost:1420/
    - framework: SolidJS
    - bundler: Vite

Stack trace

No response

Additional context

No response

@oddpxl oddpxl added status: needs triage This issue needs to triage, applied to new issues type: bug labels Jun 15, 2024
@oddpxl oddpxl changed the title [bug] Can't build Android - vanilla install [bug][v2][macos] Can't build Android - vanilla install Jun 16, 2024
@pewsheen
Copy link
Contributor

Could you try running pnpm tauri android init instead of tauri android init in step 5?

@oddpxl
Copy link
Author

oddpxl commented Jun 24, 2024

Alright so here we go...

1 - clean install
2 - Changing tauri.conf.json identifier --> ""identifier": "com.myname.dev"
3 - pnpm tauri android build

Error Project directory /tauri-app/src-tauri/gen/android/app/src/main/java/com/myname/dev does not exist. Did you update the package name inCargo.tomlor the bundle identifier intauri.conf.json > identifier? Save your changes, delete the gen/androidfolder and runtauri android init to recreate the Android project.  ELIFECYCLE  Command failed with exit code 1.

( This is where I got confused by the instructions - previously I didn't add "pnpm" )

4 - Delete gen/android folder
6 - pnpm tauri android init
5 - pnpm tauri android build

You must change the versionintauri.conf.json. The default value 0.0.0 is not allowed for Android package and must be at least 0.0.1.

6 - Changed version to 0.0.1
7 - pnpm tauri android build

WORKS !

Thanks for helping out - much appreciated - not sure why I stumbled on this but hey... ..learning !!

@oddpxl oddpxl closed this as completed Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: Android status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

3 participants