Cli: Jetify within cli does not work

Created on 15 Jul 2019  路  3Comments  路  Source: react-native-community/cli

Environment

System:
OS: macOS 10.14.5
CPU: (4) x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz
Memory: 106.50 MB / 16.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 10.16.0 - ~/.nvm/versions/node/v10.16.0/bin/node
Yarn: 1.17.0 - /usr/local/bin/yarn
npm: 6.9.0 - ~/.nvm/versions/node/v10.16.0/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, 26, 27, 28
Build Tools: 26.0.3, 27.0.3, 28.0.2, 28.0.3
System Images: android-22 | Google APIs Intel x86 Atom, android-26 | Google APIs Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.4 AI-183.5429.30.34.5452501
Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.6 => 16.8.6
react-native: ^0.60.3 => 0.60.3
npmGlobalPackages:
create-react-native-web-app: 0.1.11
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7

yarn lock

"@react-native-community/cli@^2.0.1":
  version "2.5.0"
  resolved "https://registry.yarnpkg.com/@react-native-community/cli/-/cli-2.5.0.tgz#0595689d5a8d45060fd9f927179190c285c5ac20"
  integrity sha512-j6TQtX+wNaHuCWxU0d/6xBF+HifJaEx3S9BxFVXGNZFMOPB2KKIoGplpjwXjjvQxspyyhhZ5ykjko0zayPmfsA==
  dependencies:
    "@hapi/joi" "^15.0.3"
    "@react-native-community/cli-platform-android" "^2.5.0"
    "@react-native-community/cli-platform-ios" "^2.4.1"
    "@react-native-community/cli-tools" "^2.4.1"
    chalk "^2.4.2"
    commander "^2.19.0"
    compression "^1.7.1"
    connect "^3.6.5"
    cosmiconfig "^5.1.0"
    deepmerge "^3.2.0"
    envinfo "^7.1.0"
    errorhandler "^1.5.0"
    execa "^1.0.0"
    fs-extra "^7.0.1"
    glob "^7.1.1"
    graceful-fs "^4.1.3"
    inquirer "^3.0.6"
    lodash "^4.17.5"
    metro "^0.54.1"
    metro-config "^0.54.1"
    metro-core "^0.54.1"
    metro-react-native-babel-transformer "^0.54.1"
    minimist "^1.2.0"
    mkdirp "^0.5.1"
    morgan "^1.9.0"
    node-notifier "^5.2.1"
    open "^6.2.0"
    ora "^3.4.0"
    plist "^3.0.0"
    semver "^5.0.3"
    serve-static "^1.13.1"
    shell-quote "1.6.1"
    ws "^1.1.0"

Description

Jetifier works when running npx jetify or having it as a post install, however it does not work when removing the post install and relying on cli to jetify before gradle build.

react-native run-android
...
Jetifier found 1727 file(s) to forward-jetify. Using 4 workers...
...
geolocation/GeolocationModule.java:21: error: package android.support.v4.content does not exist
import android.support.v4.content.ContextCompat;

I can confirm if I run npx jetify before trying to build then it works

bug

Most helpful comment

Ah, it looks like a race condition because jetifier spawns a worker but doesn't wait for it. Cc @grabbou, feel free to work on it :)

All 3 comments

Ah, it looks like a race condition because jetifier spawns a worker but doesn't wait for it. Cc @grabbou, feel free to work on it :)

I don't see "Jetifier found XXX file(s) to forward-jetify. Using 4 workers..." when relying on the CLI at all! I'm available if you need me to run tests 馃檪

Fixed in v2.6.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Jarred-Sumner picture Jarred-Sumner  路  3Comments

patrickkempff picture patrickkempff  路  4Comments

mauricioscotton picture mauricioscotton  路  3Comments

jacargentina picture jacargentina  路  4Comments

brentvatne picture brentvatne  路  4Comments