PhoneGap,Cordova-插件发行版的问题

内容来源于 Stack Overflow,并遵循CC BY-SA 3.0许可协议进行翻译与使用

  • 回答 (2)
  • 关注 (0)
  • 查看 (27)

我已经安装了Phonegap(3.0.3)和Cordova CLI。

我也运行iOS作为一个平台(确认使用$ cordova platforms ls

我已经安装了插件($ cordova plugins ls

org.apache.cordova.core.dialogs
org.apache.cordova.core.vibration

但是,当我运行此控制台命令($ cordova emulate ios)时,出现以下错误。

Undefined symbols for architecture i386:
  "_AudioServicesAddSystemSoundCompletion", referenced from:
      _playBeep in CDVNotification.o
  "_AudioServicesCreateSystemSoundID", referenced from:
      _playBeep in CDVNotification.o
  "_AudioServicesDisposeSystemSoundID", referenced from:
      _soundCompletionCallback in CDVNotification.o
  "_AudioServicesPlaySystemSound", referenced from:
      _playBeep in CDVNotification.o
      -[CDVVibration vibrate:] in CDVVibration.o
  "_AudioServicesRemoveSystemSoundCompletion", referenced from:
      _soundCompletionCallback in CDVNotification.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/MyApp.app/MyApp normal i386
(1 failure)

我遵循API页面的指导(http://cordova.apache.org/docs/en/edge/cordova_notification_notification.md.html#Notification),下面是我的config.xml文件,MyApp > www > config.xml它导致错误。

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.myapp.myapp" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>MyApp</name>
    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>
    <author email="dev@callback.apache.org" href="http://cordova.io">
        Apache Cordova Team
    </author>
    <plugin name="Notification" value="CDVNotification" />
    <access origin="*" />
    <preference name="fullscreen" value="true" />
    <preference name="webviewbounce" value="true" />   
</widget>

可能是什么问题?我可以如何解决它?

提问于
用户回答回答于

你运行cordova build ios了吗?

然后cordova emulate ios

当你在构建阶段没有将源代码添加到编译源代码时,会发生此错误。请尝试使用以下插件添加插件:

TargetSettings->构建阶段->编译源代码->添加.m类

用户回答回答于

在Xcode项目中添加AudioToolbox框架:

你的目标>构建阶段>与库的链接二进制

单击“+”按钮

选择AudioToolbox.Framework

扫码关注云+社区

领取腾讯云代金券