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

Cannot expand ZIP ".../hermes-debug.aar" #26285

Closed
copilots-app opened this issue Aug 31, 2019 · 6 comments
Closed

Cannot expand ZIP ".../hermes-debug.aar" #26285

copilots-app opened this issue Aug 31, 2019 · 6 comments
Labels
Bug Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@copilots-app
Copy link

Android build is failing with

Cannot expand ZIP '/../node_modules/react-native/node_modules/hermesvm/android/hermes-debug.aar' as it does not exist.

React Native version:
System:
OS: macOS High Sierra 10.13.6
CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
Memory: 1.06 GB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.9.0 - ~/.nvm/versions/node/v12.9.0/bin/node
Yarn: 1.17.3 - /usr/local/bin/yarn
npm: 6.10.2 - ~/.nvm/versions/node/v12.9.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 26, 27, 28
Build Tools: 27.0.2, 27.0.3, 28.0.2, 28.0.3
System Images: android-24 | Google APIs Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom
Android NDK: 17.2.4988734
IDEs:
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.5 => 0.60.5

Steps To Reproduce

  1. run 'react-native run android'

Describe what you expected to happen:
A build of my app (it worked with 0.59)

@sertony
Copy link

sertony commented Sep 26, 2019

Same issue here, have you solved it?

It seems like hermesvm folder appears to be created not inside of ../node_modules/react-native/node_modules/hermesvm but on the top level, aka ../node_modules/hermesvm

@xiaosenlin
Copy link

Same issue here, 0.59.0 is ok.

@d4vidi
Copy link
Contributor

d4vidi commented Oct 30, 2019

Indeed - here an assumption is made of that hermes is installed under react-native's node_modules 😒 (projectDir typically evaluates to root/node_modules/react-native/ReactAndroid/)
I'm inclined to try to get this fixed, will post a workaround here if found.

UPDATE: seems this has been fixed in .61.

@d4vidi
Copy link
Contributor

d4vidi commented Nov 3, 2019

I hate myself for this, but here's a new addition to my app's postinstall script:

const rnVersion = function() {
  const rnPackageJson = require('react-native/package.json');
  return rnPackageJson.version;
}();

function patchHermesLocationForRN60Android() {
  const semver = require('semver');
  const fs = require('fs-extra');

  if (semver.minor(rnVersion) === 60) {
    const HERMES_PATH_ROOT = './node_modules/hermesvm';
    const HERMES_PATH_RN = './node_modules/react-native/node_modules/hermesvm';

    const hermesIsInRoot = fs.existsSync(HERMES_PATH_ROOT);
    const hermesIsInRN = fs.existsSync(HERMES_PATH_RN);

    if (hermesIsInRoot && !hermesIsInRN) {
      fs.ensureDirSync(`${HERMES_PATH_RN}/android/`);
      fs.copySync(`${HERMES_PATH_ROOT}/android`, `${HERMES_PATH_RN}/android`);
    }
  }
}
patchHermesLocationForRN60Android();

@stale
Copy link

stale bot commented Feb 1, 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 1, 2020
@stale
Copy link

stale bot commented Feb 8, 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 8, 2020
@facebook facebook locked as resolved and limited conversation to collaborators Feb 9, 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.
Projects
None yet
Development

No branches or pull requests

4 participants