Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phonegap, Cordova - Issue with Plugins

I have installed Phonegap (3.0.3) and the Cordova CLI.

I am also running iOS as a platform (confirmed using $ cordova platforms ls)

I have installed the plugins ($ cordova plugins ls)

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

However, when I run this console command ($ cordova emulate ios), I get the following error.

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)

I have followed the directions from the API page here (http://cordova.apache.org/docs/en/edge/cordova_notification_notification.md.html#Notification) and below is my config.xml file in the MyApp > www > config.xml file which causes the error.

<?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="[email protected]" 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>

Any suggestions what the issue might be, and how I can go about fixing it?

like image 612
Learner-Driver Avatar asked Jul 30 '13 09:07

Learner-Driver


People also ask

How do I access Cordova plugins?

To find a plugin to use in your app, go to the Plugins page at https://cordova.apache.org/plugins/ that provides a registry of core and third-party Cordova plugins.

How plugins are used in Apache Cordova?

A plugin is a package of injected code that allows the Cordova webview within which the app renders to communicate with the native platform on which it runs. Plugins provide access to device and platform functionality that is ordinarily unavailable to web-based apps.


1 Answers

Add AudioToolbox framework in your Xcode project:

Your Target > Build Phases > Link Binary With Libraries

Click the '+' button

Choose AudioToolbox.framework

like image 77
Emerson Yoshinaga Avatar answered Oct 12 '22 04:10

Emerson Yoshinaga