2

Description

Getting the following messages during build with hermesEnabled set to true

('...' represent removed text):

(full error log is here)

android\app\build\generated\assets\react\release\index.android.bundle:13:134: warning: the variable "Promise" was not declared in function "isBoldTextEnabled"
...
android\app\build\generated\assets\react\release\index.android.bundle:27:2907: warning: the variable "DebuggerInternal" was not declared in function "value 14#"
...
android\app\build\generated\assets\react\release\index.android.bundle:92:57773: warning: the variable "setTimeout" was not declared in function "wi"
...

fs.js:114
    throw err;
    ^
Error: ENOENT: no such file or directory, open 'android\app\build\intermediates\sourcemaps\react\release\index.android.bundle.packager.map'
at Object.openSync (fs.js:443:3)
at Object.readFileSync (fs.js:343:35)
at Object.<anonymous> (C:\esites-grocery\test2.hermes\plumpclient\node_modules\react-native\scripts\compose-source-maps.js:33:43)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)

FAILURE: Build failed with an exception.

* Where:
Script 'node_modules\react-native\react.gradle' line: 191

* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> Process 'command 'cmd'' finished with non-zero exit value 1

(The referenced file exists, at least after the build failed).

Environment

  • Building on Windows 10
  • React Native version: 0.62.2

What I tried to do

11
  • You're using the gradle wrapper and not gradle directly, right? Commented Oct 21, 2020 at 18:00
  • Right.......... Commented Oct 21, 2020 at 18:04
  • The warnings should not matter. Is the ... actually in the log? Commented Oct 21, 2020 at 18:05
  • No, I removed long text and placed ... instead. Commented Oct 21, 2020 at 18:11
  • The full log is very long. I uploaded it here, if you like to see it: filebin.net/2doudp9nqenhz72b/hermes-build-log.zip?t=5df00nbd Commented Oct 21, 2020 at 18:35

2 Answers 2

4

Modifying the following extra packages definition in build.gradle:

extraPackagerArgs: ["--sourcemap-output", "$buildDir/intermediates/assets/release/index.android.bundle.map"]

to

extraPackagerArgs: ["--sourcemap-output", "$buildDir/intermediates/sourcemaps/react/release/index.android.bundle.packager.map"]

Fixed the error (the warnings are still there).
An APK is created and is running..

Sign up to request clarification or add additional context in comments.

Comments

0

./gradlew clean

After doing the ./gradlew clean It worked for me.

OR

For Windows:

gralde clean

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.