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

Spotify SDK dependency #5

Open
endanke opened this issue Dec 12, 2020 · 5 comments
Open

Spotify SDK dependency #5

endanke opened this issue Dec 12, 2020 · 5 comments

Comments

@endanke
Copy link

endanke commented Dec 12, 2020

Hi!

I noticed that the iOS support for SDK was blocked by SE-0272, but as far as I know this is now resolved and with Swift 5.3 we can have binary dependencies. Do you have plans to add support for this or would that break backward compatibility? I'm happy to help you out with the changes if Swift 5.3 is supported by your project.

@ddddxxx
Copy link
Owner

ddddxxx commented Dec 12, 2020

Hi, I'm glad you're interested. I managed to create a wrapper package for SpotifyiOS, but it breaks macOS build. You can try it on master branch with environment variable LX_ENABLE_SPOTIFYIOS. Please note the SpotifyiOS implementation is very old. I just fixed a couple of syntax error, It probably won't work very well (or don't work at all), and I won't get into this anytime soon.

@endanke
Copy link
Author

endanke commented Dec 25, 2020

I think I've found a solution. In the wrapper package the SpotifyiOSWrapper target also need a conditional dependency on SpotifyiOS like .target(name: "SpotifyiOS", condition: .when(platforms: [.iOS])). This way it builds on macOS. I assume this is because the dependencies are resolved for all platforms, but the target can still have different dependencies internally.

However, it looks like I have another issue related to code signing and I couldn't find a solution yet. When I tried to build it for an iOS device I get the following error:
SpotifyiOS.framework: bundle format unrecognized, invalid, or unsuitable Command CodeSign failed with a nonzero exit code
I guess either it has to be re-signed or the signing needs to be turned off for that package, but I couldn't get it working yet.

@endanke
Copy link
Author

endanke commented Jan 5, 2021

I've found a way to fix the code signing error. I'm not sure if this is the right way to do, but I couldn't find any better resources about this so far.
In the original Spotify.framework there's a link to the headers folder and to the binary which are in the /Versions/A subfolder. I noticed that if I move those to the root of the framework and delete the links, then the project builds without a signing issue.

But then it also has an error during runtime which says that an Info.plist is missing from the frameworks inside the xcframework. I've solved that by putting a manually created Info.plist, and then it finally works!

Hopefully this helps. Please check if you know any better ways to do this. If not, I can make a PR with these changes in the wrapper repository.

@andr-ec
Copy link

andr-ec commented Jan 15, 2021

@endanke I'd like to see the changes you've made to the wrapper repository. Do you have a branch on your fork?

@ddddxxx
Copy link
Owner

ddddxxx commented Sep 5, 2021

I've updated SpotifyiOSWrapper to use official xcframework. I also added conditional dependency on SpotifyiOS as @endanke suggested. However I still get While building for macOS, no library for this platform was found in '[...]SpotifyiOS.xcframework' error.

For now the Spotify iOS support is still guarded behind LX_ENABLE_SPOTIFYIOS flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants