Я проверил каталоги Targe> Debug , и все были созданы файлы Fonts + Font. /> < /ul>
Однако при попытке получить доступ к файлу, используя следующий фрагмент кода переопределить ">let resource_path = app_handle
.path()
.resolve(format!("fonts/{}", name), BaseDirectory::Resource)
.expect("failed to resolve resource");
let mut file = File::open(&resource_path).expect(&format!("Failed to open font file {}", resource_path.as_path().to_str().unwrap()));
< /code>
10-19 16:22:58.189 19486 19600 I RustStdoutStderr: thread '' panicked at src\lib.rs:85:47:
10-19 16:22:58.189 19486 19600 I RustStdoutStderr: Failed to open font file asset://localhost/fonts/Calibri-Regular.ttf: Os { code: 2, kind: NotFound, message: "No such file or directory" }
< /code>
I tried the same code on windows and everything worked fine, android seems to handle resources differently, but I normally do not develop android applications, so I'm not sure how to approach this. Any help is appreciated
Подробнее здесь: https://stackoverflow.com/questions/791 ... on-android
Мобильная версия