Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

The app crashes when using new Hermes engine #664

Closed
1 of 2 tasks
johanquiroga opened this issue Oct 8, 2019 · 15 comments
Closed
1 of 2 tasks

The app crashes when using new Hermes engine #664

johanquiroga opened this issue Oct 8, 2019 · 15 comments
Assignees
Labels
❤️ Eva Icons eva-icons module-specific 📱 Components components module-specific

Comments

@johanquiroga
Copy link
Contributor

johanquiroga commented Oct 8, 2019

Issue type

  • bug report
  • feature request

Issue description

Current behavior:

The app crashes when using new Hermes engine.

This only happened once I added the Icons Module, before that the app was working correctly with the Hermes engine.
Screenshot_1570497400

Expected behavior:

The app works with or without the Hermes engine.

Steps to reproduce:

Other information:

OS, device, package version

"@eva-design/eva": "^1.2.0"
"@ui-kitten/eva-icons": "^4.2.0"
"react-native": "0.61.1"
"react-native-ui-kitten": "^4.2.0"
@32penkin 32penkin added help wanted ❤️ Eva Icons eva-icons module-specific 📱 Components components module-specific labels Oct 8, 2019
@artyorsh artyorsh self-assigned this Oct 9, 2019
@artyorsh
Copy link
Collaborator

artyorsh commented Oct 9, 2019

Hi @johanquiroga 👋
I guess this is mostly not a framework issue, just because Hermes engine does not currently support Proxies. See the related thread

And yes, this is because Icons module relies on Proxies, but this was the simplest solution for us. Btw, MobX users have the same issues with Hermes.

@artyorsh artyorsh closed this as completed Oct 9, 2019
@anhtuank7c
Copy link

I think we should use module proxy-polyfill for this line:

ie:

import PolyfillProxy from 'proxy-polyfill/src/proxy'

...
return new PolyfillProxy({}, {...})

@artyorsh
Copy link
Collaborator

@anhtuank7c does it resolves an issue?

@artyorsh
Copy link
Collaborator

artyorsh commented Dec 20, 2019

@anhtuank7c I did some review on this now, and what I get is that we don't get application crashes, but for any reason it's unable to find requested property, e.g:

const HeartIcon = () => <Icon name='heart' />

will lead to runtime error of @ui-kitten/eva-icons package saying 'heart' does not exist

@AndreaTurco
Copy link

Hi all
In my case, this issue is present only on android and my currently workaround is :

  • use the solution showed by @anhtuank7c
  • removed all the import { Icon } from '@ui-kitten/components'; and use:
import React from 'react';
import { Image } from 'react-native';
import { Button } from '@ui-kitten/components';

const RemoteBulbIcon = (style) => (
  <Image
    style={style}
    source={{ uri: 'https://akveo.github.io/eva-icons/outline/png/128/bulb-outline.png' }}
  />
);

export const IconExternalSourceShowcase = (props) => (
  <Button icon={RemoteBulbIcon}>
    Login with Facebook
  </Button>
);

icons from: (https://akveo.github.io/eva-icons/#/)

Other information:
OS, device, package version:

    "@eva-design/eva": "^1.3.1",
    "@ui-kitten/eva-icons": "^4.3.2",
    "react-native-ui-kitten": "4.3.2",

@artyorsh
Copy link
Collaborator

artyorsh commented Jan 3, 2020

@AndreaTurco the reason is that Hermes engine doesn't support proxies. This engine is used to increase Android performance, and it doesn't affect iOS in total. Currently we have no workaround to get rid of proxies, so if you really need Hermes - your solution would work, but will affect UX because of loading icons remotely instead of using SVGs.

@anhtuank7c
Copy link

Good news ever!!!!

https://twitter.com/HermesEngine/status/1245136667414913024

Screen Shot 2020-04-02 at 21 07 34

@artyorsh
Copy link
Collaborator

artyorsh commented Apr 2, 2020

@anhtuank7c thanks for sharing 👍

@lewatt23
Copy link

@anhtuank7c Please any workaround? am using react-native 0.62 but I still have this error...

@anhtuank7c
Copy link

@lewatt23 Did you try npm install hermes-engine@v0.4.2-rc1?

@lewatt23
Copy link

@anhtuank7c My bad thought I was installed by default since I was using rn 0.62.2, just installed and is working fine, thanks :)

@afkcodes
Copy link

for those using 0.63 use npm install hermes-engine@v0.5.2-rc1

@santiago1393
Copy link

for those using 0.63 use npm install hermes-engine@v0.5.2-rc1

It worked after clean gradle builds
Thanks!!

@kuasha420
Copy link

0.64 will have Proxy enabled by default on Hermes. Woohoo!

@teamzz111
Copy link

for those using 0.63 use npm install hermes-engine@v0.5.2-rc1

Workssss

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
❤️ Eva Icons eva-icons module-specific 📱 Components components module-specific
Projects
None yet
Development

No branches or pull requests

10 participants