Skip to content

Commit 228e5a4

Browse files
authored
fix(cli): icons not added to the Android project (#7902)
1 parent deea943 commit 228e5a4

File tree

2 files changed

+11
-21
lines changed

2 files changed

+11
-21
lines changed

.changes/fix-icons-android.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@tauri-apps/cli": patch:bug
3+
"tauri-cli": patch:bug
4+
---
5+
6+
Fixes `icon` command not writing files to the correct Android project folders.

tooling/cli/src/icon.rs

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0
33
// SPDX-License-Identifier: MIT
44

5-
use crate::{
6-
helpers::{app_paths::tauri_dir, config::get as get_tauri_config},
7-
Result,
8-
};
5+
use crate::{helpers::app_paths::tauri_dir, Result};
96

107
use std::{
118
collections::HashMap,
@@ -27,7 +24,6 @@ use image::{
2724
open, ColorType, DynamicImage, ImageBuffer, ImageEncoder, Rgba,
2825
};
2926
use serde::Deserialize;
30-
use tauri_utils::platform::Target;
3127

3228
#[derive(Debug, Deserialize)]
3329
struct IcnsEntry {
@@ -361,22 +357,10 @@ fn png(source: &DynamicImage, out_dir: &Path, ios_color: Rgba<u8>) -> Result<()>
361357

362358
let mut entries = desktop_entries(out_dir);
363359

364-
// Android
365-
let (config, _metadata) = {
366-
let tauri_config = get_tauri_config(Target::current(), None)?;
367-
368-
let tauri_config_guard = tauri_config.lock().unwrap();
369-
let tauri_config_ = tauri_config_guard.as_ref().unwrap();
370-
crate::mobile::android::get_config(
371-
&crate::mobile::get_app(tauri_config_),
372-
tauri_config_,
373-
&Default::default(),
374-
)
375-
};
376-
let android_out = out_dir.parent().unwrap().join(format!(
377-
"gen/android/{}/app/src/main/res/",
378-
config.app().name_snake()
379-
));
360+
let android_out = out_dir
361+
.parent()
362+
.unwrap()
363+
.join("gen/android/app/src/main/res/");
380364
let out = if android_out.exists() {
381365
android_out
382366
} else {

0 commit comments

Comments
 (0)