cordova-music-controls-plugin icon indicating copy to clipboard operation
cordova-music-controls-plugin copied to clipboard

Windows 10 Type mismatch exception

Open Virendrabaskar opened this issue 7 years ago • 8 comments

I am getting this exception Exception calling native with command :: MusicControls :: create ::exception=TypeError: Type mismatch Any help ?

Thank you

Virendrabaskar avatar Jun 30 '17 16:06 Virendrabaskar

Can you show us some of your code? What version of the plugin are you using?

BuddyLReno avatar Jun 30 '17 18:06 BuddyLReno

Hi, I am using 2.0.0

In config.xml <plugin name="cordova-plugin-music-controls" spec="~2.0.0" />

In index.js


 function onDeviceReady() {
        document.addEventListener( 'pause', onPause.bind( this ), false );
        document.addEventListener( 'resume', onResume.bind( this ), false );        
        var parentElement = document.getElementById('deviceready');
        var listeningElement = parentElement.querySelector('.listening');
        var receivedElement = parentElement.querySelector('.received');
        listeningElement.setAttribute('style', 'display:none;');
        
        MusicControls.create({
            track: 'Track',        // optional, default : '' 
            artist: 'Artist',                     // optional, default : '' 
            isPlaying: true,                           // optional, default : true 
            dismissable: false,                         // optional, default : false 
            hasPrev   : true,      // show previous button, optional, default: true 
            hasNext   : true,      // show next button, optional, default: true 
            hasClose: false,       // show close button, optional, default: false 
            
        }, function () {
            //Success CB
            receivedElement.setAttribute('style', 'display:block;');
            console.log("SUCCESS");
        }, function () {
            //Error CB
            console.log("ERROR");
        });
    };

I am getting the following console messages adding proxy for MusicControls cordova.js (1015,9)

Exception calling native with command :: MusicControls :: create ::exception=TypeError: Type mismatch cordova.js (993,13)

Thank you

Virendrabaskar avatar Jul 01 '17 04:07 Virendrabaskar

Hi, any update on this issue ?

Virendrabaskar avatar Jul 04 '17 04:07 Virendrabaskar

Sorry, I've been on vacation and haven't had time. What version of ionic native are you using? There was a short period of time where Music Controls were updated but Ionic Native's typescript definitions were not. Music Controls updated with Ionic Native version 3.12.2. Are you using that version also?

I unfortunately don't have a windows 10 device to do any testing. If you have more details on the error, please share them. Sorry for the delay!

BuddyLReno avatar Jul 05 '17 20:07 BuddyLReno

I am using Cordova 6.3.1 and for windows platform cordova-windows 4.4.2

I am getting only this message when I build the project. Exception calling native with command :: MusicControls :: create ::exception=TypeError: Type mismatch cordova.js (993,13)

Virendrabaskar avatar Jul 06 '17 16:07 Virendrabaskar

@Virendrabaskar Can you supply more of the console log output? I assume it's failing exactly at the MusicControls.create line?

@filfat @homerours Do either of you have a windows device to test with?

BuddyLReno avatar Jul 06 '17 16:07 BuddyLReno

Yes , It is failing at the MusicControls.create line.

I am getting only the following console messages adding proxy for MusicControls cordova.js (1015,9)

Exception calling native with command :: MusicControls :: create ::exception=TypeError: Type mismatch cordova.js (993,13) Please refer the screenshot here https://drive.google.com/open?id=0BzMaNY4OqxdqemR0ZjRUcG02RUU for the same.

Thank you

Virendrabaskar avatar Jul 06 '17 17:07 Virendrabaskar

@BuddyLReno I have no windows device :( Sorry...

homerours avatar Jul 15 '17 08:07 homerours