Software Archive
Read-only legacy content
17061 Discussions

iOS build fails using Media plugin

Giorgio_B_1
Beginner
807 Views

Good morning,

i tried on XDK 1621 + cordova 3.5 and XDK 1995 + cordova 4.1.3 tu build an app that plays an MP3 sound.

On Android everything is OK, but on iOS the build fails :( what am i doing wrong?

Thanks

0 Kudos
6 Replies
John_H_Intel2
Employee
807 Views

Does the build succeed when you remove the plugin? What does the build log say?

0 Kudos
Giorgio_B_1
Beginner
807 Views

Yes, the build succeeds if i remove the plugin.

Here is the log.

Thanks

0 Kudos
PaulF_IntelCorp
Employee
807 Views

My bet is that the file plugin is the problem. There is a problem with the build system where it pulls in an old version of the file plugin (because the media plugin requires it), but that old version does not work with the media plugin. You need to explicitly include the file plugin to get a version that will work. The default version the XDK will request, when you select it on the Projects tab, should work.

0 Kudos
Giorgio_B_1
Beginner
807 Views

Well, i'm not actually using the file plugin: i just need Android/iOS support, so i wrote this code:

new Media(
                ( device.platform.toLowerCase() === "android" ? '/android_asset/www/' : '' ) + "sounds/5min.mp3",
                null,
                null,
                function(status){
                    if (status === Media.MEDIA_STOPPED) {
                        myapp.fire.sound.play();
                    }
                }
            );

 

0 Kudos
PaulF_IntelCorp
Employee
807 Views

But the Media plugin will include it, regardless. It uses it internally and it gets automatically included in the build, but that automatic inclusion is failing, so please try including it explicitly in your project settings to see if it resolves the issue...

0 Kudos
Giorgio_B_1
Beginner
807 Views

I included the File plugin and the build was successful.

I tried to remove again the File plugin and the build was successful again! o_O

Maybe the first time i included the plugin something happened that fixed the problem.

Thanks a lot!

0 Kudos
Reply