在安装org.apache.cordova.network-information之后,Cordova构建在iOS上导致错误

 我也不走了_931_327 发布于 2023-01-07 17:13

嗨,我刚刚开始使用cordova项目的新结构,我需要安装这个插件org.apache.cordova.network-information.

我使用的是cordova 3.5.0.

安装它并运行cordova build之后我遇到了这个错误:

    Undefined symbols for architecture i386:
  "_SCNetworkReachabilityCreateWithAddress", referenced from:
      +[CDVReachability reachabilityWithAddress:] in CDVReachability.o
  "_SCNetworkReachabilityCreateWithName", referenced from:
      +[CDVReachability reachabilityWithHostName:] in CDVReachability.o
  "_SCNetworkReachabilityGetFlags", referenced from:
      -[CDVReachability connectionRequired] in CDVReachability.o
      -[CDVReachability currentReachabilityStatus] in CDVReachability.o
  "_SCNetworkReachabilityScheduleWithRunLoop", referenced from:
      -[CDVReachability startNotifier] in CDVReachability.o
  "_SCNetworkReachabilitySetCallback", referenced from:
      -[CDVReachability startNotifier] in CDVReachability.o
  "_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from:
      -[CDVReachability stopNotifier] in CDVReachability.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **


The following build commands failed:
    Ld build/emulator/EconnectHybrid.app/EconnectHybrid normal i386
(1 failure)
Command finished with error code 65: /Users/dev/Development/ncoi-econnect-hybrid/platforms/ios/cordova/build 
Error: /Users/dev/Development/ncoi-econnect-hybrid/platforms/ios/cordova/build: Command failed with exit code 65
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:755:16)
    at Process.ChildProcess._handle.onexit (child_process.js:822:5)
isdc30408:ncoi-econnect-hybrid dev$ 

如果我尝试从XCODE构建,我会收到此错误:

    Undefined symbols for architecture armv7:
  "_SCNetworkReachabilityGetFlags", referenced from:
      -[CDVReachability connectionRequired] in CDVReachability.o
      -[CDVReachability currentReachabilityStatus] in CDVReachability.o
  "_SCNetworkReachabilityCreateWithAddress", referenced from:
      +[CDVReachability reachabilityWithAddress:] in CDVReachability.o
  "_SCNetworkReachabilityCreateWithName", referenced from:
      +[CDVReachability reachabilityWithHostName:] in CDVReachability.o
  "_SCNetworkReachabilityScheduleWithRunLoop", referenced from:
      -[CDVReachability startNotifier] in CDVReachability.o
  "_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from:
      -[CDVReachability stopNotifier] in CDVReachability.o
  "_SCNetworkReachabilitySetCallback", referenced from:
      -[CDVReachability startNotifier] in CDVReachability.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

SunshinyDoyl.. 8

听起来像是SystemConfiguration.framework应该由org.apache.cordova.network-information插件自动添加,但事实并非如此.

我最后根据以下注释手动添加了SystemConfiguration.frameworkin Build Phases > Link Binary With Libraries,并为我修复了它:

https://issues.apache.org/jira/browse/CB-6443

1 个回答
  • 听起来像是SystemConfiguration.framework应该由org.apache.cordova.network-information插件自动添加,但事实并非如此.

    我最后根据以下注释手动添加了SystemConfiguration.frameworkin Build Phases > Link Binary With Libraries,并为我修复了它:

    https://issues.apache.org/jira/browse/CB-6443

    2023-01-07 17:15 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有