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

Swift is not supported for static libraries #48

Closed
santiagovazquez opened this issue Mar 18, 2017 · 26 comments
Closed

Swift is not supported for static libraries #48

santiagovazquez opened this issue Mar 18, 2017 · 26 comments

Comments

@santiagovazquez
Copy link
Contributor

Hi,

I just started a project with RN and I'm trying to use this library (I'm not familiar with iOS development).

I followed the steps on the readme. I did not have the bridging header file so I followed: #14

XCode won't compile my project, I'm getting "Swift is not supported for static libraries" for RNVideoProcessing:
screen shot 2017-03-18 at 1 26 02 pm

Thanks in advance for any help you can give me! 😃

@shahen94
Copy link
Owner

@santiagovazquez
Copy link
Contributor Author

santiagovazquez commented Mar 18, 2017

Hi @shahen94, thanks for the quick response!

If I follow the video steps, it works (only iOS). But if I run the command for android set up (react-native link react-native-video-processing), it starts to show that message. Any ideas?

@shahen94
Copy link
Owner

@santiagovazquez seems like you have to link android manually, i'll write about it in readme when i'll have a chance

@shahen94
Copy link
Owner

when you're running react-native link it tries to link ios again, but since react-native can't link Swift library it starts fail again

@santiagovazquez
Copy link
Contributor Author

santiagovazquez commented Mar 18, 2017

@shahen94 Great, thanks for your help! Awesome library!

One last question, is it possible to use an URL as a source?

My code:

const source = 'http://10.5.5.9:8080/videos/DCIM/100GOPRO/GOPR0238.MP4'
ProcessingManager.trim(source, {startTime: 5, endTime: 10})
  .then((data) => console.log(data))
  .catch(e => console.error(e))

I get this error (iOS):
screen shot 2017-03-18 at 7 37 58 pm

It works on my terminal if I do wget 'http://10.5.5.9:8080/videos/DCIM/100GOPRO/GOPR0238.MP4'

@shahen94
Copy link
Owner

Unfortunately no, currently you can't process remote video, VideoPlayer can play that but can't trim/compress or do some processing actions. library still working only with assets-library, do you can give a link from CameraRoll

@shahen94
Copy link
Owner

https://github.com/shahen94/react-native-video-processing/blob/master/ios/RNVideoProcessing/RNVideoTrimmer/RNVideoTrimmer.swift#L206

It's not hard to implement, here we have to download remote video, and after that get info. Just I havent time to work on it , so I'll wait for community

@santiagovazquez
Copy link
Contributor Author

hey @shahen94,

I'm not an iOS developer, so I do not understand completely what I did.

I read this post http://stackoverflow.com/questions/31383655/avassetexportsession-trim-download
and then I changed:
santiagovazquez@5d5755b

Now I'm able to use a remote URL to cut a video (without having to download it) 😄

@shahen94
Copy link
Owner

shahen94 commented Mar 20, 2017

Hey @santiagovazquez .
asset.loadValuesAsynchronously yea, you loaded video info asynchronously, probably that's a better idea than downloading video, great job ! 😄

If you can put back quality options and all functionality and keep only this feature,that would be great.

@santiagovazquez
Copy link
Contributor Author

@shahen94 let me try that and i will do a PR.
thanks for all your help!

@shahen94
Copy link
Owner

@santiagovazquez thanks for contributing !

@rpastorelle
Copy link

rpastorelle commented Jun 27, 2017

@shahen94 I went thru all the steps above & am still having this issue. Xcode automatically created my Bridging Header file inside the RNVideoProcessing group that I created when following the video tutorial. The contents of that file looks like this:

#import "RCTBridgeModule.h"
#import "RNVideoProcessing.h"

I've tried every single combination of imports, such as the following:

#import <RCTRootView.h>
#import <RCTView.h>
#import "RCTBridgeModule.h"
#import "RNVideoProcessing.h"

Do you have any advice for how to get this package working?

Even "Clean" fails...

@shahen94
Copy link
Owner

Can you please copy/past the error messages ?

@rpastorelle
Copy link

@shahen94
Copy link
Owner

@rpastorelle did you run react-native link ?

@rpastorelle
Copy link

rpastorelle commented Jun 28, 2017

@shahen94 I ran react-native link first & had this issue. Then I followed the video tutorial and still have the issue.

@shahen94
Copy link
Owner

Might @santiagovazquez can help you ?

@santiagovazquez
Copy link
Contributor Author

@rpastorelle I recommend you to clone the repo again and follow the video tutorial

@rpastorelle
Copy link

Yeeeahhh. I did that a few times already but I'll give it another shot

@rpastorelle
Copy link

rpastorelle commented Jun 29, 2017

I was able to get this working! A couple notes:

• I did not use react-native link (when I did it caused this issue).
• I did not follow the video setup guide (importing that way also created this issue for me)
I DID follow the manual iOS setup from the README. √

(Also closed #79)

@shahen94
Copy link
Owner

shahen94 commented Jun 29, 2017

@rpastorelle So - You mean that the video demonstration doesn't help ?

Where's the problem, but right now linking this library to project is a main issue. The library we wrote on Swift, and react-native can't link Swift libraries automatically (with react-native link command, facebook/react-native#13030). Sorry for you pain, and glad to hear that you could get it to work

@rpastorelle
Copy link

rpastorelle commented Jun 29, 2017

@shahen94 Nevermind. It only worked because I didn't compile sources. As soon as I did that I have the same issue again. Still can't use the library :/

Is there a version of this that doesn't use Swift? That seems to be creating all my issues

@shahen94
Copy link
Owner

@Gevorg94 can you take a look what could be the problem ?

@shahen94 shahen94 reopened this Jun 29, 2017
@shahen94
Copy link
Owner

shahen94 commented Jun 29, 2017

I just initialized new project, and have been able to compile it with this library,
Please run react-native unlink react-native-video-processing and then again follow to the demo video

@rpastorelle
Copy link

@shahen94 Should I run thru the video demo AND run react-native link or just the video demo?

@rpastorelle
Copy link

rpastorelle commented Jun 29, 2017

@shahen94 I have finally got this working! Life lesson: Never ever use react-native link with this (swift) library. I also think I may have been having issues because I was opening the ios/ folder instead of the .xcodeproj file in Xcode ¯_(ツ)_/¯

Thanks so much for all your attention!

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