oblador / react-native-vector-icons

Customizable Icons for React Native with support for image source and full styling.
https://oblador.github.io/react-native-vector-icons/
MIT License
17.31k stars 2.12k forks source link

Cannot use custom icons #1523

Open dusan-ivanco opened 11 months ago

dusan-ivanco commented 11 months ago

OS: macOS Ventura Platform: iOS 16 react-native: 0.72.3 expo: 49 (installed as module in bare react native app react-native-vector-icons: 10.0.0

Description

Until now, I have been using "Expo 45" and "React Native 0.68.2" in my application, and the use of a custom font was seamless. However, now I have tried to switch to "Expo 49" and "React Native 0.72.3" (clean install - not upgrade), but I am struggling with this error.

import {
  createIconSet
} from 'react-native-vector-icons';

const Icon = createIconSet(require('@/assets/fonts/Icon.json'), 'Icon', 'Icon.ttf');

export {
  Icon
};
Possible Unhandled Promise Rejection (id: 0):
Error: Unable to download file: Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo={NSErrorFailingURLStringKey=Icon.ttf, NSErrorFailingURLKey=Icon.ttf, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "BackgroundDownloadTask <383A311B-B683-46ED-B733-8808E73F3228>.<4>"
), _NSURLErrorFailingURLSessionTaskErrorKey=BackgroundDownloadTask <383A311B-B683-46ED-B733-8808E73F3228>.<4>, NSLocalizedDescription=unsupported URL}
Error: Unable to download file: Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo={NSErrorFailingURLStringKey=Icon.ttf, NSErrorFailingURLKey=Icon.ttf, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "BackgroundDownloadTask <383A311B-B683-46ED-B733-8808E73F3228>.<4>"
), _NSURLErrorFailingURLSessionTaskErrorKey=BackgroundDownloadTask <383A311B-B683-46ED-B733-8808E73F3228>.<4>, NSLocalizedDescription=unsupported URL}
    at construct (native)
    at apply (native)
    at _construct (http://10.1.1.1:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=sk.my.app:4478:28)
    at Wrapper (http://10.1.1.1:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=sk.my.app:4440:25)
    at construct (native)
    at _createSuperInternal (http://10.1.1.1:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=sk.my.app:167347:322)
    at call (native)
    at CodedError (http://10.1.1.1:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=sk.my.app:167360:26)

In Xcode, I have the font added in Resources and also in "Copy Bundle Resources". Just as an example, the "Montserrat font" that I use in react-native-paper works without any issues.

Snímka obrazovky 2023-07-17 o 19 50 06

Can you please help me?

dusan-ivanco commented 11 months ago

Sorry - my Info.plist

Snímka obrazovky 2023-07-17 o 19 59 05
mikehuebner commented 11 months ago

Also seeing this one

Possible Unhandled Promise Rejection (id: 13):
Error: Unable to download file: Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo={NSErrorFailingURLStringKey=remixicon.ttf, NSErrorFailingURLKey=remixicon.ttf, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "BackgroundDownloadTask <76AB4557-3D9F-4508-8452-CF9660A6F3D6>.<1>"
), _NSURLErrorFailingURLSessionTaskErrorKey=BackgroundDownloadTask <76AB4557-3D9F-4508-8452-CF9660A6F3D6>.<1>, NSLocalizedDescription=unsupported URL}
 WARN  Sending `onInstallConversionDataLoaded` with no listeners registered.
mikehuebner commented 11 months ago

I got a fix for this, will post shortly.

dpeek commented 11 months ago

Having the same problem, fix would be appreciated :)

matinzd commented 10 months ago

Just moved the project to use Expo. Works fine without an issue on bare but broken on Expo.

matinzd commented 10 months ago

Please follow this pull request for more info: https://github.com/expo/vector-icons/pull/267