Skip to content
This repository was archived by the owner on Feb 20, 2023. It is now read-only.
This repository was archived by the owner on Feb 20, 2023. It is now read-only.

RN 0.60 iOS 无法运行起来 #500

Closed
@KingAmo

Description

@KingAmo
Contributor
System:
    OS: macOS 10.14.6
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 142.18 MB / 16.00 GB
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 12.3.1 - /usr/local/bin/node
    Yarn: 1.16.0 - /usr/local/bin/yarn
    npm: 6.10.3 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
    Android SDK:
      API Levels: 21, 23, 26, 27, 28
      Build Tools: 23.0.1, 26.0.1, 28.0.3
  IDEs:
    Android Studio: 3.4 AI-183.6156.11.34.5692245
    Xcode: 10.3/10G8 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.8.6 => 16.8.6
    react-native: 0.60.5 => 0.60.5
  npmGlobalPackages:
    react-native-cli: 2.0.1

复现步骤

yarn add react-native-wechat 
react-native link react-native-wechat
cd ios
pod install

这一步报错

Analyzing dependencies
Fetching podspec for `RCTWeChat` from `../node_modules/react-native-wechat`
[!] No podspec found for `RCTWeChat` in `../node_modules/react-native-wechat`

按照#498 (comment)
复制RCTWeChat.podspecnode_modules/react-native-wechat目录下,再执行pod install,pod安装成功


xcode中点击运行按钮,编译报错

ld: '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Fra
meworks/XCTest.framework/XCTest' does not contain bitcode. You must rebuild it with bitcode 
enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable
 bitcode for this target. file 
'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Fra
meworks/XCTest.framework/XCTest' for architecture arm64

Activity

KingAmo

KingAmo commented on Aug 15, 2019

@KingAmo
ContributorAuthor

按照网上的提供的解决方案,在我的项目中的Build Settings中将Enable Bitcode 设置为 NO,再次运行,报错:


 Undefined symbol: _OBJC_CLASS_$_BaseReq

 Undefined symbol: _OBJC_CLASS_$_BaseResp

Undefined symbol: _OBJC_CLASS_$_PayReq

image

KingAmo

KingAmo commented on Aug 15, 2019

@KingAmo
ContributorAuthor

按照#499PR 是能跑起来了,但是,JS报错:
调用WeChat.registerApp('appid');
报错:

Cannot read property 'registerApp' of undefined
changed the title [-]RN 0.60 无法运行起来[/-] [+]RN 0.60 iOS 无法运行起来[/+] on Aug 15, 2019
premillos

premillos commented on Aug 16, 2019

@premillos

看起来是xcode配置的问题

StevenMasini

StevenMasini commented on Aug 22, 2019

@StevenMasini

我发现了,那个 master branch 已经修好了。他们写了一个新的 .podspec

package.json

"react-native-wechat": "yorkie/react-native-wechat#master"

用那版本就没问题了。不知道为什么一年多还没发布新的 npm 版本。

wanghhh

wanghhh commented on Sep 1, 2019

@wanghhh


我也跟你报错一样,楼主解决了吗

wanghhh

wanghhh commented on Sep 1, 2019

@wanghhh

按照网上的提供的解决方案,在我的项目中的Build Settings中将Enable Bitcode 设置为 NO,再次运行,报错:


 Undefined symbol: _OBJC_CLASS_$_BaseReq

 Undefined symbol: _OBJC_CLASS_$_BaseResp

Undefined symbol: _OBJC_CLASS_$_PayReq

image

你解决了吗

jameshuimin

jameshuimin commented on Sep 3, 2019

@jameshuimin

同样的错误,怎么解决的

0xinhua

0xinhua commented on Sep 3, 2019

@0xinhua
Collaborator

@jameshuimin @wanghhh

  1. 建议 package.json 先使用 "react-native-wechat": "yorkie/react-native-wechat#master" 重新安装。
  2. 进入 项目的 ios 目录下使用 CocoaPods 重新安装一下依赖:
    cd /ios
    pod install
jameshuimin

jameshuimin commented on Sep 4, 2019

@jameshuimin

确实有效

wanghhh

wanghhh commented on Sep 25, 2019

@wanghhh

@jameshuimin @wanghhh

  1. 建议 package.json 先使用 "react-native-wechat": "yorkie/react-native-wechat#master" 重新安装。
  2. 进入 项目的 ios 目录下使用 CocoaPods 重新安装一下依赖:
    cd /ios
    pod install

这个方法目前有效

sunlei4076

sunlei4076 commented on Oct 28, 2019

@sunlei4076

当前版本的小程序分享可以使用了吗
我目前使用的是react-native-wechat-with-miniprogram-share,不支持0.60+

0xinhua

0xinhua commented on Oct 28, 2019

@0xinhua
Collaborator

当前版本的小程序分享可以使用了吗
我目前使用的是react-native-wechat-with-miniprogram-share,不支持0.60+

@sunlei4076 Hi, 当前版本不支持小程序分享,下一个 major 版本会支持,目前该 pr 还在开发测试阶段。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @StevenMasini@jameshuimin@0xinhua@wanghhh@sunlei4076

        Issue actions

          RN 0.60 iOS 无法运行起来 · Issue #500 · yorkie/react-native-wechat