Giter Site home page Giter Site logo

mrousavy / react-native-blurhash Goto Github PK

View Code? Open in Web Editor NEW
1.9K 8.0 67.0 5.25 MB

๐Ÿ–ผ๏ธ A library to show colorful blurry placeholders while your content loads.

Home Page: https://blurha.sh

License: MIT License

Java 8.86% JavaScript 3.62% Ruby 3.37% Objective-C 3.92% Swift 26.60% Kotlin 32.13% TypeScript 14.68% Objective-C++ 6.83%
blurhash react-native swift kotlin component native-module typescript node javascript library

react-native-blurhash's Introduction

This library helped you? Consider sponsoring!

Blurhash

๐Ÿ–ผ๏ธ Give your users the loading experience they want.

Install via npm:

npm i react-native-blurhash
npx pod-install

npm npm

GitHub followers Twitter Follow

BlurHash is a compact representation of a placeholder for an image. Instead of displaying boring grey little boxes while your image loads, show a blurred preview until the full image has been loaded.

The algorithm was created by woltapp/blurhash, which also includes an algorithm explanation.

Turn grey image boxes into colorful blurred images

Expo

Example Workflow

    In order to use the Blurhash component, you have to already have a Blurhash string. See the blurha.sh page to create example strings.

    This is how I use it in my project:

  1. A user creates a post by calling a function on my server which expects a payload of an image and some post data (title, description, ...)
  2. The function on my server then
    1. generates a blurhash from the image in the payload using the C encoder
    2. stores the post data (including the generated blurhash string) in my database
    3. uploads the image to a content delivery network (e.g. AWS)
  3. Now everytime a user loads a feed of posts from my database, I can immediately show a <Blurhash> component (with the post's .blurhash property) over my <Image> component, and fade it out once the <Image> component's onLoadEnd function has been called.

  4. Note: You can also use the react-native-blurhash encoder to encode straight from your React Native App!

Usage

The <Blurhash> component has the following properties:

Name Type Explanation Required Default Value
blurhash string The blurhash string to use. Example: LGFFaXYk^6#M@-5c,1J5@[or[Q6. โœ… undefined
decodeWidth number The width (resolution) to decode to. Higher values decrease performance, use 16 for large lists, otherwise you can increase it to 32.
See: performance
โŒ 32
decodeHeight number The height (resolution) to decode to. Higher values decrease performance, use 16 for large lists, otherwise you can increase it to 32.
See: performance
โŒ 32
decodePunch number Adjusts the contrast of the output image. Tweak it if you want a different look for your placeholders. โŒ 1.0
decodeAsync boolean Asynchronously decode the Blurhash on a background Thread instead of the UI-Thread.
See: Asynchronous Decoding
โŒ false
resizeMode 'cover' | 'contain' | 'stretch' | 'center' Sets the resize mode of the image. (no, 'repeat' is not supported.)
See: Image::resizeMode
โŒ 'cover'
onLoadStart () => void A callback to call when the Blurhash started to decode the given blurhash string. โŒ undefined
onLoadEnd () => void A callback to call when the Blurhash successfully decoded the given blurhash string and rendered the image to the <Blurhash> view. โŒ undefined
onLoadError (message?: string) => void A callback to call when the Blurhash failed to load. Use the message parameter to get the error message. โŒ undefined
All View props ViewProps All properties from the React Native View. Use style.width and style.height for display-sizes. Also, style.borderRadius is natively supported on iOS. โŒ {}

Example Usage:

import { Blurhash } from 'react-native-blurhash';

export default function App() {
  return (
    <Blurhash
      blurhash="LGFFaXYk^6#M@-5c,1J5@[or[Q6."
      style={{flex: 1}}
    />
  );
}

See the example App for a full code example.

iOS Screenshot Android Screenshot
iOS Demo Screenshot Android Demo Screenshot

Average Color

If your app is really colorful you might want to match some containers' colors to the content's context. To achieve this, use the getAverageColor function to get an RGB value which represents the average color of the given Blurhash:

const averageColor = Blurhash.getAverageColor('LGFFaXYk^6#M@-5c,1J5@[or[Q6.')

Encoding

This library also includes a native Image encoder, so you can encode Images to blurhashes straight out of your React Native App!

const blurhash = await Blurhash.encode('https://blurha.sh/assets/images/img2.jpg', 4, 3)

Because encoding an Image is a pretty heavy task, this function is non-blocking and runs on a separate background Thread.

Validation

If you need to validate a blurhash string, you can use isValidBlurhash.

const result = Blurhash.isValidBlurhash('LGFFaXYk^6#M@-5c,1J5@[or[Q6.')
if (result.isValid) {
  console.log(`Blurhash is valid!`)
} else {
  console.log(`Blurhash is invalid! ${result.reason}`)
}

Performance

The performance of the decoders is really fast, which means you should be able to use them in collections quite easily. By increasing the decodeWidth and decodeHeight props, the time to decode also increases. I'd recommend values of 16 for large lists, and 32 otherwise. Play around with the values but keep in mind that you probably won't see a difference when increasing it to anything above 32.

Asynchronous Decoding

Use decodeAsync={true} to decode the Blurhash on a separate background Thread instead of the main UI-Thread. This is useful when you are experiencing stutters because of the Blurhash's decoder - e.g.: in large Lists.

Threads are re-used (iOS: DispatchQueue, Android: kotlinx Coroutines).

Caching

Image

A <Blurhash> component caches the rendered Blurhash (Image) as long as the blurhash, decodeWidth, decodeHeight and decodePunch properties stay the same. Because unmounting the <Blurhash> component clears the cache, re-mounting it will cause it to decode again.

Cosine Operations

Cosine operations get cached in memory to avoid expensive re-calculation (~24.576 cos(...) calls per 32x32 blurhash). Since this can affect memory usage, you can manually clear the cosine array cache by calling:

Blurhash.clearCosineCache()

Note: At the moment, cosine operations are only cached on Android. Calling clearCosineCache() is a no-op on other platforms.

Resources

Buy Me a Coffee at ko-fi.com

react-native-blurhash's People

Contributors

amochkin avatar brentvatne avatar danilobuerger avatar dependabot-preview[bot] avatar ericlifs avatar focux avatar iamclaytonray avatar imgbotapp avatar janicduplessis avatar johennes avatar ldabiralai avatar mrousavy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-blurhash's Issues

[BUG] Can't build iOS

Bug

Get a Fastlane exception when creating a development build on EXPO - 'react_native_blurhash-Swift.h' file not found

To Reproduce
Steps to reproduce the behavior:

  1. Add package to project
  2. Try to build using EAS build

Expected behavior
I expect the build to succeed. Android build is successful.

Are we gonna have support for Expo Go?

Question

Regarding this issue: #124, are we gonna have that Expo GO support any time soon?
Creating a Custom Expo Go app is not in my plans currently, but I would really like to have something like this in my app.

Is it just a matter of waiting for a couple of new Expo releases? Or we are planing to have it there?

I understand that this question may be more accurate to be asked in Expo project, but first I want to check here if anybody has any information about it.

Expose the encoder

Especially in an e2ee setting it would be necessary to generate the blur hash client side.

[QUESTION] Android rendering issues

Question

Android rendering issues
48f25f43fd61e8dc850e64d2a91c201c

Environment

paste the output of `react-native info` here
"react": 18.2.0,
"react-native": 0.74.1,
"react-native-blurhash": ^2.0.2

[QUESTION] Example with fade

Question

Hi Marc !
Please can you provide a small snipset with a component over an component, and fade it out once the component's onLoadEnd function ?

Thanks a lot :)

Kotlin compile error

I'm getting this compile error since updating to the latest version (93bebfb), this seems to be caused by some conflicting dependencies.

Downgrading androidx.lifecycle:lifecycle-runtime-ktx:2.4.0 to androidx.lifecycle:lifecycle-runtime-ktx:2.3.0 fixes the issue.

e: Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors
e: /Users/janicduplessis/.gradle/caches/transforms-3/6170f1aa6baa6f7a1bbe656d8cc7a782/transformed/jetified-kotlin-stdlib-common-1.5.30.jar!/META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
e: /Users/janicduplessis/.gradle/caches/transforms-3/69132005b2cfdc63028375e869e9bf9c/transformed/jetified-lifecycle-runtime-ktx-2.4.0-api.jar!/META-INF/lifecycle-runtime-ktx_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
e: /Users/janicduplessis/.gradle/caches/transforms-3/88b82883192d0eb7b9b43ace530be3ca/transformed/jetified-kotlin-stdlib-jdk7-1.5.0.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
e: /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
e: /Users/janicduplessis/.gradle/caches/transforms-3/afc7956cdc68ef0b7c11883cbf3b36f8/transformed/jetified-kotlinx-coroutines-android-1.5.0.jar!/META-INF/kotlinx-coroutines-android.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
e: /Users/janicduplessis/.gradle/caches/transforms-3/eadfaedb2175eeb8b6ff6d00517ed1e4/transformed/jetified-kotlin-stdlib-jdk8-1.5.0.jar!/META-INF/kotlin-stdlib-jdk8.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
e: /Users/janicduplessis/.gradle/caches/transforms-3/f82f3a9b69ba7ba7b70122e0982067d9/transformed/jetified-kotlinx-coroutines-core-jvm-1.5.0.jar!/META-INF/kotlinx-coroutines-core.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/Base83.kt: (5, 28): Unresolved reference: listOf
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/Base83.kt: (12, 27): Cannot infer a type for this parameter. Please specify it explicitly.
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/Base83.kt: (12, 30): Cannot infer a type for this parameter. Please specify it explicitly.
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/Base83.kt: (15, 29): Unresolved reference: listOf
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/Base83.kt: (29, 13): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/Base83.kt: (37, 24): Unresolved reference: until
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashDecoder.kt: (9, 20): Unresolved reference: cos
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashDecoder.kt: (27, 23): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashDecoder.kt: (28, 23): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashDecoder.kt: (93, 21): Unresolved reference: until
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashDecoder.kt: (94, 25): Unresolved reference: until
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashDecoder.kt: (98, 29): Unresolved reference: until
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashDecoder.kt: (99, 33): Unresolved reference: until
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashDecoder.kt: (109, 17): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashDecoder.kt: (117, 44): Unresolved reference: also
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashDecoder.kt: (118, 31): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashDecoder.kt: (118, 54): Unresolved reference: it
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashDecoder.kt: (128, 43): Unresolved reference: also
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashDecoder.kt: (129, 31): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashDecoder.kt: (129, 53): Unresolved reference: it
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashDecoder.kt: (143, 13): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashDecoder.kt: (143, 37): Unresolved reference: cos
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (16, 21): Unresolved reference: until
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (16, 46): Unresolved reference: until
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (17, 42): Unresolved reference: cos
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (17, 46): Unresolved reference: PI
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (18, 21): Unresolved reference: cos
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (18, 25): Unresolved reference: PI
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (25, 9): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (26, 9): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (27, 9): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (38, 22): Unresolved reference: floor
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (38, 28): Unresolved reference: max
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (39, 17): Unresolved reference: min
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (39, 26): Unresolved reference: floor
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (40, 22): Unresolved reference: floor
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (40, 28): Unresolved reference: max
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (41, 17): Unresolved reference: min
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (41, 26): Unresolved reference: floor
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (42, 22): Unresolved reference: floor
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (42, 28): Unresolved reference: max
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (43, 17): Unresolved reference: min
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (43, 26): Unresolved reference: floor
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (44, 16): Unresolved reference: round
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (59, 16): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (75, 9): Unresolved reference: require
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (76, 9): Unresolved reference: require
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (78, 21): Unresolved reference: until
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (79, 25): Unresolved reference: until
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (81, 17): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (87, 16): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (89, 9): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (91, 41): Unresolved reference: floor
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (92, 21): Unresolved reference: max
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (92, 29): Unresolved reference: min
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (92, 38): Unresolved reference: floor
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (94, 20): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (94, 29): Unresolved reference: round
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (97, 20): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (100, 16): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (101, 21): Unresolved reference: until
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (102, 20): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashEncoder.kt: (104, 23): Too many arguments for public constructor String() defined in kotlin.String
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashImageView.kt: (9, 27): Class 'kotlinx.coroutines.GlobalScope' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/f82f3a9b69ba7ba7b70122e0982067d9/transformed/jetified-kotlinx-coroutines-core-jvm-1.5.0.jar!/kotlinx/coroutines/GlobalScope.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashImageView.kt: (10, 27): Unresolved reference: launch
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashImageView.kt: (56, 13): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashImageView.kt: (69, 13): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashImageView.kt: (73, 13): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashImageView.kt: (74, 13): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashImageView.kt: (76, 13): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashImageView.kt: (77, 13): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashImageView.kt: (84, 13): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashImageView.kt: (85, 17): Class 'kotlinx.coroutines.GlobalScope' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/f82f3a9b69ba7ba7b70122e0982067d9/transformed/jetified-kotlinx-coroutines-core-jvm-1.5.0.jar!/kotlinx/coroutines/GlobalScope.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashImageView.kt: (85, 29): Unresolved reference: launch
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashImageView.kt: (86, 21): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashImageView.kt: (89, 17): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashImageView.kt: (95, 9): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashImageView.kt: (105, 13): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashImageView.kt: (111, 57): Unresolved reference: java
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashImageView.kt: (116, 57): Unresolved reference: java
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashImageView.kt: (121, 15): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashImageView.kt: (123, 57): Unresolved reference: java
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashPackage.kt: (11, 16): Unresolved reference: listOf
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashPackage.kt: (16, 16): Unresolved reference: emptyList
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashPackage.kt: (20, 16): Unresolved reference: listOf
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewManager.kt: (17, 14): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewManager.kt: (22, 14): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewManager.kt: (27, 14): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewManager.kt: (32, 14): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewManager.kt: (37, 14): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewManager.kt: (42, 14): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewManager.kt: (43, 14): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewManager.kt: (47, 15): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewManager.kt: (48, 14): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewManager.kt: (54, 19): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewManager.kt: (56, 15): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewModule.kt: (15, 26): Unresolved reference: thread
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewModule.kt: (29, 9): Unresolved reference: thread
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewModule.kt: (31, 25): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewModule.kt: (35, 45): Unresolved reference: trim
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewModule.kt: (42, 28): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewModule.kt: (45, 29): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewModule.kt: (52, 41): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewModule.kt: (54, 33): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewModule.kt: (55, 45): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewModule.kt: (57, 45): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewModule.kt: (67, 29): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewModule.kt: (68, 41): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewModule.kt: (70, 41): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewModule.kt: (78, 25): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewModule.kt: (85, 25): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewModule.kt: (91, 25): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/Unit.class
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/Utils.kt: (3, 20): Unresolved reference: abs
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/Utils.kt: (4, 20): Unresolved reference: pow
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/Utils.kt: (5, 20): Unresolved reference: withSign
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/Utils.kt: (10, 23): Unresolved reference: coerceIn
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/Utils.kt: (23, 37): Unresolved reference: pow
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/Utils.kt: (27, 51): Unresolved reference: pow
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/Utils.kt: (29, 56): Unresolved reference: abs
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/Utils.kt: (33, 24): Unresolved reference: until
e: /Users/janicduplessis/Developer/th3rdwave/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/Utils.kt: (34, 27): Class 'kotlin.collections.FloatIterator' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/janicduplessis/.gradle/caches/transforms-3/afa57ccc7aa7b4da7fcd76ca461b3a39/transformed/jetified-kotlin-stdlib-1.5.30.jar!/kotlin/collections/FloatIterator.class

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':rn-modules:react-native-blurhash:compileDebugKotlin'.
> Compilation error. See log for more details

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 10s

[BUG] Type mismatch between reported and actual type of Blurhash Component

Bug

The types for Blurhash report that it is a class component.

The actual exported component is a functional one.

My IDE reports that Blurhash is a class component and I was very confused why I was getting runtime errors reporting that I couldn't use a functional component.

Environment

Additional context
Add any other context or screenshots about the feature request here.

"react": 16.13.1
"react-native": 0.63.2,
"react-native-blurhash": 1.0.28

[BUG] Error when running `npm run android`

Bug

Describe the bug
The build of the package fails

To Reproduce

  • install the package (npm install react-native-blurhash)
  • Run the app (npm run android)

Expected behavior
The build shouldn't fail.

Screenshots
image

(Optional) Proposed solution
In package.json you should have repository: {baseUrl: "something"}. Or you should check your build.gradle at line 97 to use packageJson.repository instead of packageJson.repositry.baseUrl

Environment

Additional context

System:
    OS: Linux 4.19 Debian GNU/Linux 10 (buster) 10 (buster)
    CPU: (8) x64 Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
    Memory: 250.46 MB / 15.36 GB
    Shell: 5.0.3 - /bin/bash
  Binaries:
    Node: 14.15.4 - /usr/bin/node
    Yarn: Not Found
    npm: 6.14.10 - /usr/bin/npm
    Watchman: Not Found
  SDKs:
    Android SDK:
      API Levels: 23, 26, 28, 29
      Build Tools: 19.1.0, 20.0.0, 21.1.2, 22.0.1, 23.0.1, 28.0.3, 29.0.2, 30.0.2
      System Images: android-26 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom, android-30 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: Not Found
  Languages:
    Java: 11.0.9.1 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.4 => 0.63.4 
  npmGlobalPackages:
    *react-native*: Not Found
"react": 16.13.1,
"react-native": 0.63.4,
"react-native-blurhash": ^1.1.3

How to use react-native-blurhash to show image loading progress?

How to use react-native-blurhash to show image loading progress? I am trying to show users' image progress with blur colors according to the image how can i use that to do that? like when the image is fetching and then loading it displays a blurred image How can I do this? For example, there is an image in the image there is a sun a tree, and a river flowing so instead of manually adding yellow color for the sun green color for the tree, and blue color for the river how can I do something like it displays blur yellow color green color blue color the color is based on the image data How to do this I am trying to do this can you help me to do that? I tried to use a package called react-native-blurhash But I can't able to use it properly how can I use this according to my need

import React, { useState, useMemo } from 'react';
import { View, ActivityIndicator } from 'react-native';
import FastImage from 'react-native-fast-image';
import { Blurhash } from 'react-native-blurhash';

const News = ({ picture }) => {
  const [isLoading, setIsLoading] = useState(true);
  const [blurhash, setBlurhash] = useState('');

  useMemo(async () => {
    const imageBitmap = await fetch(picture).then((response) => response.blob());
    const blurhash = await Blurhash.encode(imageBitmap, 4, 3);
    setBlurhash(blurhash);
  }, [picture]);

  const source = useMemo(() => ({ uri: picture }), [picture]);

  return (
    <View style={styles.container}>
      <View style={styles.imageContainer}>
        {blurhash ? (
          <Blurhash
            blurhash={blurhash}
            style={styles.image}
          />
        ) : null}
        <FastImage
          source={source}
          style={[styles.image, { opacity: isLoading ? 0 : 1 }]}
          priority={FastImage.priority.high}
          onLoadEnd={() => setIsLoading(false)}
        />
        {isLoading && <ActivityIndicator style={styles.spinner} />}
      </View>
    </View>
  );
};

export default News;

[BUG]encoding performance

Bug

Describe the bug
Encode image hangs forever. (more than 10 minutes)
65002079883__EF07E735-C2CD-4F2D-AAE6-039A86ED0917.HEIC.zip

To Reproduce
Try to encode a image taken by camera

Expected behavior
It should return within reasonable amount of time

Screenshots
image

Environment

Additional context
iOS
Xcode 12
iPhone XS Max

info Fetching system and libraries information...
System:
    OS: macOS 12.0
    CPU: (20) x64 Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz
    Memory: 23.71 GB / 64.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.5.0 - /var/folders/v4/8jyh3pp92x58b6gkspmqv7z00000gn/T/yarn--1628488191469-0.9396605774893039/node
    Yarn: 1.22.10 - /var/folders/v4/8jyh3pp92x58b6gkspmqv7z00000gn/T/yarn--1628488191469-0.9396605774893039/yarn
    npm: 7.19.1 - /usr/local/bin/npm
    Watchman: 2021.06.07.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.2 - /usr/local/lib/ruby/gems/3.0.0/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
    Android SDK: Not Found
  IDEs:
    Android Studio: 2020.3 AI-203.7717.56.2031.7583922
    Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild
  Languages:
    Java: 15.0.2 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2
    react-native: 0.64.1 => 0.64.1
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
โœจ  Done in 2.83s.
"react": 17,
"react-native": 0.64,
"react-native-blurhash": ^1.1.4

[BUG] crash on android

Bug

Crashes tracked from Google Play Store

Crashlog

java.lang.NullPointerException: 
  at android.view.View.requestLayout (View.java:25588)
  at android.widget.ImageView.setImageDrawable (ImageView.java:605)
  at androidx.appcompat.widget.AppCompatImageView.setImageDrawable (AppCompatImageView.java:104)
  at android.widget.ImageView.setImageBitmap (ImageView.java:769)
  at androidx.appcompat.widget.AppCompatImageView.setImageBitmap (AppCompatImageView.java:112)
  at com.mrousavy.blurhash.BlurhashImageView.renderBlurhash (BlurhashImageView.kt:76)
  at com.mrousavy.blurhash.BlurhashImageView.access$renderBlurhash (BlurhashImageView.kt:39)
  at com.mrousavy.blurhash.BlurhashImageView$updateBlurhash$1.invokeSuspend (BlurhashImageView.kt:86)
  at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33)
  at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:106)
  at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely (CoroutineScheduler.kt:571)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask (CoroutineScheduler.kt:750)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker (CoroutineScheduler.kt:678)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run (CoroutineScheduler.kt:665)

image

java.lang.NullPointerException: 
  at android.view.View.requestLayout (View.java:27055)
  at android.widget.ImageView.setImageDrawable (ImageView.java:600)
  at androidx.appcompat.widget.AppCompatImageView.setImageDrawable (AppCompatImageView.java:104)
  at android.widget.ImageView.setImageBitmap (ImageView.java:764)
  at androidx.appcompat.widget.AppCompatImageView.setImageBitmap (AppCompatImageView.java:112)
  at com.mrousavy.blurhash.BlurhashImageView.renderBlurhash (BlurhashImageView.kt:76)
  at com.mrousavy.blurhash.BlurhashImageView.access$renderBlurhash (BlurhashImageView.kt:39)
  at com.mrousavy.blurhash.BlurhashImageView$updateBlurhash$1.invokeSuspend (BlurhashImageView.kt:86)
  at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33)
  at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:106)
  at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely (CoroutineScheduler.kt:571)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask (CoroutineScheduler.kt:750)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker (CoroutineScheduler.kt:678)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run (CoroutineScheduler.kt:665)

image

Environment

System:
    OS: macOS 12.0
    CPU: (20) x64 Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz
    Memory: 7.45 GB / 64.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.8.0 - /var/folders/v4/8jyh3pp92x58b6gkspmqv7z00000gn/T/yarn--1630417502647-0.8163490576417483/node
    Yarn: 1.22.10 - /var/folders/v4/8jyh3pp92x58b6gkspmqv7z00000gn/T/yarn--1630417502647-0.8163490576417483/yarn
    npm: 7.21.0 - /usr/local/bin/npm
    Watchman: 2021.08.23.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.2 - /usr/local/lib/ruby/gems/3.0.0/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
    Android SDK: Not Found
  IDEs:
    Android Studio: 2020.3 AI-203.7717.56.2031.7621141
    Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild
  Languages:
    Java: 15.0.2 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2
    react-native: 0.64.1 => 0.64.1
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
โœจ  Done in 3.75s.
"react": 17,
"react-native": 0.64,
"react-native-blurhash": 1.1.3

[FEATURE] Support encoding for local image files

Problem

Currently there is no way to encode a local image file (photo) to a blurhash. You have to use a third party library to read it, which passes a huge base64 string over the Bridge, then pass that to the Blurhash.encode(...) function, which, again, goes over the bridge. This is a big waste of time.

Solution

Instead, pass local file paths (/var/..., or ph:// protocol) to the Blurhash.encode(...) function, which gets read natively, saving a lot of performance and not stressing the JS thread + Bridge.

Native Border Radius support

Currently, no border radius property is supported. You can achieve the same behaviour in react by setting overflow: hidden and then applying your borderRadius.

To natively support borderRadius the property group has to be exposed and set on the native views (UIImageView, ReactImageView).

For Android the official image view provides this borderRadius prop, see the react native source code, not sure why that doesn't work in my case since BlurhashImageView is a derived class (from ReactImageView)

On iOS, this looks really easy, see this stackoverflow question. Couldn't find the react native's Image component source code, if anyone can help me out here I'd appreciate it.

Error When Building

Question

The app won't build when building and throws

A problem occurred configuring project ':react-native-blurhash'.
No such property: baseUrl for class: java.lang.String

Tried using an older version and also the repo as a dependency but still the same error, Any ideas to fix this?

Environment

  Binaries:
    Node: 14.15.4 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.14.10 - C:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK: Not Found
    Windows SDK:
      AllowAllTrustedApps: Enabled
      Versions: 10.0.17763.0
  IDEs:
    Android Studio: Version  4.1.0.0 AI-201.8743.12.41.7042882
    Visual Studio: 16.8.30804.86 (Visual Studio Community 2019)
  Languages:
    Java: Not Found
    Python: 3.9.1 - C:\Python39\python.EXE
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1
    react-native: 0.63.2 => 0.63.2
  npmGlobalPackages:
    *react-native*: Not Found
"react": 16.13.1,
"react-native": 0.63.2,
"react-native-blurhash": 1.1.3

Blurhash.encode very slow

Hello, thanks for this but somehow Blurhash.encode() seems to be very slow, anyhow to make faster?

Android build fails - The minCompileSdk (31) specified in a dependency's AAR metadata

Bug

Describe the bug
A clear and concise description of what the bug is.
Here's the full error while building:

[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:checkDebugAarMetadata'.
[stderr] > Multiple task action failures occurred:
[stderr]    > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
[stderr]       > The minCompileSdk (31) specified in a
[stderr]         dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
[stderr]         is greater than this module's compileSdkVersion (android-30).
[stderr]         Dependency: androidx.lifecycle:lifecycle-runtime-ktx:2.4.0.
[stderr]         AAR metadata file: /root/.gradle/caches/transforms-3/526e05f94a98585fc93d6fc42ce9d642/transformed/jetified-lifecycle-runtime-ktx-2.4.0/META-INF/com/android/build/gradle/aar-metadata.properties.
[stderr]    > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
[stderr]       > The minCompileSdk (31) specified in a
[stderr]         dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
[stderr]         is greater than this module's compileSdkVersion (android-30).
[stderr]         Dependency: androidx.lifecycle:lifecycle-runtime:2.4.0.
[stderr]         AAR metadata file: /root/.gradle/caches/transforms-3/f1ce98d93bc25fde929ba697c920acc7/transformed/lifecycle-runtime-2.4.0/META-INF/com/android/build/gradle/aar-metadata.properties.
[stderr] * Try:
[stderr] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 1m 50s

To Reproduce
Steps to reproduce the behavior:

  1. Just install and build it on expo sdk 44 (using EAS)

Expected behavior
No errors.

Screenshots
Not needed really.

(Optional) Proposed solution
I think the problem comes from this :

targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')

which uses
def getExtOrIntegerDefault(name) {

that is probably returning 31, which shouldn't.

Environment

Additional context
I'm using EAS service from expo for building, builds fine after removing this library but not before.

System:
    OS: macOS 10.15.7
    CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
    Memory: 264.32 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 14.17.2 - /usr/local/opt/node@14/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.14.13 - /usr/local/opt/node@14/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: Not Found
  SDKs:
    iOS SDK:
      Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
    Android SDK: Not Found
  IDEs:
    Android Studio: 4.0 AI-193.6911.18.40.6626763
    Xcode: 12.4/12D4e - /usr/bin/xcodebuild
  Languages:
    Java: Not Found
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.1 => 17.0.1 
    react-native: 0.64.3 => 0.64.3 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
    "react": "17.0.1",
    "react-native": "0.64.3",
    "react-native-blurhash": "1.1.8"

TVos iOS - Unable to determine Swift version

Bug

Describe the bug
After running yarn add react-native-blurhash && cd ios && pod install && cd .. the following error is thrown when installing pods for RN blurhash:
`Installing react-native-blurhash (1.1.10)
[!] Unable to determine Swift version for the following pods:

  • react-native-blurhash-tvOS does not specify a Swift version and none of the targets (DigiSign-tvOS and DigiSign-tvOSTests) integrating it have the SWIFT_VERSION attribute set. Please contact the author or set the SWIFT_VERSION attribute in at least one of the targets that integrate this pod.`

To Reproduce
Steps to reproduce the behavior:

  1. In RN TvOS project run the above command
  2. See thrown error (same as above).

Expected behavior
Pods install correctly.

Screenshots
Screenshot 2023-05-23 at 2 19 52 PM
Screenshot 2023-05-23 at 2 20 08 PM

What can be done to solve these Warnings ?

Hi @mrousavy what can we do about these warning ?

Task :react-native-blurhash:compileDebugKotlin
w: C:\Users...\node_modules\react-native-blurhash\android\src\main\java\com\mrousavy\blurhash\BlurhashImageView.kt: (8, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: C:\Users...\node_modules\react-native-blurhash\android\src\main\java\com\mrousavy\blurhash\BlurhashImageView.kt: (111, 34): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: C:\Users...\node_modules\react-native-blurhash\android\src\main\java\com\mrousavy\blurhash\BlurhashImageView.kt: (111, 63): 'receiveEvent(Int, String!, WritableMap?): Unit' is deprecated. Deprecated in Java
w: C:\Users...\node_modules\react-native-blurhash\android\src\main\java\com\mrousavy\blurhash\BlurhashImageView.kt: (116, 34): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: C:\Users...\node_modules\react-native-blurhash\android\src\main\java\com\mrousavy\blurhash\BlurhashImageView.kt: (116, 63): 'receiveEvent(Int, String!, WritableMap?): Unit' is deprecated. Deprecated in Java
w: C:\Users...\node_modules\react-native-blurhash\android\src\main\java\com\mrousavy\blurhash\BlurhashImageView.kt: (123, 34): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: C:\Users...\node_modules\react-native-blurhash\android\src\main\java\com\mrousavy\blurhash\BlurhashImageView.kt: (123, 63): 'receiveEvent(Int, String!, WritableMap?): Unit' is deprecated. Deprecated in Java
w: C:\Users...\node_modules\react-native-blurhash\android\src\main\java\com\mrousavy\blurhash\BlurhashViewModule.kt: (45, 37): Variable 'debugDescription' is never used

Implement native encoder

Question

Very interesting module! My understanding is that the react-native-blurhash module only presents a blurhash at frontend. My question is that how to generate a blurhash in react-native environment. Can I use module blurhash with react-native 0.62 to generate blurhash string? Any concern about the performance at frontend? Many thanks.

Environment

paste the output of `react-native info` here
"react": PASTE_VERSION_HERE,
"react-native": PASTE_VERSION_HERE,
"react-native-blurhash": PASTE_VERSION_HERE

iOS Performance

For some reason the iOS Performance is significantly slower than the Android performance.

When changing the text in the Blurhash Textbox in my example/ project, the iOS View stutters for a noticeable amount of time (~1 second) before displaying the updated image. On Android, this happens instantly and no stutter is noticed.

There are many differences between the two platforms, for example on Android I use the ReactImageView and just set it's background to the decoded Bitmap. On iOS, I decode the Image to a UIImage, wrap that in a UIImageView and return this in my View Manager's view() call.

Maybe can I re-use the UIImageView and just change it's .image property?

[FEATURE] Handle non-image files gracefully with Blurhash.encode

Problem

If you feed a non-image file into Blurhash.encode:

const nonImage = 'file:///path/to/random.mp4`;
const blurhash = await Blurhash.encode(nonImage, 4, 3);

The app completely crashes with no error logs. Threw me for a loop for a few hours until I pinpointed the crash and problem with my code.

Solution

Ideally if you feed a non-image file into the blurhash.encode it should check first if it is a valid image and then throw a console.error if it isn't, instead of crashing the app with no logs.

Describe alternatives you've considered
I added the following function:

import * as mime from "react-native-mime-types"

export async function isValidImage(url: string) {
/*
For some reason on Android, fetch - blob doesn't work and returns no mimetype, but it works on iOS
In order to check on android, use the mime.lookup(url) which coincidentally only works on Android and not iOS
*/
  try {
    const response = await fetch(url)
    const blob = await response.blob()
    return blob.type.startsWith("image/") || mime.lookup(url).toString().startsWith("image")
  } catch (error) {
    console.error("Blurhash doesn't work for files that aren't images!")
    return false
  }
}

[BUG] High Quality, Full-Screen Blurhashes fail to render on Android

Bug

When rendering large Blurhashes on Android the blurhash sometimes fails to load.

This:

return (
  <Blurhash
    blurhash="LGFFaXYk^6#M@-5c,1J5@[or[Q6."
    style={{ ...StyleSheet.absoluteFillObject, opacity: 0.3 }}
    resizeMode="cover"
    decodePunch={0.2}
    decodeAsync={true} />
);

Looks like this:

a b

and I have no idea why

Expo Go ERROR Blurhash.encode in 2.0.3

Bug

Describe the bug
This Code throws error...

import { Blurhash } from "react-native-blurhash";

  const onPressPic = async () => {
    try {
        const newBlurHash = await Blurhash.encode(
          "https://picsum.photos/200/300",
          4,
          3
        );
        console.log(newBlurHash);
      }
    } catch (error) {
      console.log(error);
    }
  };


The error: 
` ERROR  Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'BlurhashModule' could not be found. Verify that a module by this name is registered in the native binary.Bridgeless mode: false. TurboModule interop: false. Modules loaded: {"NativeModules":["PlatformConstants","LogBox","SourceCode","Timing","AppState","BlobModule","WebSocketModule","SettingsManager","DevSettings","Networking","RedBox","Appearance","DevLoadingView","DeviceInfo","UIManager","ImageLoader","LinkingManager","RNCSafeAreaContext","NativeAnimatedModule","I18nManager","RNCSafeAreaContext","KeyboardObserver","ReanimatedModule","AsyncLocalStorage","RNGestureHandlerModule"],"TurboModules":[],"NotFound":["NativePerformanceCxx","NativePerformanceObserverCxx","BugReporting","HeadlessJsTaskSupport","SoundManager","IntentAndroid","NativeReactNativeFeatureFlagsCxx","RNSModule","FrameRateLogger","PlatformLocalStorage","RNC_AsyncSQLiteDBStorage","RNCAsyncStorage","AsyncSQLiteDBStorage","BlurhashModule"]}, js engine: hermes `


These are the dependencies...

"expo": "~51.0.4",
"expo-apple-authentication": "~6.4.1",
"expo-av": "~14.0.5",
"expo-blur": "~13.0.2",
"expo-build-properties": "~0.12.1",
"expo-clipboard": "~6.0.3",
"expo-constants": "~16.0.1",
"expo-dev-client": "~4.0.18",
"expo-document-picker": "~12.0.1",
"expo-file-system": "~17.0.1",
"expo-font": "~12.0.5",
"expo-haptics": "~13.0.1",
"expo-image": "~1.12.12",
"expo-image-manipulator": "~12.0.4",
"expo-image-picker": "~15.0.4",
"expo-linear-gradient": "~13.0.2",
"expo-linking": "~6.3.1",
"expo-location": "~17.0.1",
"expo-media-library": "~16.0.3",
"expo-notifications": "~0.28.1",
"expo-router": "~3.5.12",
"expo-sharing": "~12.0.1",
"expo-splash-screen": "~0.27.4",
"expo-status-bar": "~1.12.1",
"expo-system-ui": "~3.0.4",
"expo-web-browser": "~13.0.3",
"moti": "^0.29.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.74.1",
"react-native-actions-sheet": "^0.9.3",
"react-native-blurhash": "^2.0.3",

[BUG] Gradle 7.2 Android build error (RN 0.67.x)

Bug

Building works with Gradle 6.9 that was in use with RN 0.66. With 0.67.x Gradle gets updated to 7.2 and Android build gives an error:

Build file '/Users/..../node_modules/react-native-blurhash/android/build.gradle' line: 24

* What went wrong:
A problem occurred evaluating project ':react-native-blurhash'.
> Plugin with id 'maven' not found.

Downgrading to Gradle 6.9 works, but not sure if something on RN 0.67.x relies on having 7.2 so would be nice that this library would work with it as well.

To Reproduce
Steps to reproduce the behavior:

  1. Upgrade gradle-wrapper.properties gradle to 7.2
  2. Try to build for android
  3. See error

Expected behavior
Build should work

Environment

"react": 17.0.2,
"react-native": 0.67.2,
"react-native-blurhash": 1.1.8

[BUG] Compilation error with React Native 0.65

I believe RN 0.65 updates the version of Fresco embedded with react native.

As a result, this compilation error seems to have emerged:

> Task :react-native-blurhash:compileDebugKotlin FAILED

e: /.../react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewModule.kt: (41, 38): Object is not abstract and does not implement abstract base class member protected/*protected and package*/ abstract fun onFailureImpl(dataSource: DataSource<CloseableReference<CloseableImage!>!>): Unit defined in com.facebook.imagepipeline.datasource.BaseBitmapDataSubscriber
e: /.../react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashViewModule.kt: (64, 21): 'onFailureImpl' overrides nothing

[BUG] Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'BlurhashModule' could not be found

Bug

Describe the bug
I'm getting this error when upgrading to version 2.x on Expo 50:

ERROR Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'BlurhashModule' could not be found. Verify that a module by this name is registered in the native binary.Bridgeless mode: false. TurboModule interop: false. Modules loaded: {"NativeModules":["PlatformConstants","LogBox","SourceCode","Timing","AppState","BlobModule","WebSocketModule","SettingsManager","DevSettings","Networking","RedBox","Appearance","DevLoadingView","DeviceInfo","UIManager","RNCSafeAreaContext","KeyboardObserver","RNCAsyncStorage","NativeAnimatedModule","ImageLoader","I18nManager","LinkingManager"],"TurboModules":[],"NotFound":["NativePerformanceCxx","NativePerformanceObserverCxx","BugReporting","HeadlessJsTaskSupport","SoundManager","PlatformLocalStorage","RNC_AsyncSQLiteDBStorage","FrameRateLogger","IntentAndroid","BlurhashModule"]}, js engine: hermes

Since I guess I don't have any use for the new arch yet while staying managed in Expo I'll stay on v1.x, but I guess it would be nice if things don't break when upgrading.. :)

"react": "18.2.0",
"react-native": "0.73.3",
"react-native-blurhash": "2",
"expo": "~50.0.5",

[QUESTION]

Question

I keep getting a weird error when I render the component

Environment

"BlurhashView" was not found in the UIManager."
"react": 16.13.1,
"react-native": ~0.63.4,
"react-native-blurhash": ^1.0.30"

[FEATURE] Support React Native Fast Image

Problem

We are working on image heavy educational app. And we use FastImage https://github.com/DylanVann/react-native-fast-image extensively. Currently, we wrap the image in a React Native Shimmer placeholder https://github.com/tomzaku/react-native-shimmer-placeholder

This gives us flexibility to hide shimmer as soon as image load completes and show the image.

I find it much interesting to be able show a matching colored blurhash instead of shimmer. It would be great if blurhash worked with FastImage too.

Solution

There could be two approaches.

  1. Optional Image like component attribute: We can have component attribute in BlurHash props that should be a Image-like component and accepts all the Image properties. Like FastImage does. And, if the component is passed, it uses that component to render.
  2. Have a boolean isVisible attribute: Like Shimmer Placeholder, show the blurhash as long as isVisible is true and show the child component when it is false.

Describe alternatives you've considered
I do not have an alternative yet. I was hoping to look into the source code and find where Image is used and fork it to give an optional component attribute. But I couldn't find.

Environment

React Native 0.64

[BUG] - Not working on react-native 0.70.3

Bug

Describe the bug
Image is not showing as a blurred one anymore, when blur is applied, it is disappearing.

To Reproduce
Steps to reproduce the behavior:

  1. Upgrade react-native to 0.70.3
  2. Blurhash does not work anymore

Expected behavior
Image should show as blurred

Environment

Additional context
Add any other context or screenshots about the feature request here.

System:
    OS: macOS 12.6
    CPU: (8) arm64 Apple M2
    Memory: 101.41 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.9.0 - /opt/homebrew/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.19.2 - /opt/homebrew/bin/npm
    Watchman: 2022.09.12.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.2 AI-212.5712.43.2112.8609683
    Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.16.1 - /opt/homebrew/opt/openjdk@11/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: Not Found
    react-native: Not Found
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
"react": 18.1.0,
"react-native": 0.70.3,
"react-native-blurhash": 1.1.10

[FEATURE] Image event callbacks (onLoadStart, onLoadEnd, onError)

Problem

Currently there is no way of knowing when a Blurhash has been successfully loaded. Also, if the Blurhash is invalid, there is no way of finding out other than a blank image being displayed.

Solution

A solution for this would be exporting events. For example, consider the following events:

  1. onLoadStart: Called every time the blurhash properties change and the new blurhash is being decoded and loaded into the Image.
  2. onLoadEnd: Called every time the new blurhash has been decoded and successfully loaded into the image. In most cases, this appears after 1-2ms, so there isn't really a point in showing placeholders/loading indicators or anything, it's just useful to know if the load succeeded, or failed.
  3. onError: Called if the blurhash couldn't be decoded (invalid blurhash) or any other unknown error occured while loading the image. Extra error information should be passed in the SyntheticEvent.nativeEvent property.

Usage:

<Blurhash
  blurhash={blurhash}
  onLoadStart={() => console.log('load started!')}
  onLoadEnd={() => setBlurhashState('loaded')}
  onError={() => setBlurhashState('error')} />

[BUG]Missing kotlinVersion

Bug

Describe the bug
I install blurhash 1.1.7 then get this error. But work on 1.1.5

Screenshots
image

** Proposed solution**
i think you are missing the gradle.properties file on your package
image

"react": 17.0.2,
"react-native": 0.66.1,
"react-native-blurhash": 1.1.7

[BUG]Weird glitches on the edges while using zIndex.

I have View same width height border-radius on top of theBlurHash with same width, height etc.
Blurhash view has also position:absolute zIndex: -1

Corners of the blurhash has weird glitch which is only on physical devices Android, saw it on emulator but on high window size.

I am wrapping blurhash another view with overflow hidden.

Tested on Samsung s21+, Xiaomi

pic

react native 0.70.5
react native blur hash: 1.1.10

[BUG] Android - Module was compiled with an incompatible version of Kotlin.

Bug

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Install blurhash
build android

Expected behavior
Build android succeedfully

Screenshots
image

Environment

Additional context
Add any other context or screenshots about the feature request here.

System:
    OS: macOS 11.3
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 146.59 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.0.0 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.11.2 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.2 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
    Android SDK:
      API Levels: 28, 29, 30, 31
      Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2, 30.0.3, 31.0.0
      System Images: android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 2020.3 AI-203.7717.56.2031.7583922
    Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_292 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.66.4 => 0.66.4 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
"react": 17.0.2,
"react-native": 0.66.4,
"react-native-blurhash": 1.1.8

[QUESTION] Is it possible to disable logs in the console?

Question

Amazing library. It works great in our application. We only have one problem: information noise.

We use blurhash in items on FlatList, so we generate a lot of them.
Is it possible to run some silent mode so that the console is not spammed with these logs?

Zrzut ekranu 2020-11-10 o 16 56 49

> Task :react-native-blurhash:compileDebugKotlin FAILED

yarn run v1.22.21
$ react-native run-android
info JS server already running.
info Installing the app...

Configure project :notifee_react-native
:notifee_react-native @notifee/react-native found at /Users/space/Desktop/Bat/node_modules/@notifee/react-native
:notifee_react-native package.json found at /Users/space/Desktop/Bat/node_modules/@notifee/react-native/package.json
:notifee_react-native:version set from package.json: 7.8.2 (7,8,2 - 7008002)
:notifee_react-native:android.compileSdk using custom value: 34
:notifee_react-native:android.targetSdk using custom value: 34
:notifee_react-native:android.minSdk using custom value: 24
:notifee_react-native:reactNativeAndroidDir /Users/space/Desktop/Bat/node_modules/react-native/android

Configure project :react-native-firebase_app
:react-native-firebase_app package.json found at /Users/space/Desktop/Bat/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_app:firebase.bom using default value: 32.8.1
:react-native-firebase_app:play.play-services-auth using default value: 21.0.0
:react-native-firebase_app package.json found at /Users/space/Desktop/Bat/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_app:version set from package.json: 19.2.2 (19,2,2 - 19002002)
:react-native-firebase_app:android.compileSdk using custom value: 34
:react-native-firebase_app:android.targetSdk using custom value: 34
:react-native-firebase_app:android.minSdk using custom value: 24
:react-native-firebase_app:reactNativeAndroidDir /Users/space/Desktop/Bat/node_modules/react-native/android

Configure project :react-native-firebase_messaging
:react-native-firebase_messaging package.json found at /Users/space/Desktop/Bat/node_modules/@react-native-firebase/messaging/package.json
:react-native-firebase_app package.json found at /Users/space/Desktop/Bat/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_messaging:firebase.bom using default value: 32.8.1
:react-native-firebase_messaging package.json found at /Users/space/Desktop/Bat/node_modules/@react-native-firebase/messaging/package.json
:react-native-firebase_messaging:version set from package.json: 19.2.2 (19,2,2 - 19002002)
:react-native-firebase_messaging:android.compileSdk using custom value: 34
:react-native-firebase_messaging:android.targetSdk using custom value: 34
:react-native-firebase_messaging:android.minSdk using custom value: 24
:react-native-firebase_messaging:reactNativeAndroidDir /Users/space/Desktop/Bat/node_modules/react-native/android

Configure project :react-native-reanimated
Android gradle plugin: 7.4.2
Gradle: 8.2
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the gradle.properties file or use the new publishing DSL.

Configure project :react-native-vision-camera
[VisionCamera] Thank you for using VisionCamera โค๏ธ
[VisionCamera] node_modules found at /Users/space/Desktop/Bat/node_modules
[VisionCamera] VisionCamera_enableFrameProcessors is set to true!
[VisionCamera] react-native-worklets-core found, Frame Processors are enabled!
[VisionCamera] VisionCamera_enableCodeScanner is set to false!

Configure project :shopify_react-native-skia
react-native-skia: node_modules/ found at: /Users/space/Desktop/Bat/node_modules
react-native-skia: RN Version: 72 / 0.72.12
react-native-skia: isSourceBuild: false
react-native-skia: PrebuiltDir: /Users/space/Desktop/Bat/node_modules/@shopify/react-native-skia/android/build/react-native-0*/jni
react-native-skia: buildType: debug
react-native-skia: buildDir: /Users/space/Desktop/Bat/node_modules/@shopify/react-native-skia/android/build
react-native-skia: node_modules: /Users/space/Desktop/Bat/node_modules
react-native-skia: Enable Prefab: true
react-native-skia: aar state post 70, do nothing
WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 34

This Android Gradle plugin (7.4.2) was tested up to compileSdk = 33

This warning can be suppressed by adding
android.suppressUnsupportedCompileSdk=34
to this project's gradle.properties

The build will continue, but you are strongly encouraged to update your project to
use a newer Android Gradle Plugin that has been tested with compileSdk = 34
WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 34

This Android Gradle plugin (7.4.2) was tested up to compileSdk = 33

This warning can be suppressed by adding
android.suppressUnsupportedCompileSdk=34
to this project's gradle.properties

The build will continue, but you are strongly encouraged to update your project to
use a newer Android Gradle Plugin that has been tested with compileSdk = 34
WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 34

This Android Gradle plugin (7.4.2) was tested up to compileSdk = 33

This warning can be suppressed by adding
android.suppressUnsupportedCompileSdk=34
to this project's gradle.properties

The build will continue, but you are strongly encouraged to update your project to
use a newer Android Gradle Plugin that has been tested with compileSdk = 34

Task :react-native-firebase_app:compileDebugJavaWithJavac

Task :react-native-blurhash:compileDebugKotlin FAILED
'compileDebugJavaWithJavac' task (current target is 11) and 'compileDebugKotlin' task (current target is 1.8) jvm target compatibility should be set to the same Java version.

Task :react-native-firebase_messaging:compileDebugJavaWithJavac

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.2/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
291 actionable tasks: 13 executed, 278 up-to-date

info ๐Ÿ’ก Tip: Make sure that you have set up your development environment correctly, by running react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor

Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
e: /Users/space/Desktop/Bat/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashImageView.kt: (5, 8): Unresolved reference: kotlinx
e: /Users/space/Desktop/Bat/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashImageView.kt: (6, 8): Unresolved reference: kotlinx
e: /Users/space/Desktop/Bat/node_modules/react-native-blurhash/android/src/main/java/com/mrousavy/blurhash/BlurhashImageView.kt: (78, 17): Unresolved reference: GlobalScope
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':react-native-blurhash:compileDebugKotlin'.

A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
Compilation error. See log for more details

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.

BUILD FAILED in 8s
error Failed to install the app.
info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

package.json dependencies:"dependencies": {
"@gorhom/bottom-sheet": "^4",
"@notifee/react-native": "^7.8.2",
"@react-native-camera-roll/camera-roll": "^5.7.2",
"@react-native-firebase/app": "^19.0.1",
"@react-native-firebase/messaging": "^19.0.1",
"@react-native-masked-view/masked-view": "^0.3.1",
"@react-navigation/drawer": "^6.6.3",
"@react-navigation/material-top-tabs": "^6.6.10",
"@react-navigation/native": "^6.1.7",
"@react-navigation/native-stack": "^6.9.13",
"@reduxjs/toolkit": "^1.9.5",
"@shopify/react-native-skia": "1.2.2",
"axios": "^1.6.7",
"dayjs": "^1.11.9",
"ffmpeg-kit-react-native": "^6.0.2",
"react": "18.2.0",
"react-hook-form": "^7.51.1",
"react-native": "0.72.12",
"react-native-audio-recorder-player": "^3.6.7",
"react-native-blurhash": "^2.0.2",
"react-native-callkeep": "^4.3.12",
"react-native-compressor": "^1.8.24",
"react-native-device-info": "^10.13.1",
"react-native-document-picker": "^9.1.1",
"react-native-fs": "^2.20.0",
"react-native-gesture-handler": "^2.12.1",
"react-native-maps": "^1.10.3",
"react-native-mmkv": "^2.12.2",
"react-native-pager-view": "^6.2.0",
"react-native-reanimated": "^3.5.4",
"react-native-safe-area-context": "^4.7.1",
"react-native-screens": "^3.23.0",
"react-native-svg": "^13.10.0",
"react-native-tab-view": "^3.5.2",
"react-native-track-player": "^4.0.1",
"react-native-uuid": "^2.0.1",
"react-native-video": "5.2.1",
"react-native-view-shot": "^3.8.0",
"react-native-vision-camera": "4.0.0",
"react-native-webrtc": "^118.0.2",
"react-native-worklets-core": "^1.1.1",
"react-redux": "^8.1.2"
},

Platform - android

resizeMode on Android not working

On Android the resizeMode prop does not work.

This is because the differences in structure, on iOS I create a UIImage and display that. On Android I create a Bitmap, convert that to a BitmapDrawable and then set that as the background of the ReactImageView!

I need to find a different way to set the image on android.

pod install fails on RN 0.63

Bug

Describe the bug
When trying to install this module, the installation via pod install fails with the following reasons:

[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `react-native-blurhash` depends upon `React-Core`, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.

Tried to set use_modular_headers! on top of my Podfile but this produces a mass of other errors. Any help would be highly appreciated.

Environment

  • CocoaPods 1.9.1
  • RN 0.63

Additional context

"react": 16.13.1,
"react-native": 0.63.2,
"react-native-blurhash": 1.0.24

[BUG] Missing gradle.properties

Bug

Describe the bug
In the downloaded package files, gradle.properties is missing from the root android folder. This applies to version 1.1.7, not sure about any earlier versions.

To Reproduce
Steps to reproduce the behavior:
yarn add react-native-blurhash
That's it, on compile/clean you'll get something about not being able to find a null package for kotlin, if you don't have kotlin in your root project.

Expected behavior
App to compile without issues and variables referenced in the package to actually exist.

(Optional) Proposed solution
Not entirely sure how packaging for npm/yarn works, but it seems like adding in gradle.properties to that package should fix it? I added it in manually and that seemed to clear the compile/clean error warning up without issue. Can't see the source on npm's side, yarn has unpkg and jsdelivr listed and both sources are showing the file missing.

Yarn config is fairly light, npmRegistryServer is default ("https://registry.yarnpkg.com"). No scopes are used in this project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.