react-native-spotify icon indicating copy to clipboard operation
react-native-spotify copied to clipboard

Building react-native-spotify 1.2.11 with 0.61.1

Open patrice4github opened this issue 5 years ago • 30 comments

I'm sorry, this is more a question than an issue.

Thanks for your solid work on this library it is very useful to me. I know Spotify is going to the remote version of the API, but in the mean time, I'd like build it locally to investigate an issue.

It stopped working properly after I upgraded to RN 0.61.1. I can no longer login. The web view appears a bit, and closes right away.

I'm trying to build it in the mean time to diagnose this but I can't. Can I ask about your setup?

Screen Shot 2019-10-02 at 10 11 16 AM

I have clone ancillary modules at the same level:

Screen Shot 2019-10-02 at 10 06 20 AM

I'm looking at the project includes

Screen Shot 2019-10-02 at 9 51 05 AM

Were you able to test 1.2.11 on IOS yesterday? I can't where <SpotifyAudioPlayback/SpotifyAudioPlayback.h> is going to be found from these locations.

Any help will be appreciated.

patrice4github avatar Oct 02 '19 14:10 patrice4github

So I've had this issue too, but it only seemed to happen on the iPhone 8 simulator on iOS 13. The iPhone 11 simulators seemed to work fine. It seems like a bug in iOS, but I'm not entirely sure at this point.

Can you let me know if you see something like this in your logs?

[ProcessSuspension] 0x1195f67b0 - ProcessAssertion::processAssertionWasInvalidated()

As for the include issue, not sure what's up with that. Might have something to do with the fact that I updated the submodule repos to point at my forked Spotify SDK repos. I'll take a look at that.

lufinkey avatar Oct 02 '19 14:10 lufinkey

Can you also see if passing {showDialog:true} to your login function fixes the issue?

lufinkey avatar Oct 02 '19 14:10 lufinkey

"{showDialog:true}" doesn't help. The dialog still opens up but it's only a flicker. It closes right away...

On Wed, Oct 2, 2019 at 10:59 AM Luis Finke [email protected] wrote:

Can you also see if passing {showDialog:true} to your login function fixes the issue?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lufinkey/react-native-spotify/issues/144?email_source=notifications&email_token=AANFW7RWMZIS5OJCIZQAPWTQMSZMRA5CNFSM4I4XBTCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAFB4YA#issuecomment-537534048, or mute the thread https://github.com/notifications/unsubscribe-auth/AANFW7SJMCBJ3V3P3KQNSRDQMSZMRANCNFSM4I4XBTCA .

patrice4github avatar Oct 02 '19 15:10 patrice4github

So the framework should be included directly. Can you make sure that node_modules/rn-spotify-sdk/ios/external/SpotifySDK has the frameworks inside it?

lufinkey avatar Oct 02 '19 15:10 lufinkey

You shouldn't need to clone the frameworks yourself

lufinkey avatar Oct 02 '19 15:10 lufinkey

Can you also see if the project works when you use an older version of the module? Can you force it to use 1.2.10?

lufinkey avatar Oct 02 '19 15:10 lufinkey

[ProcessSuspension] 0x1195f67b0 - ProcessAssertion:: processAssertionWasInvalidated()

Yes I do.

On Wed, Oct 2, 2019 at 11:04 AM Luis Finke [email protected] wrote:

You shouldn't need to clone the frameworks yourself

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lufinkey/react-native-spotify/issues/144?email_source=notifications&email_token=AANFW7VWG4ANH6VGTBF5YMDQMS2BDA5CNFSM4I4XBTCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAFCQ6I#issuecomment-537536633, or mute the thread https://github.com/notifications/unsubscribe-auth/AANFW7V2ZELACJXYSQFM7FDQMS2BDANCNFSM4I4XBTCA .

patrice4github avatar Oct 02 '19 15:10 patrice4github

Cool so that confirms we have the same bug with the web view disappearing

lufinkey avatar Oct 02 '19 15:10 lufinkey

Please try with 1.2.10 and let me know if you still encounter the bug

lufinkey avatar Oct 02 '19 15:10 lufinkey

Yes it has been working for a few weeks:

0.60.5 : 1.2.10 Yes 0.61.1 : 1.2.10 No 0.61.1 : 1.2.11 No

Unfortunately, I upgraded my box to xCode 11 inadvertently and 0.60.5 stopped working with a weird error. I seem stuck with 0.61.1.

On Wed, Oct 2, 2019 at 11:07 AM Luis Finke [email protected] wrote:

Can you also see if the project works when you use an older version of the module? Can you force it to use 1.2.10?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lufinkey/react-native-spotify/issues/144?email_source=notifications&email_token=AANFW7RZTTCZCS5CBIH6V5LQMS2KRA5CNFSM4I4XBTCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAFCZWQ#issuecomment-537537754, or mute the thread https://github.com/notifications/unsubscribe-auth/AANFW7TW3OXFEDVVXQ4IWILQMS2KRANCNFSM4I4XBTCA .

patrice4github avatar Oct 02 '19 15:10 patrice4github

By Yes, I meant it was working for this version pair.

"So the framework should be included directly. Can you make sure that node_modules/rn-spotify-sdk/ios/external/SpotifySDK has the frameworks inside it?"

You mean, I'd have to npm install rn-spotify-sdk to build the actual sdk it self? Or it's just to get the framework?

On Wed, Oct 2, 2019 at 11:10 AM Patrice Gagnon [email protected] wrote:

Yes it has been working for a few weeks:

0.60.5 : 1.2.10 Yes 0.61.1 : 1.2.10 No 0.61.1 : 1.2.11 No

Unfortunately, I upgraded my box to xCode 11 inadvertently and 0.60.5 stopped working with a weird error. I seem stuck with 0.61.1.

On Wed, Oct 2, 2019 at 11:07 AM Luis Finke [email protected] wrote:

Can you also see if the project works when you use an older version of the module? Can you force it to use 1.2.10?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lufinkey/react-native-spotify/issues/144?email_source=notifications&email_token=AANFW7RZTTCZCS5CBIH6V5LQMS2KRA5CNFSM4I4XBTCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAFCZWQ#issuecomment-537537754, or mute the thread https://github.com/notifications/unsubscribe-auth/AANFW7TW3OXFEDVVXQ4IWILQMS2KRANCNFSM4I4XBTCA .

patrice4github avatar Oct 02 '19 15:10 patrice4github

Still no luck going back 1.2.10, as I was yesterday. Same behavior, really looks like a 0.61.1 related issue.

On Wed, Oct 2, 2019 at 11:17 AM Patrice Gagnon [email protected] wrote:

By Yes, I meant it was working for this version pair.

"So the framework should be included directly. Can you make sure that node_modules/rn-spotify-sdk/ios/external/SpotifySDK has the frameworks inside it?"

You mean, I'd have to npm install rn-spotify-sdk to build the actual sdk it self? Or it's just to get the framework?

On Wed, Oct 2, 2019 at 11:10 AM Patrice Gagnon [email protected] wrote:

Yes it has been working for a few weeks:

0.60.5 : 1.2.10 Yes 0.61.1 : 1.2.10 No 0.61.1 : 1.2.11 No

Unfortunately, I upgraded my box to xCode 11 inadvertently and 0.60.5 stopped working with a weird error. I seem stuck with 0.61.1.

On Wed, Oct 2, 2019 at 11:07 AM Luis Finke [email protected] wrote:

Can you also see if the project works when you use an older version of the module? Can you force it to use 1.2.10?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lufinkey/react-native-spotify/issues/144?email_source=notifications&email_token=AANFW7RZTTCZCS5CBIH6V5LQMS2KRA5CNFSM4I4XBTCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAFCZWQ#issuecomment-537537754, or mute the thread https://github.com/notifications/unsubscribe-auth/AANFW7TW3OXFEDVVXQ4IWILQMS2KRANCNFSM4I4XBTCA .

patrice4github avatar Oct 02 '19 15:10 patrice4github

Yeah that's what I was worried about. I think it an iOS bug. The odd thing is I retested my other project on the simulator again and the bug seems to have gone away. Not sure what that means.

Also the Spotify streaming SDK frameworks should be included in the node module folder when you install it via npm install rn-spotify-sdk. You just need to add the framework search path

lufinkey avatar Oct 02 '19 16:10 lufinkey

You lost me there. My framework search patch seems correct: [image: Screen Shot 2019-10-02 at 1.00.47 PM.png] I have an import not found, will the framework search path help? I don't see that you include node_module in your header search path, I'm still curious as to where this one resolves:

[image: Screen Shot 2019-10-02 at 12.59.35 PM.png]

On Wed, Oct 2, 2019 at 12:53 PM Luis Finke [email protected] wrote:

Yeah that's what I was worried about. I think it an iOS bug. The odd thing is I retested my other project on the simulator again and the bug seems to have gone away. Not sure what that means.

Also the Spotify streaming SDK frameworks should be included in the node module folder when you install it via npm install rn-spotify-sdk. You just need to add the framework search path

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lufinkey/react-native-spotify/issues/144?email_source=notifications&email_token=AANFW7WXJZGVRB5C5OUST23QMTGZDA5CNFSM4I4XBTCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAFOAXQ#issuecomment-537583710, or mute the thread https://github.com/notifications/unsubscribe-auth/AANFW7QVYSUJTT2DVOTOF5DQMTGZDANCNFSM4I4XBTCA .

patrice4github avatar Oct 02 '19 17:10 patrice4github

It's not a header search path. It's a framework search path. They're different. The README explains where you need to add it.

lufinkey avatar Oct 02 '19 17:10 lufinkey

Screen Shot 2019-10-02 at 1 08 52 PM

lufinkey avatar Oct 02 '19 17:10 lufinkey

Also whatever images you attached are not visible to me

lufinkey avatar Oct 02 '19 17:10 lufinkey

My framework search patch seems correct:

Screen Shot 2019-10-02 at 1 13 24 PM

I have an import not found, will the framework search path help? I don't see that you include node_modules in your header search path, I'm still curious as to where this one resolves. Where is your node_modules direct compared to react-native-spotify?

Screen Shot 2019-10-02 at 1 14 19 PM Screen Shot 2019-10-02 at 1 14 47 PM

patrice4github avatar Oct 02 '19 17:10 patrice4github

So again, that's not framework search paths. That's header search paths. They're different things. You need to add the framework search path where the README specifies

lufinkey avatar Oct 02 '19 17:10 lufinkey

I'm confused as to what you're trying to do? It looks like you've just cloned this project and are just trying to build it individually, which is not how react native works. You need to have a root project and add this as a npm dependency. The project will not build on its own

lufinkey avatar Oct 02 '19 17:10 lufinkey

Ah! I was trying to build it on it own. Well that sums it up... I'll retest your example app with 0.61.1 see how far I can get.

Thanks.

On Wed, Oct 2, 2019 at 1:29 PM Luis Finke [email protected] wrote:

I'm confused as to what you're trying to do? It looks like you've just cloned this project and are just trying to build it individually, which is not how react native works. You need to have a root project and add this as a npm dependency. The project will not build on its own

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lufinkey/react-native-spotify/issues/144?email_source=notifications&email_token=AANFW7RMPXYB4M3VYQJZRALQMTK6TA5CNFSM4I4XBTCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAFRRAI#issuecomment-537598081, or mute the thread https://github.com/notifications/unsubscribe-auth/AANFW7TWZBCVCTZ2W52H27DQMTK6TANCNFSM4I4XBTCA .

patrice4github avatar Oct 02 '19 17:10 patrice4github

I wanted to chime in and say I'm getting the same error with React/RCTDefines.h file not being found. It was working with 0.60.5, but as soon as I upgraded, the build process fails.

React Native: 0.61.2 RNSpotify: 1.2.10

therealaldo avatar Oct 03 '19 03:10 therealaldo

About the Auth screen that no longer appears, I'm trying to understand the code logic: In RNSpotifyAuthController.m, we can read:

Screen Shot 2019-10-03 at 2 16 49 PM

Now, the decisionHandler gets a PolicyAllow because canHandleRedirectURL returns false and the login page never appears.

The canHandleRedirectURL looks like this:

Screen Shot 2019-10-03 at 2 11 11 PM Screen Shot 2019-10-03 at 2 10 57 PM

The auth page flickers and I don't have a chance to login.

The url (accounts.spotify.com) must have a prefix of the url for my mobile app in the Spotify Dashboard? Why this hasPrefix check?

The example app has:

	const spotifyOptions = {
	    "redirectURL":"examplespotifyapp://auth",

For mobile, there's no web redirection per se, it only has to match one of the values in the Spotify Dashboard. Am I missing something?

patrice4github avatar Oct 03 '19 18:10 patrice4github

This is a prefix check for the redirect URL. When it sees that the page is navigating to the redirect URL, it stops the navigation, grabs the values from the redirect URL, and closes the login page. As you've shown, canHandleRedirectURL is returning NO, thereby allowing the web page to continue loading. If it detects that it's navigating to a redirect URL, then it will close. However, the web view is closing despite never hitting a redirect URL. As far as I can tell, that bug does not have anything to do with this piece of code.

lufinkey avatar Oct 03 '19 18:10 lufinkey

jowabo://auth is not the prefix of https://accounts.spotify.com/authorize?clie...., so the page is allowed to continue loading

lufinkey avatar Oct 03 '19 18:10 lufinkey

Thanks much of the prompt feedback. I'm tying to understand your code only. It looks great, works well and hasn't changed. I went back to xCode 10.3 thinking that issue started occurring after my upgrade to 11.0. It must have been a coincidence...

On Thu, Oct 3, 2019 at 2:30 PM Luis Finke [email protected] wrote:

This is a prefix check for the redirect URL. When it sees that the page is navigating to the redirect URL, it stops the navigation, grabs the values from the redirect URL, and closes the login page. As you've shown, canHandleRedirectURL is returning NO, thereby allowing the web page to continue loading. If it detects that it's navigating to a redirect URL, then it will close. However, the web view is closing despite never hitting a redirect URL. As far as I can tell, that bug does not have anything to do with this piece of code.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lufinkey/react-native-spotify/issues/144?email_source=notifications&email_token=AANFW7SY25ZFG62V5X7O4XTQMY24LA5CNFSM4I4XBTCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAJETFA#issuecomment-538069396, or mute the thread https://github.com/notifications/unsubscribe-auth/AANFW7T6AUZ7JLSLMCJWVPLQMY24LANCNFSM4I4XBTCA .

patrice4github avatar Oct 03 '19 18:10 patrice4github

Right, Thanks, it closes for another reason.

On Thu, Oct 3, 2019 at 2:32 PM Luis Finke [email protected] wrote:

jowabo://auth is not the prefix of https://accounts.spotify.com/authorize?clie...., so the page is allowed to continue loading

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lufinkey/react-native-spotify/issues/144?email_source=notifications&email_token=AANFW7VX6SREOVECAKS7MALQMY3DXA5CNFSM4I4XBTCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAJEZEI#issuecomment-538070161, or mute the thread https://github.com/notifications/unsubscribe-auth/AANFW7V23ECBEMVCMDL2WI3QMY3DXANCNFSM4I4XBTCA .

patrice4github avatar Oct 03 '19 18:10 patrice4github

My issue got resolved when I installed the package via Cocoapods instead of doing the manual install. When I tried reinstalling the packages, the error didn't come up for this package, but for react-native-events. I still am not sure what caused the issue to begin with.

therealaldo avatar Oct 04 '19 02:10 therealaldo

I have had a ton of luck with this:

https://github.com/openbakery/gradle-xcodePlugin

I'm gonna call this "the best thing that happened to Xcode ever".

It tells you everything that works and doesn't. The minimal build.gradle in the Usage section is sufficient for me.

patrice4github avatar Oct 04 '19 16:10 patrice4github

@therealaldo were you able to fix issues with react-native-events? I'm trying to install with cocoapods. I've added this

pod 'RNEventEmitter', :path => '../node_modules/react-native-events'
pod 'RNSpotify', :path => '../node_modules/rn-spotify-sdk'

to Podfile.

and had to run yarn add react-native-events in order for pod install to work.

But after that I'm getting a ton of errors related to react-native-events after building: image

were you able to solve that?

hbarylskyi avatar Nov 26 '19 09:11 hbarylskyi