question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[0.62.2 -> 0.63.0] react-native upgrade fails

See original GitHub issue

Environment

System:
    OS: Linux 4.15 Ubuntu 18.04.4 LTS (Bionic Beaver)
    CPU: (8) x64 Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
    Memory: 10.72 GB / 31.37 GB
    Shell: 5.4.2 - /usr/bin/zsh
  Binaries:
    Node: 12.18.1 - ~/.local/opt/n/bin/node
    Yarn: 1.22.4 - ~/.local/opt/n/bin/yarn
    npm: 6.14.5 - ~/.local/opt/n/bin/npm
    Watchman: Not Found
  SDKs:
    Android SDK:
      API Levels: 27, 28
      Build Tools: 27.0.3, 28.0.3
      System Images: android-22 | Google APIs Intel x86 Atom, android-23 | Google APIs ARM EABI v7a, android-27 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: Not Found
  Languages:
    Java: 1.8.0_252 - /usr/bin/javac
    Python: 2.7.17 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1
    react-native: 0.63.0 => 0.63.0
  npmGlobalPackages:
    *react-native*: Not Found

Description

npx react-native upgrade failed to upgrade my react-native app from 0.62.2 to 0.63.0.

info No version passed. Fetching latest...
info Fetching diff between v0.62.2 and v0.63.0...
info Applying diff...
warn Excluding files that exist in the template, but not in your project:

error Excluding files that failed to apply the diff:
  - MyProject/android/gradlew.bat
  - MyProject/ios/Podfile
  - MyProject/ios/MyProject.xcodeproj/project.pbxproj
  1. Zero files changed by the upgrade command
  2. Not all the files listed on the upgrade-helper diff appear in the “failed to apply the diff” list
  3. 2/3 of the problematic files also appeared to cause problems on a brand new react-native app

Reproducible Demo

To sanity-check, I did the following:

react-native init --version="react-native@0.62.2" ReactNativeUpgradeTest
cd ReactNativeUpgradeTest
react-native upgrade

And I got this output:

info No version passed. Fetching latest...
info Fetching diff between v0.62.2 and v0.63.0...
info Applying diff...
warn Excluding files that exist in the template, but not in your project:

error Excluding files that failed to apply the diff:
  - android/gradlew.bat
  - ios/ReactNativeUpgradeTest.xcodeproj/project.pbxproj
Please make sure to check the actual changes after the upgrade command is finished.
You can find them in our Upgrade Helper web app: https://react-native-community.github.io/upgrade-helper/?from=0.62.2&to=0.63.0
info Installing "react-native@0.63.0" and its peer dependencies...
info Running "git status" to check what changed...
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        modified:   .flowconfig
        modified:   android/app/build.gradle
        modified:   android/build.gradle
        modified:   android/gradle.properties
        modified:   android/gradle/wrapper/gradle-wrapper.jar
        modified:   android/gradle/wrapper/gradle-wrapper.properties
        modified:   android/gradlew
        modified:   ios/Podfile
        modified:   ios/ReactNativeUpgradeTest-tvOSTests/Info.plist
        modified:   ios/ReactNativeUpgradeTest/AppDelegate.m
        deleted:    ios/ReactNativeUpgradeTest/Base.lproj/LaunchScreen.xib
        new file:   ios/ReactNativeUpgradeTest/LaunchScreen.storyboard
        modified:   package.json
        modified:   yarn.lock

success Upgraded React Native to v0.63.0 🎉. Now you can review and commit the changes

I do see changes in this case, but it still has errors applying the diff to:

  • android/gradlew.bat
  • ios/ReactNativeUpgradeTest.xcodeproj/project.pbxproj

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:13
  • Comments:5

github_iconTop GitHub Comments

5reactions
ghasemikasra39commented, Sep 11, 2020

I got the same error after executing npx react-native upgrade:

info No version passed. Fetching latest...
info Fetching diff between v0.62.2 and v0.63.2...
info Applying diff...
warn Excluding files that exist in the template, but not in your project:
  - .flowconfig
  - ios/RNApp-tvOSTests/Info.plist
error Excluding files that failed to apply the diff:
  - android/app/build.gradle
  - android/build.gradle
  - android/gradle.properties
  - android/gradle/wrapper/gradle-wrapper.jar
  - android/gradle/wrapper/gradle-wrapper.properties
  - android/gradlew.bat
  - ios/Podfile
  - ios/RNApp.xcodeproj/project.pbxproj
  - ios/RNApp/AppDelegate.m
  - ios/RNApp/Base.lproj/LaunchScreen.xib
Please make sure to check the actual changes after the upgrade command is finished.
You can find them in our Upgrade Helper web app: https://react-native-community.github.io/upgrade-helper/?from=0.62.2&to=0.63.2

I wanted to upgrade from 0.62.2 to 0.63.2

2reactions
bdeepucommented, Feb 6, 2021

If you want to upgrade with React Native CLI but you don’t use Git# While your project does not have to be handled by the Git versioning system – you can use Mercurial, SVN, or nothing – you will still need to install Git on your system in order to use npx react-native upgrade. Git will also need to be available in the PATH. If your project doesn’t use Git, initialize it and commit:

git init # Initialize a Git repository
git add . # Stage all the current files
git commit -m "Upgrade react-native" # Save the current files in a commit

After you finish upgrading you may remove the .git directory.

https://reactnative.dev/docs/upgrading#i-want-to-upgrade-with-react-native-cli-but-i-don-t-use-git

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrading React Native from 0.62.2 to 0.63.0 hangs on blank ...
I tried clearing cache, removing node_modules and pods and then run npm install and pod install. Nothing helped and I still have the...
Read more >
Upgrading to new versions - React Native
Upgrading your Expo project to a new version of React Native requires updating the react-native , react , and expo package versions in...
Read more >
"React Native version mismatch" errors - Expo Documentation
What this error means ... This can happen after upgrading your React Native or Expo SDK version, or when connecting to the wrong...
Read more >
React Native Upgrade Helper
React Native Upgrade Helper logo ... What's your current react-native version? 0.70.6. To which version would you like to upgrade? 0.71.0-rc.5.
Read more >
Upgrade to React Native 0.62 - Matt Oakes
The version of Flow which React Native uses has been updated in 0.62. The means that you need to make sure that the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found