cocoapods - 需要升级现有项目的RN版本

标签 cocoapods react-native react-native-ios podfile

我使用的是 react-native 版本 0.59.5。我需要将我的 react-native 升级到最新版本 61.2。有人可以帮我弄这个吗。我必须对 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

我使用了 react-native upgrade 我的整个 podfile 都显示冲突

需要在现有项目中升级到最新版本的 react-native。我收到以下错误

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.

最佳答案

在这种情况下尝试使用这个网站

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

并输入您的旧版本和新版本以显示差异并手动更改 misseed 文件。

关于cocoapods - 需要升级现有项目的RN版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58393349/

相关文章:

ios - Xcode 说我的一些 pod 不是 PIE,这样可以吗?

ios - 无法在 Swift 项目中构建 facebook ios SDK

ios - 无法使用CocoaPods安装SDWebImage:“ld:找不到-lSDWebImage的库”

javascript - 如何将弹出组件导入React-Native?

react-native - 样式不适用于 native react 的所有 TextView

ios - 在 React Native 库中使用本地 .xcframework 的 Podspec 文件应该是什么?

ios - 将 Playground 添加到现有工作区(使用 cocoapods)

android - 无法运行应用程序显示安装应用程序失败

react-native - 如何刷新 react native 平面列表上的特定行?

react-native - React Native 版本不匹配