BondGoat / react-native-native-video-player

React native video player, used for Android, iOS. It will lauch a Native Video, not an Embeded Component
GNU General Public License v3.0
50 stars 44 forks source link

Xcode compile error #4

Closed hoseinmobasher closed 6 years ago

hoseinmobasher commented 7 years ago

Hello, I've downloaded your module and tried to compile it, but faced to the following error:

'AppDelegate.h' file not found RNVideoPlayer.h

This error occurred in RNVideoPlayer.h and first line of that. So, how should I do? Where is the AppDelegate.h file?

Thanks in advance

BondGoat commented 7 years ago

Hi @hoseinmobasher ,

Please check Header Search Paths in RNVideoPlayer, is it already added: $(SRCROOT)/../../../ios/HuntersLog -> recursive

It will help RNVideoPlayer interact with AppDelegate.h in root project.

Please try and let me know if you still find any problems.

Thanks.

andrelimawork commented 7 years ago

Hello BondGoat, i'm having the same issue. I've tried what you had sugested in your previous comment and i still get the error. Can you help me, thanks.

BondGoat commented 7 years ago

Hi @andrelimawork ,

Sorry, there's mistake in previous comment, it should be : $(SRCROOT)/../../../ios/[your project source] The number of '../' depends on your folder structure, this path should point to the folder that contain your project's AppDelegate.h

For example my project is HuntersLog, the folder structure is: HuntersLog:

OK, so from above structure, in RNVideoPlayer -> BuildSettings -> Search Path -> Header Search Paths: add '$(SRCROOT)/../../../ios/HuntersLog' -> recursive

Please check your app folder structure and change the approriate path, it should be worked.

BRs.

andrelimawork commented 7 years ago

heheheh thanks for your time, i've figured out it myself. It stays as help for other people with the same problem.

trondwh commented 7 years ago

@BondGoat You can avoid including AppDelegate.h by not using the delegate and instead fetch UIWindow like this:

UIWindow *window = [[UIApplication sharedApplication] keyWindow] ... [window.rootViewController.view addSubview.....

KlavierCat commented 7 years ago

Just run into the same problem and solved it following the owner's suggestion. Uploading this image here for other people who run into the same problem:

screen shot 2017-06-18 at 04 05 41

I saw there is the path $(SRCROOT)/../../../ios/HuntersLog and I change HuntersLog into my own project's name, then it builds successfully.

I have the same project structure as the example given by the owner in his previous answer.

matiasfha commented 6 years ago

But.. if this is a code to be shared, why the HuntersLog folder is hardcoded?

BondGoat commented 6 years ago

Hi @msdark ,

Because this code was first used for my Project, so in order to apply to yours, you need to make some update like what I've shown above, and 1 more reason is that the module use AppDelegate instance so you need to import it from the main project as "$(SRCROOT)/../../../ios/[your project here]".

Thanks.

hungdev commented 5 years ago

hi. I opened 'node_modules/react-native-native-video-player/ios/RNVideoPlayer.xcodeproj' with Xcode and go to Build Settings > Search Paths > Header Search Paths then Edit the path variable from $(SRCROOT)/../../../HuntersLog to $(SRCROOT)/../../../VideoDemo and it can build. But after build success, it gets an error.

screen shot 2018-08-05 at 11 51 32 pm

@BondGoat @KlavierCat @andrelimawork could guys help me?

MahipalV12 commented 5 years ago

hi. I opened 'node_modules/react-native-native-video-player/ios/RNVideoPlayer.xcodeproj' with Xcode and go to Build Settings > Search Paths > Header Search Paths then Edit the path variable from $(SRCROOT)/../../../HuntersLog to $(SRCROOT)/../../../VideoDemo and it can build. But after build success, it gets an error.

screen shot 2018-08-05 at 11 51 32 pm

@BondGoat @KlavierCat @andrelimawork could guys help me?

hi. I opened 'node_modules/react-native-native-video-player/ios/RNVideoPlayer.xcodeproj' with Xcode and go to Build Settings > Search Paths > Header Search Paths then Edit the path variable from $(SRCROOT)/../../../HuntersLog to $(SRCROOT)/../../../VideoDemo and it can build. But after build success, it gets an error.

screen shot 2018-08-05 at 11 51 32 pm

@BondGoat @KlavierCat @andrelimawork could guys help me?

i'm facing same problem ...please help