Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't start ShazamKit #15138

Open
vadd98 opened this issue May 27, 2022 · 6 comments
Open

Can't start ShazamKit #15138

vadd98 opened this issue May 27, 2022 · 6 comments
Assignees
Labels
bug If an issue is a bug or a pull request a bug fix iOS Issues affecting iOS
Milestone

Comments

@vadd98
Copy link

vadd98 commented May 27, 2022

Hi, I'm trying to implement ShazamKit in a MAUI app, by the way I'm always getting an exception when I try to instantiate a SHSession.
I'm using the simulator because at the moment I don't have any physical iPhone to test, by the way a tried a native ShazamKit demo project found on Github on the simulator and it works fine.

Steps to Reproduce

  1. Create a basic MAUI app
  2. Try to instantiate a native SHSession of the iOS platform

Expected Behavior

Instantiate a SHSession

Actual Behavior

Can't instantiate a SHSession.
This is the exception I'm getting:

Could not create an native instance of the type 'ShazamKit.SHSession': the native class hasn't been loaded.
It is possible to ignore this condition by setting ObjCRuntime.Class.ThrowOnInitFailure to false.
at Foundation.NSObject.InitializeObject(Boolean alloced)
at Foundation.NSObject..ctor(NSObjectFlag x)
at ShazamKit.SHSession..ctor()
at Compilero.Mobile.Platforms.iOS.Services.IOsShazamKitService..ctor()

Environment

Version information ``` Xamarin iOS & Mac 15.10.0.1 iOS version 15.0 ```

Build Logs

Example Project (If Possible)

@chamons
Copy link
Contributor

chamons commented May 27, 2022

Initial testing confirms this. I tried setting code signing on my maui project to match an xcode project that works on sim, but so far I'm seeing a difference. Will need to look into it more.

@chamons chamons added this to the Future milestone May 27, 2022
@chamons chamons added bug If an issue is a bug or a pull request a bug fix iOS Issues affecting iOS labels May 27, 2022
@rolfbjarne
Copy link
Member

It doesn't look like ShazamKit is working in the simulator:

That said, Apple might have fixed their simulator support after that was posted.

Could you link us to the ShazamKit project on GitHub you used in the simulator?

@rolfbjarne rolfbjarne added the need-info Waiting for more information before the bug can be investigated label May 30, 2022
@ghost
Copy link

ghost commented May 30, 2022

Hi @vadd98. We have added the "need-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@vadd98
Copy link
Author

vadd98 commented May 30, 2022

Sure, I used this one https://github.com/heysaik/ShazamKit-Demo

I'm aware of that issue, indeed I can't get any Match in the simulator, by the way the whole system works and returns a NoMatch result, while using Xamarin I can't even create the session.

@ghost ghost added need-attention An issue requires our attention/response and removed need-info Waiting for more information before the bug can be investigated labels May 30, 2022
@rolfbjarne
Copy link
Member

Yes, we won't link with ShazamKit because we think it's only available on device:

{ "ShazamKit", "ShazamKit", new Version (15,0), NotAvailableInSimulator},

You can probably work around it by adding this to your csproj:

<PropertyGroup>
    <MtouchExtraArgs>-gcc_flags="-framework ShazamKit"</MtouchExtraArgs>
</PropertyGroup>

@rolfbjarne rolfbjarne removed the need-attention An issue requires our attention/response label May 30, 2022
@vadd98
Copy link
Author

vadd98 commented May 30, 2022

I tried your suggestion and indeed now works in the simulator!
Obviously it does not get any match, by the way I can test the implementation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug If an issue is a bug or a pull request a bug fix iOS Issues affecting iOS
Projects
None yet
Development

No branches or pull requests

4 participants