2.0.1 • Published 1 year ago

expo-exotic-asset v2.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

npm version issues

expo-exotic-asset

Utilities for converting static local files into Expo Assets

ATTENTION If you are using Expo SDK from version 51, then this library does not need to be used. Issue has been fixed.

Why

Fixed in EXPO SDK 51.

I ran into a problem that the static textures in the expo-tree are not loaded in the release build on the android platform. This solution circumvents this issue.

A texture from a static asset file works fine in debug mode. But doesn't work in Android release mode.

Android debugAndroid release

Linked issues

Fixed in EXPO SDK 51.

Installation

npm install expo-exotic-asset
yarn add expo-exotic-asset

Usage

  • resolveExoticAsync returns a promise that resolves a expo Asset or null
const asset = await resolveExoticAsync(require('asset/img.png)); // Asset or null
  • resolveExoticPathAsync same as resolveExoticAsync but returns a promise that resolves file uri string or null
const uri = await resolveExoticPathAsync(require('asset/img.png)); // string or null

Contributing

Contributions are very welcome!

Thanks for contributions!

License

ISC LICENSE

2.0.1

1 year ago

2.0.0

1 year ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago