Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[0.60.2] Build failing when enabling Hermes (enableHermes: true) #25599

Closed
bhaskarGyan opened this issue Jul 11, 2019 · 110 comments
Closed

[0.60.2] Build failing when enabling Hermes (enableHermes: true) #25599

bhaskarGyan opened this issue Jul 11, 2019 · 110 comments
Labels
Bug Stale There has been a lack of activity on this issue and it may be closed soon. Tech: Hermes Hermes Engine: https://hermesengine.dev/

Comments

@bhaskarGyan
Copy link

Build is failing when I enable Hermes in android/app/build.gradle

Error:
image

React Native version:

System:
OS: macOS 10.14.5
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Memory: 71.63 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.15.1 - /usr/local/bin/node
Yarn: 1.13.0 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
Android SDK:
API Levels: 23, 24, 25, 26, 27, 28
Build Tools: 21.1.2, 23.0.1, 25.0.0, 25.0.1, 25.0.2, 26.0.2, 26.0.3, 27.0.3, 28.0.0, 28.0.2, 28.0.3, 29.0.0
System Images: android-23 | Intel x86 Atom, android-23 | Google APIs Intel x86 Atom, android-23 | Google APIs Intel x86 Atom_64, android-27 | Android TV Intel x86 Atom, android-27 | Intel x86 Atom, android-27 | Intel x86 Atom_64, android-27 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Intel x86 Atom, android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom, android-28 | Google Play Intel x86 Atom_64
Android NDK: 20.0.5594570
IDEs:
Android Studio: 3.4 AI-183.6156.11.34.5522156
Xcode: 10.2/10E125 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.2 => 0.60.2
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-create-library: 3.1.2
react-native-git-upgrade: 0.2.7

Steps To Reproduce

  1. Follow the steps mentioned in hermes
  2. react-native run-android --variant release

Describe what you expected to happen:
Build to pass after enabling Hermes

Snack, code example, or link to a repository:

https://github.com/bhaskarGyan/react-native-memory-profile/tree/bug/rn-0.60.2_hermes

@clangen-nw
Copy link

This seems to be caused by the hard-coded path to the hermes binary, here: https://github.com/facebook/react-native/blob/0.60-stable/react.gradle#L19

My npm install ended up placing it in a different location in node_modules, so I did the following in my android/app/build.gradle:

project.ext.react = [
    ...
    hermesCommand: "../../node_modules/hermesvm/%OS-BIN%/hermes",
    ...
]

@ecreeth
Copy link
Contributor

ecreeth commented Jul 11, 2019

@bhaskarGyan this issue has been fixed in #25598

@burhanyilmaz
Copy link

I have the same error :/ @bhaskarGyan did you solve it?

@ecreeth
Copy link
Contributor

ecreeth commented Jul 11, 2019

cc @bhaskarGyan @burhanyilmaz to fix this issue use the 0.60.3 React Native version

@Karniej
Copy link

Karniej commented Jul 11, 2019

@ecreeth I actually just installed 0.60.3 and my build succeeded , but the app crashes on start

@burhanyilmaz
Copy link

burhanyilmaz commented Jul 11, 2019

@ecreeth Thanks I solved this via #25598
it is really fast :)

@ecreeth
Copy link
Contributor

ecreeth commented Jul 11, 2019

@Karniej The React Native Team, recommend making sure everything works before trying to switch to Hermes. If everything is fine with your application, but with Hermes your application is broken, please send a issue

@farshidshahmoradi1996
Copy link

farshidshahmoradi1996 commented Jul 11, 2019

I have same issue with 0.60.3 in --variant release
(in dev is ok )

  • What went wrong:
    Execution failed for task ':app:bundleReleaseJsAndAssets'.

A problem occurred starting process 'command '....\node_modules\hermesvm\win64-bin\hermes''

@ecreeth
Copy link
Contributor

ecreeth commented Jul 11, 2019

@farshidshahmoradi1996 I'm not sure, but I think that before using the command, we must take a few steps before. Here
image

@farshidshahmoradi1996
Copy link

farshidshahmoradi1996 commented Jul 11, 2019

when I open hermes.exe from node_modules\hermesvm\win64-bin that take error :

Capture

OS :win 8.1 (x64)

that problem comes from my windows?
I have this problem only in release version

@bhaskarGyan
Copy link
Author

@ecreeth, #25598 fix the build issue but now the App is crashing on Startup.
Raised new issue #25601

I can close this issue if build is working for @farshidshahmoradi1996

@farshidshahmoradi1996
Copy link

@bhaskarGyan build is not working in --variant release

@burhanyilmaz
Copy link

There is no problem production and development in my app. But not starting js server when running react-native run-android.
There is a solution that react-native start & react-native run-android. it is not good.
Hermes cause this problem? @ecreeth

@cpojer
Copy link
Contributor

cpojer commented Jul 12, 2019

Fixed in 0.60.3.

@cpojer cpojer closed this as completed Jul 12, 2019
@zenz
Copy link

zenz commented Jul 12, 2019

Fixed in 0.60.3.

Not fixed under windows indeed.

@cpojer
Copy link
Contributor

cpojer commented Jul 12, 2019

cc @willholen

@cpojer cpojer reopened this Jul 12, 2019
@zenz
Copy link

zenz commented Jul 12, 2019

As @farshidshahmoradi1996 said that, while run
node_modules\hermesvm\win64-bin\hermes.exe
individually. it told me it's lack of some dlls.

So I search and download this icu4c-64_2-Win64-MSVC2017.zip, unzip it and put relative dll to \windows folder, then run hermes.exe again, there's no error showing again.
But when run
react-native run-android --variant=release
still failed with same error:

* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> A problem occurred starting process 'command '..\..\node_modules\hermesvm\win64-bin\hermes''

@zenz
Copy link

zenz commented Jul 12, 2019

investigated some time on it, I found that running hermes.exe need those dlls

api-ms-win-crt-convert-l1-1-0.dll
api-ms-win-crt-environment-l1-1-0.dll
api-ms-win-crt-heap-l1-1-0.dll
api-ms-win-crt-locale-l1-1-0.dll
api-ms-win-crt-math-l1-1-0.dll
api-ms-win-crt-runtime-l1-1-0.dll
api-ms-win-crt-stdio-l1-1-0.dll
api-ms-win-crt-string-l1-1-0.dll
api-ms-win-crt-time-l1-1-0.dll
api-ms-win-crt-utility-l1-1-0.dll
icudt64.dll
icuin64.dll
icuuc64.dll

and with those dlls in \Windows dir, I can run
echo "'use strict'; function hello() { print('Hello World'); } hello();" | ./hermes
in Git-Bash and get "Hello World". But still when try to compile the apk, it failed.
Should be close to the solution.

@zenz
Copy link

zenz commented Jul 12, 2019

use hermes to compile the bundle file, I can get new bundle file, but with those error logs.

Is this means the hermes is not a complete engine for windows?

./node_modules/hermesvm/win64-bin/hermes -emit-binary -out index.bundle  C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle -O -output-source-map
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:13:147: warning: the variable "Promise" was not declared in function "isBoldTextEnabled"
...Info,c=new Map,u={isBoldTextEnabled:function(){return Promise.resolve(!1)},isGrayscaleEnabled:function(){return Pr...
                                                         ^~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:23:2880: warning: the variable "DebuggerInternal" was not declared in function "value 14#"
...hrow",value:function(){return'undefined'!=typeof DebuggerInternal&&!0===DebuggerInternal.shouldPauseOnThrow}},{key...
                                                    ^~~~~~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:82:24063: warning: the variable "__REACT_DEVTOOLS_GLOBAL_HOOK__" was not declared in function "Lt"
...{}}}function Lt(e){if("undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HO...
                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:82:56221: warning: the variable "setTimeout" was not declared in function "Ni"
...BoundaryFound=!0,t.willRetry=!0);try{Ci(t)}catch(e){setTimeout(function(){throw e})}}function zi(e){var t=e.ref;if...
                                                       ^~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:82:22078: warning: the variable "clearTimeout" was not declared in function " 212#"
...etChildren(e._nativeTag,t),!1}var xt=setTimeout,St=clearTimeout,wt=/^(.*)[\\\/]/;function kt(e){var t="";do{e:swit...
                                                      ^~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:82:82109: warning: the variable "nativeFabricUIManager" was not declared in function " 247#"
...;try{r=t(this)}catch(e){}null!=r&&(r.canonical?nativeFabricUIManager.measure(r.node,pt(this,n)):c.measure(e(this),...
                                                  ^~~~~~~~~~~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:100:795: warning: the variable "setImmediate" was not declared in function "h 6#"
..._72,t])):void n._72.push(t);h(n,t)}function h(n,u){setImmediate(function(){var c=1===n._65?u.onFulfilled:u.onRejec...
                                                      ^~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:109:177: warning: the variable "Worker" was not declared in function " 361#"
...ent),t={canUseDOM:n,canUseWorkers:'undefined'!=typeof Worker,canUseEventListeners:n&&!(!window.addEventListener&&!...
                                                         ^~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:122:96: warning: the variable "fetch" was not declared in function " 423#"
...;var s=r(d[0]);s&&s.fetch?m.exports=s:m.exports={fetch:fetch,Headers:Headers,Request:Request,Response:Response}},1...
                                                          ^~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:122:110: warning: the variable "Headers" was not declared in function " 423#"
...s&&s.fetch?m.exports=s:m.exports={fetch:fetch,Headers:Headers,Request:Request,Response:Response}},116,[117]);
                                                         ^~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:122:126: warning: the variable "Request" was not declared in function " 423#"
...orts=s:m.exports={fetch:fetch,Headers:Headers,Request:Request,Response:Response}},116,[117]);
                                                         ^~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:122:143: warning: the variable "Response" was not declared in function " 423#"
...fetch:fetch,Headers:Headers,Request:Request,Response:Response}},116,[117]);
                                                        ^~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:123:1539: warning: the variable "FileReader" was not declared in function "p 13#"
...or=function(){n(t.error)}})}function p(t){var o=new FileReader,n=l(o);return o.readAsArrayBuffer(t),n}function b(t...
                                                       ^~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:123:1973: warning: the variable "Blob" was not declared in function " 432#"
...dyInit=t,t?'string'==typeof t?this._bodyText=t:o.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o.formData...
                                                          ^~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:123:2034: warning: the variable "FormData" was not declared in function " 432#"
...totype.isPrototypeOf(t)?this._bodyBlob=t:o.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:o.se...
                                                        ^~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:123:2107: warning: the variable "URLSearchParams" was not declared in function " 432#"
...ototypeOf(t)?this._bodyFormData=t:o.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toSt...
                                                     ^~~~~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:123:6805: warning: the variable "XMLHttpRequest" was not declared in function " 439#"
...t.DOMException('Aborted','AbortError'));var y=new XMLHttpRequest;function l(){y.abort()}y.onload=function(){var t,...
                                                     ^~~~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:151:280: warning:...meout?clearTimeout:void 0,c="function"==typeof requestAnimationFrame?requestAnimationFrame:void 0,f="function"==ty...

                                                  ^~~~~~~~~~~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:151:352: warning:
 the variable "cancelAnimationFrame" was not declared in function " 538#"
...uestAnimationFrame:void 0,f="function"==typeof cancelAnimationFrame?cancelAnimationFrame:void 0,p=void 0,v=void 0;...

                                                  ^~~~~~~~~~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:151:527: warning:
 the variable "performance" was not declared in function " 538#"
...{f(p),n(e.unstable_now())},100)}if("object"==typeof performance&&"function"==typeof performance.now){var y=perform...

                                                       ^~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:151:733: warning:
 the variable "MessageChannel" was not declared in function " 538#"
...if("undefined"==typeof window||"function"!=typeof MessageChannel){var w=null,_=function(n){if(null!==w)try{w(n)}fi...

                                                     ^~~~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:267:2395: warning
: the variable "clearImmediate" was not declared in function " 1025#"
...Transition:'fade'},f._updatePropsStack=function(){clearImmediate(f._updateImmediate),f._updateImmediate=setImmedia...

                                                     ^~~~~~~~~~~~~~

@Ariel08081214
Copy link

I got error:
A problem occurred starting process 'command '....\node_modules\hermesvm\win64-bin\hermes''
React Native versioin:0.60.3

@Kennytian
Copy link

The same issue on osx-bin:

I got error:
A problem occurred starting process 'command '../../node_modules/hermesvm/osx-bin/hermes''
React Native versioin:0.60.3

@marcozanger
Copy link

Same issue on windows and version 0.60.3

  • What went wrong:
    Execution failed for task ':app:bundleReleaseJsAndAssets'.

A problem occurred starting process 'command '....\node_modules\hermesvm\win64-bin\hermes''

@zenz
Copy link

zenz commented Jul 14, 2019

modify react.gradle file to add cmd /c before execute hermes can solve the error message. but no matter how, hermes cannot translate some elements as my previous comment is the problem. this makes the return result not zero. then the process stop there.

@chuanhaisoft
Copy link

chuanhaisoft commented Jul 15, 2019

0.60.3 same problem:
Caused by: org.gradle.process.internal.ExecException: A problem occurred starting process 'command '....\node_modules\hermesvm\win64-bin\hermes''

Caused by: net.rubygrapefruit.platform.NativeException: Could not start '....\node_modules\hermesvm\win64-bin\hermes'

@sasclau
Copy link

sasclau commented Jul 15, 2019

Same here with 0.60.3:
Execution failed for task ':app:bundleReleaseJsAndAssets'.

A problem occurred starting process 'command '....\node_modules\hermesvm\win64-bin\hermes''
Any news about this problem?

@willholen
Copy link
Contributor

Hermes requires the Microsoft Visual C++ 2015 Redistributable, and the ICU4C libraries which were accidentally omitted in the first NPM release (but can be found on the GitHub release).

There are undoubtedly several issues at work in this thread though. We're aiming to publish a new NPM this week to address several of them.

@MakhouT
Copy link

MakhouT commented Sep 18, 2019

Well I also have issues with Hermes
I've enabled it like this

dependencies {
    implementation project(':react-native-webview')
    implementation project(':react-native-fs')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.facebook.react:react-native:+"  // From node_modules
    implementation project(':react-native-navigation')

    if (enableHermes) {
        def hermesPath = "../../node_modules/hermesvm/android/";
        debugImplementation files(hermesPath + "hermes-debug.aar")
        releaseImplementation files(hermesPath + "hermes-release.aar")
    } else {
        implementation jscFlavor
    }
}
project.ext.react = [
        entryFile: "index.js",
        enableHermes: true,  // clean and rebuild if changing
        bundleAssetName: "index.android.bundle",
        bundleInAlpha: true,
        bundleInBeta: true
]

In my react native component I am having this

  const usingHermes = typeof HermesInternal === 'object' && HermesInternal !== null;
  console.log(typeof HermesInternal); // undefined

{!usingHermes ? (<Text style={styles.footer}>Engine: None</Text>) : (
            <View style={styles.engine}>
              <Text style={styles.footer}>Engine: Hermes</Text>
            </View>
          )}

react-native info

System:
    OS: macOS 10.14.6
    CPU: (4) x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz
    Memory: 42.12 MB / 8.00 GB
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 10.16.2 - ~/.nvm/versions/node/v10.16.2/bin/node
    Yarn: 1.16.0 - /usr/local/bin/yarn
    npm: 6.9.0 - ~/.nvm/versions/node/v10.16.2/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
    Android SDK:
      API Levels: 26, 28
      Build Tools: 28.0.3
      System Images: android-28 | Google APIs Intel x86 Atom
  IDEs:
    Android Studio: 3.4 AI-183.5429.30.34.5452501
    Xcode: 10.3/10G8 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.8.6 => 16.8.6 
    react-native: 0.60.5 => 0.60.5 
  npmGlobalPackages:
    react-native-clean-project: 3.2.4

It always outputs None on my component. Am I missing something?
And yes I cleaned my android build folder with ./gradlew clean

@Jeet007das
Copy link

@ErHarinderSingh
First add hermes-engine
yarn add --dev hermes-engine@0.1.0
Then try to enable hermes in android/app/build.gradle with

project.ext.react = [
    entryFile: "index.js",
    enableHermes: true,  // clean and rebuild if changing
    hermesCommand: "../../node_modules/hermes-engine/%OS-BIN%/hermes",
]

and then replace node_module/react-native/react.gradle with this file:
workable react.gradle file
I think this time you can make it to run with command
react-native run-android --variant release
or use
./gradlew assembleRelease to build your app on Windows.

it worked for me on Linux

Thank you soo its working to following these steps. thanks a lot

@zenz
Copy link

zenz commented Sep 25, 2019

I'm really disapointed.
Today the RN 0.61.1 was released. but this patch still not there! We the programers who use Windows still need to apply the patch by ourselves. What a joke!

@ErHarinderSingh
Copy link

I'm really disapointed.
Today the RN 0.61.1 was released. but this patch still not there! We the programers who use Windows still need to apply the patch by ourselves. What a joke!

You are right bro. I am shocking why they have not added new working react.gradle file there with hermes release. We still have to change react.gradle file. If we have to add any package like gmaps etc; then react.gradle file changes again and we have to again modify it.

@usmansbk
Copy link

I'm really disapointed.
Today the RN 0.61.1 was released. but this patch still not there! We the programers who use Windows still need to apply the patch by ourselves. What a joke!

You are right bro. I am shocking why they have not added new working react.gradle file there with hermes release. We still have to change react.gradle file. If we have to add any package like gmaps etc; then react.gradle file changes again and we have to again modify it.

Yeah! I was hoping to find a way to prevent react.gradle from being overwritten every time I install a package. It's quite annoying. I don't believe they're not aware of this problem on Windows.

@arifo
Copy link

arifo commented Sep 26, 2019

use hermes to compile the bundle file, I can get new bundle file, but with those error logs.

Is this means the hermes is not a complete engine for windows?

./node_modules/hermesvm/win64-bin/hermes -emit-binary -out index.bundle  C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle -O -output-source-map
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:13:147: warning: the variable "Promise" was not declared in function "isBoldTextEnabled"
...Info,c=new Map,u={isBoldTextEnabled:function(){return Promise.resolve(!1)},isGrayscaleEnabled:function(){return Pr...
                                                         ^~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:23:2880: warning: the variable "DebuggerInternal" was not declared in function "value 14#"
...hrow",value:function(){return'undefined'!=typeof DebuggerInternal&&!0===DebuggerInternal.shouldPauseOnThrow}},{key...
                                                    ^~~~~~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:82:24063: warning: the variable "__REACT_DEVTOOLS_GLOBAL_HOOK__" was not declared in function "Lt"
...{}}}function Lt(e){if("undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HO...
                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:82:56221: warning: the variable "setTimeout" was not declared in function "Ni"
...BoundaryFound=!0,t.willRetry=!0);try{Ci(t)}catch(e){setTimeout(function(){throw e})}}function zi(e){var t=e.ref;if...
                                                       ^~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:82:22078: warning: the variable "clearTimeout" was not declared in function " 212#"
...etChildren(e._nativeTag,t),!1}var xt=setTimeout,St=clearTimeout,wt=/^(.*)[\\\/]/;function kt(e){var t="";do{e:swit...
                                                      ^~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:82:82109: warning: the variable "nativeFabricUIManager" was not declared in function " 247#"
...;try{r=t(this)}catch(e){}null!=r&&(r.canonical?nativeFabricUIManager.measure(r.node,pt(this,n)):c.measure(e(this),...
                                                  ^~~~~~~~~~~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:100:795: warning: the variable "setImmediate" was not declared in function "h 6#"
..._72,t])):void n._72.push(t);h(n,t)}function h(n,u){setImmediate(function(){var c=1===n._65?u.onFulfilled:u.onRejec...
                                                      ^~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:109:177: warning: the variable "Worker" was not declared in function " 361#"
...ent),t={canUseDOM:n,canUseWorkers:'undefined'!=typeof Worker,canUseEventListeners:n&&!(!window.addEventListener&&!...
                                                         ^~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:122:96: warning: the variable "fetch" was not declared in function " 423#"
...;var s=r(d[0]);s&&s.fetch?m.exports=s:m.exports={fetch:fetch,Headers:Headers,Request:Request,Response:Response}},1...
                                                          ^~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:122:110: warning: the variable "Headers" was not declared in function " 423#"
...s&&s.fetch?m.exports=s:m.exports={fetch:fetch,Headers:Headers,Request:Request,Response:Response}},116,[117]);
                                                         ^~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:122:126: warning: the variable "Request" was not declared in function " 423#"
...orts=s:m.exports={fetch:fetch,Headers:Headers,Request:Request,Response:Response}},116,[117]);
                                                         ^~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:122:143: warning: the variable "Response" was not declared in function " 423#"
...fetch:fetch,Headers:Headers,Request:Request,Response:Response}},116,[117]);
                                                        ^~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:123:1539: warning: the variable "FileReader" was not declared in function "p 13#"
...or=function(){n(t.error)}})}function p(t){var o=new FileReader,n=l(o);return o.readAsArrayBuffer(t),n}function b(t...
                                                       ^~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:123:1973: warning: the variable "Blob" was not declared in function " 432#"
...dyInit=t,t?'string'==typeof t?this._bodyText=t:o.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o.formData...
                                                          ^~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:123:2034: warning: the variable "FormData" was not declared in function " 432#"
...totype.isPrototypeOf(t)?this._bodyBlob=t:o.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:o.se...
                                                        ^~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:123:2107: warning: the variable "URLSearchParams" was not declared in function " 432#"
...ototypeOf(t)?this._bodyFormData=t:o.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toSt...
                                                     ^~~~~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:123:6805: warning: the variable "XMLHttpRequest" was not declared in function " 439#"
...t.DOMException('Aborted','AbortError'));var y=new XMLHttpRequest;function l(){y.abort()}y.onload=function(){var t,...
                                                     ^~~~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:151:280: warning:...meout?clearTimeout:void 0,c="function"==typeof requestAnimationFrame?requestAnimationFrame:void 0,f="function"==ty...

                                                  ^~~~~~~~~~~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:151:352: warning:
 the variable "cancelAnimationFrame" was not declared in function " 538#"
...uestAnimationFrame:void 0,f="function"==typeof cancelAnimationFrame?cancelAnimationFrame:void 0,p=void 0,v=void 0;...

                                                  ^~~~~~~~~~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:151:527: warning:
 the variable "performance" was not declared in function " 538#"
...{f(p),n(e.unstable_now())},100)}if("object"==typeof performance&&"function"==typeof performance.now){var y=perform...

                                                       ^~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:151:733: warning:
 the variable "MessageChannel" was not declared in function " 538#"
...if("undefined"==typeof window||"function"!=typeof MessageChannel){var w=null,_=function(n){if(null!==w)try{w(n)}fi...

                                                     ^~~~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:267:2395: warning
: the variable "clearImmediate" was not declared in function " 1025#"
...Transition:'fade'},f._updatePropsStack=function(){clearImmediate(f._updateImmediate),f._updateImmediate=setImmedia...

                                                     ^~~~~~~~~~~~~~

getting those error logs on mac too.

@HasanAlyazidi
Copy link

The error still occurs on Windows even after upgrading to 0.61.1.

image

@Rapsssito
Copy link

Rapsssito commented Sep 28, 2019

The PR fix was merged two days ago: #26556. Hopefully, we will see it in the next update.

@bajran
Copy link

bajran commented Oct 5, 2019

I am using 0.61.2, still I am getting same error of hermes in window...

@shivaping
Copy link

I'm still seeing the same error as well in-spite of following the steps mentioned above

@efleurine
Copy link

The day my Hermes config works, I will pay myself 2 ice creams.

@bajran
Copy link

bajran commented Oct 8, 2019

I am using 0.61.2, still I am getting same error of hermes in window...

It works in ubuntu and not working in window. If I need to reduce the size of apk using hermes, then I need to used ubuntu for that

@usmansbk
Copy link

usmansbk commented Oct 8, 2019

@willholen
Is this a super bug?
Is something wrong with the patch we've been using?
Should Windows users migrate to a different OS?
Why won't they fix this bug? Modifying the react.gradle file is really annoying.

@Maskedman99
Copy link

Maskedman99 commented Oct 25, 2019

Running ./gradlew bundleRelease is giving many similar kind of errors with different variables

/home/ubuntu/X/Y/App/android/app/build/generated/assets/react/release/index.android.bundle:13:134: warning: the variable "Promise" was not declared in function "isBoldTextEnabled"
__d(function(g,r,i,a,m,e,d){'use strict';var n=r(d[0])(r(d[1])),t=r(d[2]),o=r(d[3]),s=new Map,c={isBoldTextEnabled:function(){return Promise.resolve(!1)},isGrayscaleEnabled:function(){return Promise.resolve(!1)},isInvertColorsEnabled:function(){return Promise.resolve(!1)},isReduceMotionEnabled:function(){return new Promise(function(t,o){n.default?n.default.isReduceMotionEnabled(t):o(!1)})},isReduceTransparencyEnabled:function(){return Promise.resolve(!1)},isScreenReaderEnabled:function(){return new Promise(function(t,o){n.default?n.default.isTouchExplorationEnabled(t):o(!1)})},get fetch(){return this.isScreenReaderEnabled},addEventListener:function(n,o){var c;'change'===n||'screenReaderChanged'===n?c=t.addListener("touchExplorationDidChange",function(n){o(n)}):'reduceMotionChanged'===n&&(c=t.addListener("reduceMotionDidChange",function(n){o(n)})),s.set(o,c)},removeEventListener:function(n,t){var o=s.get(t);o&&(o.remove(),s.delete(t))},setAccessibilityFocus:function(n){o.sendAccessibilityEvent(n,o.getConstants().AccessibilityEventTypes.typeViewFocused)},announceForAccessibility:function(t){n.default&&n.default.announceForAccessibility(t)}};m.exports=c},7,[1,8,30,43]);

Eventhough an app.abb is being created app crashes while running.
However react-native run-android --variant=release works fine.
I am using Linux ( Ubuntu ) and facing the problem :(

@riazXrazor
Copy link

i am using 0.60.5 still facing the issue :(
@andreasbergqvist fix worked

@mikehardy
Copy link
Contributor

Yeah, it was merged to master but that was after the 0.61-branch was cut, so it hasn't made it in a release there. I just added the commit to the request for cherry-picks on 0.61 after seeing @LuigiMaestrelli mention it.

I just checked on 0.62-stable and it's on there https://github.com/facebook/react-native/blob/0.62-stable/react.gradle#L153 so whenever 0.62.0 comes out (it's really close but is blocked on CI failures if anyone wants to lend a hand...) it will have it as well.

Until then get yourself some patch-package goodness - makes incorporating known fixes in old releases super easy and reliable across all installs of your project :-). Cheers

@roots-ai
Copy link

roots-ai commented Nov 5, 2019

use hermes to compile the bundle file, I can get new bundle file, but with those error logs.
Is this means the hermes is not a complete engine for windows?

./node_modules/hermesvm/win64-bin/hermes -emit-binary -out index.bundle  C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle -O -output-source-map
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:13:147: warning: the variable "Promise" was not declared in function "isBoldTextEnabled"
...Info,c=new Map,u={isBoldTextEnabled:function(){return Promise.resolve(!1)},isGrayscaleEnabled:function(){return Pr...
                                                         ^~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:23:2880: warning: the variable "DebuggerInternal" was not declared in function "value 14#"
...hrow",value:function(){return'undefined'!=typeof DebuggerInternal&&!0===DebuggerInternal.shouldPauseOnThrow}},{key...
                                                    ^~~~~~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:82:24063: warning: the variable "__REACT_DEVTOOLS_GLOBAL_HOOK__" was not declared in function "Lt"
...{}}}function Lt(e){if("undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HO...
                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:82:56221: warning: the variable "setTimeout" was not declared in function "Ni"
...BoundaryFound=!0,t.willRetry=!0);try{Ci(t)}catch(e){setTimeout(function(){throw e})}}function zi(e){var t=e.ref;if...
                                                       ^~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:82:22078: warning: the variable "clearTimeout" was not declared in function " 212#"
...etChildren(e._nativeTag,t),!1}var xt=setTimeout,St=clearTimeout,wt=/^(.*)[\\\/]/;function kt(e){var t="";do{e:swit...
                                                      ^~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:82:82109: warning: the variable "nativeFabricUIManager" was not declared in function " 247#"
...;try{r=t(this)}catch(e){}null!=r&&(r.canonical?nativeFabricUIManager.measure(r.node,pt(this,n)):c.measure(e(this),...
                                                  ^~~~~~~~~~~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:100:795: warning: the variable "setImmediate" was not declared in function "h 6#"
..._72,t])):void n._72.push(t);h(n,t)}function h(n,u){setImmediate(function(){var c=1===n._65?u.onFulfilled:u.onRejec...
                                                      ^~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:109:177: warning: the variable "Worker" was not declared in function " 361#"
...ent),t={canUseDOM:n,canUseWorkers:'undefined'!=typeof Worker,canUseEventListeners:n&&!(!window.addEventListener&&!...
                                                         ^~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:122:96: warning: the variable "fetch" was not declared in function " 423#"
...;var s=r(d[0]);s&&s.fetch?m.exports=s:m.exports={fetch:fetch,Headers:Headers,Request:Request,Response:Response}},1...
                                                          ^~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:122:110: warning: the variable "Headers" was not declared in function " 423#"
...s&&s.fetch?m.exports=s:m.exports={fetch:fetch,Headers:Headers,Request:Request,Response:Response}},116,[117]);
                                                         ^~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:122:126: warning: the variable "Request" was not declared in function " 423#"
...orts=s:m.exports={fetch:fetch,Headers:Headers,Request:Request,Response:Response}},116,[117]);
                                                         ^~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:122:143: warning: the variable "Response" was not declared in function " 423#"
...fetch:fetch,Headers:Headers,Request:Request,Response:Response}},116,[117]);
                                                        ^~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:123:1539: warning: the variable "FileReader" was not declared in function "p 13#"
...or=function(){n(t.error)}})}function p(t){var o=new FileReader,n=l(o);return o.readAsArrayBuffer(t),n}function b(t...
                                                       ^~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:123:1973: warning: the variable "Blob" was not declared in function " 432#"
...dyInit=t,t?'string'==typeof t?this._bodyText=t:o.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o.formData...
                                                          ^~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:123:2034: warning: the variable "FormData" was not declared in function " 432#"
...totype.isPrototypeOf(t)?this._bodyBlob=t:o.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:o.se...
                                                        ^~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:123:2107: warning: the variable "URLSearchParams" was not declared in function " 432#"
...ototypeOf(t)?this._bodyFormData=t:o.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toSt...
                                                     ^~~~~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:123:6805: warning: the variable "XMLHttpRequest" was not declared in function " 439#"
...t.DOMException('Aborted','AbortError'));var y=new XMLHttpRequest;function l(){y.abort()}y.onload=function(){var t,...
                                                     ^~~~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:151:280: warning:...meout?clearTimeout:void 0,c="function"==typeof requestAnimationFrame?requestAnimationFrame:void 0,f="function"==ty...

                                                  ^~~~~~~~~~~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:151:352: warning:
 the variable "cancelAnimationFrame" was not declared in function " 538#"
...uestAnimationFrame:void 0,f="function"==typeof cancelAnimationFrame?cancelAnimationFrame:void 0,p=void 0,v=void 0;...

                                                  ^~~~~~~~~~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:151:527: warning:
 the variable "performance" was not declared in function " 538#"
...{f(p),n(e.unstable_now())},100)}if("object"==typeof performance&&"function"==typeof performance.now){var y=perform...

                                                       ^~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:151:733: warning:
 the variable "MessageChannel" was not declared in function " 538#"
...if("undefined"==typeof window||"function"!=typeof MessageChannel){var w=null,_=function(n){if(null!==w)try{w(n)}fi...

                                                     ^~~~~~~~~~~~~~
C:\Users\zenz\programs\test_app\android\app\build\generated\assets\react\release\index.android.bundle:267:2395: warning
: the variable "clearImmediate" was not declared in function " 1025#"
...Transition:'fade'},f._updatePropsStack=function(){clearImmediate(f._updateImmediate),f._updateImmediate=setImmedia...

                                                     ^~~~~~~~~~~~~~

getting those error logs on mac too.

@zenz How did this got resolved on mac?

@roots-ai
Copy link

roots-ai commented Nov 5, 2019

The same issue on osx-bin:

I got error:
A problem occurred starting process 'command '../../node_modules/hermesvm/osx-bin/hermes''
React Native versioin:0.60.3

How did you resolve it?

@stale
Copy link

stale bot commented Feb 3, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Feb 3, 2020
@stale
Copy link

stale bot commented Feb 10, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Feb 10, 2020
@facebook facebook locked as resolved and limited conversation to collaborators Feb 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Stale There has been a lack of activity on this issue and it may be closed soon. Tech: Hermes Hermes Engine: https://hermesengine.dev/
Projects
None yet
Development

No branches or pull requests