4

I'm using react-native version 0.59.5. I need to upgrade my react-native to latest version 61.2. Can someone help me with this. Do I have to make changes with podfile???

React Native Environment Info:
    System:
      OS: macOS 10.14.6
      CPU: (4) x64 Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
      Memory: 2.56 GB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 12.4.0 - /usr/local/bin/node
      npm: 6.9.2 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 13.1, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0
    IDEs:
      Android Studio: 3.5 AI-191.8026.42.35.5900203
      Xcode: 11.1/11A1027 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.8.3 => 16.8.3 
      react-native: 0.59.5 => 0.59.5 
    npmGlobalPackages:
      react-native-cli: 2.0.1

I used react-native upgrade my whole podfile is showing conflicts

Need to upgrade to latest version of react-native in existing project. I got the following error

info No version passed. Fetching latest...
info Fetching diff between v0.59.5 and v0.61.2...
info Applying diff...
warn Excluding files that exist in the template, but not in your project:
  - android/app/src/main/java/com/bublenet/MainActivity.java
  - android/app/src/main/java/com/bublenet/MainApplication.java
  - ios/bublenet-tvOS/Info.plist
  - ios/bublenet.xcodeproj/project.pbxproj
  - ios/bublenet/Info.plist
  - ios/bublenetTests/bublenetTests.m
error Excluding files that failed to apply the diff:
  - App.js
  - android/app/build.gradle
  - android/app/proguard-rules.pro
  - android/build.gradle
  - android/gradlew.bat
  - android/settings.gradle
  - ios/Podfile
  - ios/bublenet.xcworkspace/contents.xcworkspacedata
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.59.5&to=0.61.2
error Automatically applying diff failed. We did our best to automatically upgrade as many files as possible
warn Continuing after failure. Some of the files are upgraded but you will need to deal with conflicts manually
info Installing "react-native@0.61.2" and its peer dependencies...
info Running "git status" to check what changed...
On branch upgrading_rn
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

    new file:   .eslintrc.js
    new file:   .prettierrc.js
    new file:   android/app/debug.keystore
    modified:   android/app/src/main/res/values/styles.xml
    modified:   android/gradle/wrapper/gradle-wrapper.jar
    modified:   android/gradlew
    deleted:    android/keystores/BUCK
    deleted:    android/keystores/debug.keystore.properties
    modified:   package-lock.json
    modified:   package.json

Unmerged paths:
  (use "git reset HEAD <file>..." to unstage)
  (use "git add <file>..." to mark resolution)

    both modified:   .flowconfig
    both modified:   .gitignore
    both modified:   android/gradle.properties
    both modified:   android/gradle/wrapper/gradle-wrapper.properties

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   ios/Podfile.lock
    modified:   ios/bublenet.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings

warn Please run "git diff" to review the conflicts and resolve them
info You may find these resources helpful:
• Release notes: https://github.com/facebook/react-native/releases/tag/v0.61.2
• Manual Upgrade Helper: https://react-native-community.github.io/upgrade-helper/?from=0.59.5&to=0.61.2
• Git diff: https://raw.githubusercontent.com/react-native-community/rn-diff-purge/diffs/diffs/0.59.5..0.61.2.diff
error Upgrade failed. Please see the messages above for details. Run CLI with --verbose flag for more details.
James Matthew
  • 435
  • 1
  • 6
  • 10
  • I just updated my project from 0.59.10 to 0.61.2 via https://react-native-community.github.io/upgrade-helper/ You could use that tool and apply the diff. – Kevin Etore Oct 15 '19 at 11:50
  • Hi @KevinEtore did you just copy paste the difference and just ran it??? Or you gave npm install – James Matthew Oct 15 '19 at 11:57
  • Hi, you should always carefully look at what you copy-paste into your project. `react-native` is not the only dependency you are required to update, so have a look at the libraries you're using and see what changes they require in order to work with react-native 0.60+ – Kevin Etore Oct 15 '19 at 12:10
  • how you copy pasted project.pbxproj – James Matthew Oct 15 '19 at 12:15

1 Answers1

1

in this case try to use this site

react-native-community.github.io/upgrade-helper 

and enter your previous and new version to show diff and manually change misseed files.

sajad abbasi
  • 1,988
  • 2
  • 22
  • 43