Author Topic: Problems with Bass.Net.iOS in the use of Xamain.ios  (Read 51 times)

54tyy76

  • Posts: 2
I am trying to use Xamarin.Form to make my first bass program,

In the .net Standard project
  Added a reference to Bass.Net.dll (from http://www.un4seen.com/download.php?z/4/Bass24.Net.zip\standard\Bass.Net.dll version 2.4.14.1)
  The following code is executed when the program starts:
    Bass.BASS_Init(-1, 44000, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero);


In the Xamarin.Android project
  Added a reference to Bass.Net.Addroid (from: http://www.un4seen.com/download.php?z/4/Bass24.Net.zip\Android\Bass.Net.Android.dll version 2.4.14.1 )
  A folder named "lib" is created under the project root directory, which has multiple subfolders: "arm64-v8a", "armeabi", "armeabi-v7a" "x86", "x86_64", each folder There are libbass.so in them, they come from "http://www.un4seen.com/files/bass24-android.zip\libs\" (updated: 3 Feb '21)

In the Xamarin.iOS project
  Added a reference to Bass.Net.iOS.dll (from: http://www.un4seen.com/download.php?z/4/Bass24.Net.zip\iOS\Bass.Net.iOS.dll version 2.4.14.1)
  Added a native reference to libbass.a (from: "http://www.un4seen.com/files/bass24-ios.zip\libbass.a" updated: 4 Dec '20)
  Set "iOS build -> Linker Behavior" to "Link All"
  Set "iOS build -> Additional mtouch arguments" to:
    -gcc_flags "-L. -lstdc++ -framework AudioToolbox -framework Accelerate"

Xamarin.Android runs successfully
When Xamarin.iOS executes Bass.BASS_Init, an exception occurs:
                System.TypeInitializationException(The type initializer for 'Un4seen.Bass' threw an exception.)
                  System.DllNotFoundException(bass assembly:<unknow assembly> type:<unknown type> number:(null))

How should I correct the settings of Xamarin.iOS?

Thanks.

Ian @ un4seen

  • Administrator
  • Posts: 23470
I'm not a Xamarin or .Net user myself, so I'm afraid I can't help very much with that, but from the "DllNotFoundException" message it looks like the issue may be that it's trying to dynamically load the BASS library. The iOS BASS libraries should be statically linked into the app instead, so please check the Xamarin options for something like that.

radio42

  • Posts: 4716
Unfortunately I have also not much experience with iOS.
But... the Bass.Net.iOS links the bass libs (see the related iOS post) with the following module name: __Internal

This is static linking - but you still need to provide and link in your build environment the related native bass libs.