Author Topic: Some trouble getting started - "Unable to initialise this plugin"  (Read 7081 times)

spoonfed

  • Newbie
  • *
  • Posts: 2
I'm just starting out following this tutorial:
https://musicbee.fandom.com/wiki/Tutorial:_Creating_A_Simple_Plugin

Everything is fine until I check the plugin in MusicBee - it shows up, but when I try to enable it I get this error:
Quote
Unable to initialise this plugin:
You need the latest version of MusicBee to use this plugin

I've tried now with several combinations of the API interface and MusicBee (both portable and not) and I always get the same error. I'm sure I'm doing something silly here but I can't seem to figure it out. Any ideas?

Thanks

phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9346
Based on the error message, I'm going to ask the obvious here because you didn't state it - what version of MB are you using?
Download the latest MusicBee v3.5 or 3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Posting screenshots is here
Searching the forum with Google is  here

spoonfed

  • Newbie
  • *
  • Posts: 2
3.3.7261 P. Also tried with the non-portable, and the last few portable ones from here:
https://getmusicbee.com/forum/index.php?topic=27074.0

As well as a couple random older API interface/example's.

phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9346
Thanks. Since you're using the portable version, I suggest grabbing the latest patch and trying again, just in case Steven has already addressed the issue. See my sig.

If that doesn't work, you'll have to wait until Steven has time to look at it. Unless someone more familiar with developing plug-ins can offer a suggestion.
Download the latest MusicBee v3.5 or 3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Posting screenshots is here
Searching the forum with Google is  here

boroda

  • Sr. Member
  • ****
  • Posts: 4595
mostly probably you have 'null reference' error. try to debug your plugin: debug> connect to process.

thesteezybeezy

  • Newbie
  • *
  • Posts: 1
I was also getting started with plugin dev and was running into this error. Figured out that changing these values in the initialise function fixes the error:

about.MinInterfaceVersion = 30;
about.MinApiRevision = 40;

From what I can gather, the previous values were set too high. Unfortunately I'm not sure if the above values are ideal, or what they do. Perhaps someone with more plugin dev experience can chime in if they know.

boroda

  • Sr. Member
  • ****
  • Posts: 4595
these values are artificial restrictions set by dev. i only wish that mb displays more detailed message if current mb version is too old for plugin.

The Freezing Chicken

  • Newbie
  • *
  • Posts: 4
I know this topic hasn't been replied to in a few months, but since it is linked directly in the comment section of the tutorial and a lot of people seem to stumble upon this, I'm going to lift a little bit of the confusion fog that seems to be going around.

Those two version numbers are used by plugin developers to set a "failsafe" around a plugin.
What does that mean? Let's say your plugin uses a specific API call that has been implemented in version 3.0 of MusicBee, in that case your plugin can't work on versions prior to that, so when the plugin gets installed on one of those older versions it needs to be able to say "listen, I'm too new for you, I can't work". By setting MinInterfaceVersion to 36 and MinApiRevision to 48 (for the 3.0 example) you do exactly this, and that way your plugin will give the infamous message quoted in the first post instead of wreaking havoc or simply crashing.

What I described is when things go as planned, however sometimes one of 3 things happens (or at least I guess  :-\ ):
- The API template project is accidentaly uploaded with pre-set version values that are too high compared to the latest MusicBee ones.
- MusicBee itself is released but the two version are accidentaly left a version behind, while the template gets updated correctly.
- While the above two reasons are probably the most common, it may be because of some bug with the version check, but I think this is very unlikely.

While the third one can only be fixed by Steven (if it ever happens...) you can easily make your plugin work in the first two cases by correctly setting the two versions to match the version of MusicBee you're using, which... uhm... ok maybe I'm blind but I can't find them anywhere  :(  ... maybe the About section would be a great place!  ::) ( ;)  ;)  ;) winking at you Steven  ;)  ;)  ;)  )

so... do you need to play a guessing game?
ABSOLUTELY NOT. Because I made a nice little plugin that shows a MessageBox at MusicBee startup with both the two versions of the MusicBee version you're running  :D
And not only that but I set the minimum versions both to 1, so if for some god-only-knows-why reason you need the two values from an older version of MusicBee it will work fine as long as that version can call the Configure() method of the Plugin (if you don't know just try it and see if the message pops up...  :-X ).



(I'm not submitting a plugin page for such a dumb plugin so I'm putting the link here)

Download API Version Info

TO STOP THE MESSAGEBOX FROM APPEARING JUST DISABLE OR UNINSTALL THE PLUGIN
Last Edit: April 21, 2020, 08:57:25 PM by TheFreezingChicken