Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error (Xcode): Undefined symbol #532

Closed
ZhangXingXingo opened this issue May 12, 2023 · 39 comments
Closed

Error (Xcode): Undefined symbol #532

ZhangXingXingo opened this issue May 12, 2023 · 39 comments

Comments

@ZhangXingXingo
Copy link

Error (Xcode): Undefined symbol: OBJC_CLASS$_AddCardToWXCardPackageReq

Error (Xcode): Undefined symbol: OBJC_CLASS$_AddCardToWXCardPackageResp

Error (Xcode): Undefined symbol: OBJC_CLASS$_GetMessageFromWXReq

Error (Xcode): Undefined symbol: OBJC_CLASS$_LaunchFromWXReq

Error (Xcode): Undefined symbol: OBJC_CLASS$_OpenRankListReq

Error (Xcode): Undefined symbol: OBJC_CLASS$_OpenWebviewReq

Error (Xcode): Undefined symbol: OBJC_CLASS$_PayReq

Error (Xcode): Undefined symbol: OBJC_CLASS$_PayResp

Error (Xcode): Undefined symbol: OBJC_CLASS$_SendAuthReq

Error (Xcode): Undefined symbol: OBJC_CLASS$_SendAuthResp

Error (Xcode): Undefined symbol: OBJC_CLASS$_SendMessageToWXReq

Error (Xcode): Undefined symbol: OBJC_CLASS$_SendMessageToWXResp

Error (Xcode): Undefined symbol: OBJC_CLASS$_ShowMessageFromWXReq

Error (Xcode): Undefined symbol: OBJC_CLASS$_WXApi

Error (Xcode): Undefined symbol: OBJC_CLASS$_WXAppExtendObject

Error (Xcode): Undefined symbol: OBJC_CLASS$_WXCardItem

Error (Xcode): Undefined symbol: OBJC_CLASS$_WXChooseCardReq

Error (Xcode): Undefined symbol: OBJC_CLASS$_WXChooseCardResp

Error (Xcode): Undefined symbol: OBJC_CLASS$_WXChooseInvoiceReq

Error (Xcode): Undefined symbol: OBJC_CLASS$_WXChooseInvoiceResp

Error (Xcode): Undefined symbol: OBJC_CLASS$_WXEmoticonObject

Error (Xcode): Undefined symbol: OBJC_CLASS$_WXFileObject

Error (Xcode): Undefined symbol: OBJC_CLASS$_WXImageObject

Error (Xcode): Undefined symbol: OBJC_CLASS$_WXInvoiceAuthInsertResp

Error (Xcode): Undefined symbol: OBJC_CLASS$_WXLaunchMiniProgramReq

Error (Xcode): Undefined symbol: OBJC_CLASS$_WXLaunchMiniProgramResp

Error (Xcode): Undefined symbol: OBJC_CLASS$_WXMediaMessage

Error (Xcode): Undefined symbol: OBJC_CLASS$_WXMiniProgramObject

Error (Xcode): Undefined symbol: OBJC_CLASS$_WXMusicObject

Error (Xcode): Undefined symbol: OBJC_CLASS$_WXNontaxPayResp

Error (Xcode): Undefined symbol: OBJC_CLASS$_WXOpenBusinessViewReq

Error (Xcode): Undefined symbol: OBJC_CLASS$_WXOpenBusinessViewResp

Error (Xcode): Undefined symbol: OBJC_CLASS$_WXOpenBusinessWebViewReq

Error (Xcode): Undefined symbol: OBJC_CLASS$_WXOpenBusinessWebViewResp

Error (Xcode): Undefined symbol: OBJC_CLASS$_WXOpenCustomerServiceReq

Error (Xcode): Undefined symbol: OBJC_CLASS$_WXOpenCustomerServiceResp

Error (Xcode): Undefined symbol: OBJC_CLASS$_WXPayInsuranceResp

Error (Xcode): Undefined symbol: OBJC_CLASS$_WXSubscribeMsgReq

Error (Xcode): Undefined symbol: OBJC_CLASS$_WXSubscribeMsgResp

Error (Xcode): Undefined symbol: OBJC_CLASS$_WXVideoObject

Error (Xcode): Undefined symbol: OBJC_CLASS$_WXWebpageObject

Error (Xcode): Undefined symbol: OBJC_CLASS$_WechatAuthSDK

@ZhangXingXingo
Copy link
Author

4.0.0+2出的这个

@JarvanMo
Copy link
Member

是否带支付

@ZhangXingXingo
Copy link
Author

带支付了的

@JarvanMo
Copy link
Member

GitHub 的action 是跑通了的,你跑 pod install

@1D3E
Copy link

1D3E commented May 12, 2023

同样遇到了这个问题

@1D3E
Copy link

1D3E commented May 12, 2023

GitHub 的action 是跑通了的,你跑 pod install

尝试了 没有效果

@1D3E
Copy link

1D3E commented May 12, 2023

会是版本问题么,以下是我使用的版本
[✓] Flutter (Channel beta, 3.11.0-1.0.pre.1, on macOS 13.3.1 22E772610a darwin-arm64, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.1)
[✓] VS Code (version 1.78.0)
[✓] Connected device (2 available)

@ZhangXingXingo
Copy link
Author

这我的
Flutter 3.10.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 84a1e904f4 (3 days ago) • 2023-05-09 07:41:44 -0700
Engine • revision d44b5a94c9
Tools • Dart 3.0.0 • DevTools 2.23.1

@JarvanMo
Copy link
Member

Mac 是X86还是M1 的

@ZhangXingXingo
Copy link
Author

我的是m2

@1D3E
Copy link

1D3E commented May 12, 2023

Mac 是X86还是M1 的

M1

@JarvanMo
Copy link
Member

看起来应该是CPU 的问题。不过我没有m 的本,正在看看有没有arm 的GitHub action

@JarvanMo
Copy link
Member

最新的3.x,没有问题?就是更换成xc framework的那个版本

@1D3E
Copy link

1D3E commented May 12, 2023

之前我使用的是3.12.2没有问题,今天更新为4.0.2才有这个错误提示的

@1D3E
Copy link

1D3E commented May 12, 2023

最新的3.x,没有问题?就是更换成xc framework的那个版本

这个指的是3.13.0么 我可以尝试一下

@JarvanMo
Copy link
Member

3.12不行,得Fluwx 3.13,3.13才换了xc framework

@JarvanMo
Copy link
Member

试试这个

@1D3E
Copy link

1D3E commented May 12, 2023

我现在尝试了3.12 3.13都出现了同样的问题。

@1D3E
Copy link

1D3E commented May 12, 2023

试试这个

我看下。

@ZhangXingXingo
Copy link
Author

flutter clean && rm ios/Podfile ios/Podfile.lock pubspec.lock && rm -rf ios/Pods ios/Runner.xcworkspace && flutter run
这个是我试了。还是不行

@JarvanMo
Copy link
Member

或者可以新开个项目,然后看看是不是问题依旧。

@alook123
Copy link

alook123 commented May 13, 2023

同样的问题,我也是m1的
另外,新建项目,可以运行,然后导入fluwx就运行不了了。

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.10.0, on macOS 13.3.1 22E772610a darwin-arm64, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.78.2)
[✓] Connected device (3 available)
[✓] Network resources

@JarvanMo
Copy link
Member

麻烦了。没有m 的电脑

@JarvanMo
Copy link
Member

还有你们iOS 端是swift 还是oc

@alook123
Copy link

还有你们iOS 端是swift 还是oc

swift

@JarvanMo
Copy link
Member

看来应该是swift 的问题,开启一下modular header试试

@alook123
Copy link

alook123 commented May 13, 2023

看来应该是swift 的问题,开启一下modular header试试

没理解,这个modular header是怎么开启

@JarvanMo
Copy link
Member

我现在在外面。你搜一下

@mhszeto
Copy link

mhszeto commented May 13, 2023

看来应该是swift 的问题,开启一下modular header试试

没理解,这个modular header是怎么开启

把Podfile target 'Runner' do下面的
use_frameworks! 改成 use_frameworks! :linkage => :static
然后在 Build Settings -> Apple Clang - Language -Modules -> Allow Non-modular Includes In Framework Modules 改成 YES
就可以跑起来了

@JarvanMo
Copy link
Member

@mh

看来应该是swift 的问题,开启一下modular header试试

没理解,这个modular header是怎么开启

把Podfile target 'Runner' do下面的 use_frameworks! 改成 use_frameworks! :linkage => :static 然后在 Build Settings -> Apple Clang - Language -Modules -> Allow Non-modular Includes In Framework Modules 改成 YES 就可以跑起来了

You rock!!!

@alook123
Copy link

看来应该是swift 的问题,开启一下modular header试试

没理解,这个modular header是怎么开启

把Podfile target 'Runner' do下面的 use_frameworks! 改成 use_frameworks! :linkage => :static 然后在 Build Settings -> Apple Clang - Language -Modules -> Allow Non-modular Includes In Framework Modules 改成 YES 就可以跑起来了

可以了,感谢

@jasonhe88
Copy link

jasonhe88 commented May 15, 2023

但是这样修改后会造成其他需要动态链接的Plugin运行出错

看来应该是swift 的问题,开启一下modular header试试

没理解,这个modular header是怎么开启

把Podfile target 'Runner' do下面的 use_frameworks! 改成 use_frameworks! :linkage => :static 然后在 Build Settings -> Apple Clang - Language -Modules -> Allow Non-modular Includes In Framework Modules 改成 YES 就可以跑起来了

@JarvanMo
Copy link
Member

但是这样修改后会造成其他需要动态链接的Plugin运行出错

看来应该是swift 的问题,开启一下modular header试试

没理解,这个modular header是怎么开启

把Podfile target 'Runner' do下面的 use_frameworks! 改成 use_frameworks! :linkage => :static 然后在 Build Settings -> Apple Clang - Language -Modules -> Allow Non-modular Includes In Framework Modules 改成 YES 就可以跑起来了

那你有啥好的解决方案吗?主要是都2023年,微信的framework 还没有模块化。

@JarvanMo
Copy link
Member

微信的Xcframework 没有支持模块化是我没有想到的

@mhszeto
Copy link

mhszeto commented May 15, 2023

fluwx.podspec最下面添加s.static_framework = true
Build Settings -> Apple Clang - Language -Modules -> Allow Non-modular Includes In Framework Modules 改成 YES
这样也行
use_frameworks!就不用改了

@JarvanMo
Copy link
Member

@mhszeto Ok.我改一下。

@jasonhe88
Copy link

但是这样修改后会造成其他需要动态链接的Plugin运行出错

看来应该是swift 的问题,开启一下modular header试试

没理解,这个modular header是怎么开启

把Podfile target 'Runner' do下面的 use_frameworks! 改成 use_frameworks! :linkage => :static 然后在 Build Settings -> Apple Clang - Language -Modules -> Allow Non-modular Includes In Framework Modules 改成 YES 就可以跑起来了

那你有啥好的解决方案吗?主要是都2023年,微信的framework 还没有模块化。

对 podfile 不是很熟悉,正在研究

@jasonhe88
Copy link

fluwx.podspec最下面添加s.static_framework = true Build Settings -> Apple Clang - Language -Modules -> Allow Non-modular Includes In Framework Modules 改成 YES 这样也行 use_frameworks!就不用改了

期待,,,

@JarvanMo
Copy link
Member

感谢 @mhszeto 的提醒,我已经添加了static_framework=true,已发布4.1.0。经过我本机测试,也可以不用加Build Settings -> Apple Clang - Language -Modules -> Allow Non-modular Includes In Framework Modules 。

但要保证Podfile里添加了 use_modular_headers!

target 'Runner' do
  use_frameworks!
  use_modular_headers!

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
  target 'RunnerTests' do
    inherit! :search_paths
  end
end

感谢各位。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants