tvos compilation problem

iOS, iPad, iPhone, tvOS specific usage questions
matrog
Blank Cone
Blank Cone
Posts: 42
Joined: 27 Sep 2015 08:55

Re: tvos compilation problem

Postby matrog » 04 Nov 2015 09:54

I'll do this evening...now I can't access to my mac....it should be bitcode enable but not sure...I'm experimenting a lot so I don't know

matrog
Blank Cone
Blank Cone
Posts: 42
Joined: 27 Sep 2015 08:55

Re: tvos compilation problem

Postby matrog » 04 Nov 2015 19:43

I hope to do not break any rule....

https://mega.nz/#!CJ5zkY7J!bJLOiHbTqBi4 ... P_hZsFrcIA

obia
Blank Cone
Blank Cone
Posts: 20
Joined: 11 Apr 2014 13:34

Re: tvos compilation problem

Postby obia » 04 Nov 2015 20:40

@matrog: tried with your libTVVLCkit.a file but get the same error:

"libTVVLCKit.a(VLCMedia.o)' was built without full bitcode."

Do you get the same result when you do an Archive?

matrog
Blank Cone
Blank Cone
Posts: 42
Joined: 27 Sep 2015 08:55

Re: tvos compilation problem

Postby matrog » 04 Nov 2015 22:07

yes, to be honest I don't remember if I ever tried to archive before

obia
Blank Cone
Blank Cone
Posts: 20
Joined: 11 Apr 2014 13:34

Re: tvos compilation problem

Postby obia » 05 Nov 2015 19:23

Finally got it archived with bitcode enabled!
I post this info because it could be helpful for others.
I looked into the build scripts and found that the correct flag is indeed set, "-fembed-bitcode". No reason to patch or modify anything.
Then I found this post:
https://forum.videolan.org/viewtopic.php?f=36&t=128654

So I followed that advice and removed libTVVLCkit.a and instead imported the whole MobileVLCKit project into my app and linked that. BOOM!

Vibou
Blank Cone
Blank Cone
Posts: 10
Joined: 09 Nov 2015 10:58

Re: tvos compilation problem

Postby Vibou » 09 Nov 2015 12:27

---ISSUE SOLVED SEE END OF MESSAGE
Hi everyone.

I am working onto a Swift Project and I can't get TVVLCKit working. I ve done all the steps from Matrog and the MobileVLCKit compiled.

First I add to

Code: Select all

import UIKit/UIKit.h
into VLCMediaPlayer header file otherwise the compiler complains about Unknown class UIImage afterwards

I use the command:

Code: Select all

lipo -create Debug-appletvos/libTVVLCKit.a Debug-appletvsimulator/libTVVLCKit.a -o libTVVLCKit.a
Everything works fine the libTVVLCKit.a is created.

Here is where it gets tricky.
I import libTVVLCKit.a into my Swift project as well as the headers files created into one of the build folder say "Debug-appletvos/TVVLCKit/*.h"
In order to use this library in Swift I did a bridge file which basically links every header files from TVVLCKit so that it can be used in Swift.

Code: Select all

#import "VLCMedia.h" #import "VLCMediaDiscoverer.h" #import "VLCMediaList.h" #import "VLCMediaPlayer.h" #import "VLCMediaListPlayer.h" #import "VLCMediaThumbnailer.h" #import "VLCTime.h"
The imports are working since I can now use VLCMediaPlayer into my code with auto completion.

However when I try to build the project I have the following error:

Code: Select all

ld: library not found for -lTVVLCKit clang: error: linker command failed with exit code 1 (use -v to see invocation)
This error disappear when I copy and paste de TVVLCKit.a created with the previous command into my project folder

Then 130 new errors appears when compiling:
Image

Is anyone experiencing the same kind of issue ?

I also tried the Workspace thing but I m not sure I did the workspace properly. Would be great to have more detailed step by step procedure to make Workspace with your project and TVVLCKit.

Thanks in advance for your help !

Vincent.

--EDIT

I think I did manage to have the Workspace working. Linking with library is much easier now since I use the Workspace location. But I still have the errors.

I think the TVVLCKit.a it uses is the one for AppleTVOS not the simulator. Does TVVLCKit only works on real device ?

--EDIT Solved
Add libc++ and libiconv to my project. It s compiling successfully !

belkone
New Cone
New Cone
Posts: 1
Joined: 09 Nov 2015 17:04

Re: tvos compilation problem

Postby belkone » 09 Nov 2015 17:20

Hello, I followed these steps:
I did the following
1. downloaded zip file
2.

Code: Select all

./buildMobileVLCKit.sh -t
3.

Code: Select all

./buildMobileVLCKit.sh -t -s
4. Opened MobileVLCKit.xcodeproj in Xcode, switched to TVVLCKit and built successfully for device.
5. built successfully for device simulator
6. Open terminal, go to the folder where Xcode produced libTVVLCKit.a file (for me /Users/xxxxx/Library/Developer/Xcode/DerivedData/MobileVLCKit-cajvscpvucjubqcjljaxxzklzcas/Build/Products/)
7. Run the following to have a static lib for tv and simu

Code: Select all

lipo -create Debug-appletvos/libTVVLCKit.a Debug-appletvsimulator/libTVVLCKit.a -o libTVVLCKit.a
8. Add the new libTVVLCKit.a to your project
at 2nd and 3rd step have generated lots of warnings, but at the end it has been compiled.
Followed the next steps without any errors or warnings.
I got libTVVLCKit.a created by lipo and TVVLCKit's .h files from Build/Products/ and imported it into new tvOS project. I linked libTTVLCKit.a, libc++.tbd and libiconv.tbd.
I tried to this code:

Code: Select all

#import "ViewController.h" #import <TVVLCKit/TVVLCKit.h> @interface ViewController () <VLCMediaPlayerDelegate> { VLCMediaPlayer *_mediaplayer; } @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. _mediaplayer = [[VLCMediaPlayer alloc] init]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } @end
It doesn't compile. I have 51 warnings and 13 errors, here is log:
http://pastebin.com/i7AE39P0

(during building ./buildMobileVLCKit.sh -t terminal shows popup with missing JDK, could it be my problem? without it, after building I can build it without any errors in Xcode..)
Please help me with fix this problem, I spent three days without any success...


Edit:
I compiled tvOS with TVVLCKit successfully. I didn't import AVFoundation/AVKit into my project... ;/ Right now is working correctly ;)

lks
New Cone
New Cone
Posts: 5
Joined: 12 Nov 2015 10:57

Re: tvos compilation problem

Postby lks » 12 Nov 2015 11:05

Hello,

I just got the lib working with the bridging header.
But when I try to build my project I get the following error:

Code: Select all

​Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_VLCMedia", referenced from: type metadata accessor for __ObjC.VLCMedia in ChannelViewController.o "_OBJC_CLASS_$_VLCMediaPlayer", referenced from: type metadata accessor for __ObjC.VLCMediaPlayer in ChannelViewController.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
Image

I have all the lib files, I'm linking to libiconv and libc++.
Image
Image

Can anyone help me?
What am I doing wrong? :/

Thank you!

matrog
Blank Cone
Blank Cone
Posts: 42
Joined: 27 Sep 2015 08:55

Re: tvos compilation problem

Postby matrog » 12 Nov 2015 21:28

@lks... are you compiling for simulator?

lks
New Cone
New Cone
Posts: 5
Joined: 12 Nov 2015 10:57

Re: tvos compilation problem

Postby lks » 13 Nov 2015 10:47

@lks... are you compiling for simulator?
I have tried both. Same error.
For my device and the simulator :/

vtec63
New Cone
New Cone
Posts: 3
Joined: 14 Nov 2015 02:34

Re: tvos compilation problem

Postby vtec63 » 14 Nov 2015 02:42

I'm trying to build libTVVLCKit but I'm seeing a different issue then everyone else. After I run './buildMobileVLCKit.sh -t' and open the Xcode project both "vlc-plugins-iPhone.h" and "vlc-plugins-AppleTV.h" are missing. This obviously leads to a compiler failure since VLCLibrary.m includes them. Am I missing a step somewhere? I was not able to find either of these files in the git project.

matrog
Blank Cone
Blank Cone
Posts: 42
Joined: 27 Sep 2015 08:55

Re: tvos compilation problem

Postby matrog » 14 Nov 2015 07:47

@lks can you describe all the steps you did?

@vtec63

I have this, and you?

Image

lks
New Cone
New Cone
Posts: 5
Joined: 12 Nov 2015 10:57

Re: tvos compilation problem

Postby lks » 14 Nov 2015 11:44

Just tried to compile again and I now have the same error :/
But in my case the iPhone and tvOS .h files are missing.

I have no idea what we are making wrong :/

vtec63
New Cone
New Cone
Posts: 3
Joined: 14 Nov 2015 02:34

Re: tvos compilation problem

Postby vtec63 » 14 Nov 2015 14:43

Yes that is the exact same situation I have. Are those .h files suppose to come from somewhere else?

@lks can you describe all the steps you did?

@vtec63

I have this, and you?

Image

matrog
Blank Cone
Blank Cone
Posts: 42
Joined: 27 Sep 2015 08:55

Re: tvos compilation problem

Postby matrog » 14 Nov 2015 19:15

they should come from building script

vtec63
New Cone
New Cone
Posts: 3
Joined: 14 Nov 2015 02:34

Re: tvos compilation problem

Postby vtec63 » 14 Nov 2015 19:34

I ran the script "./buildMobileVLCKit.sh -t" and received the below output. This is the second time through so it didn't need to download all the remote files. I'm concerned with the error at the end. Could that be the issue?

Code: Select all

[info] Preparing build dirs First, rewinding head to replay your work on top of it... Applying: arm_neon: added function macro to handle the underscore prefix for the iOS ARM ABI Applying: deinterlace/merge: use a macro to fix compilation for iOS Applying: libass: fix text rendering on iOS by providing a font lookup mechanism for the font shipped with Aspen Applying: lib/media player: inherit deinterlace variable to achieve correct value on first use Applying: arm_neon: work-around libtool issue Applying: libvlc/media: re-parse if flags changed Applying: arm_neon: fix iOS linking Applying: disable neon volume plugin Applying: contrib/gcrypt: work-around a libtool limitation Applying: src/misc: fix compilation for OS without fork() Applying: libvlc: hack to disable daemon mode Applying: contrib/gcrypt: fix tvOS compilation Applying: freetype: added a fake font lookup mechanism for iOS to use the packaged demo fonts Applying: libvlc: add preliminary code path to modify quartztext variables on-the-fly HEAD is now at 949032d tls: make vlc_tls_ClientSessionCreate() cancellation-safe Applying: arm_neon: added function macro to handle the underscore prefix for the iOS ARM ABI /Volumes/USB SSD/VLC/VLCKit/MobileVLCKit/ImportedSources/vlc/.git/rebase-apply/patch:60: new blank line at EOF. + warning: 1 line adds whitespace errors. Applying: deinterlace/merge: use a macro to fix compilation for iOS Applying: libass: fix text rendering on iOS by providing a font lookup mechanism for the font shipped with Aspen Applying: lib/media player: inherit deinterlace variable to achieve correct value on first use Applying: arm_neon: work-around libtool issue Applying: libvlc/media: re-parse if flags changed Applying: arm_neon: fix iOS linking Applying: disable neon volume plugin Applying: contrib/gcrypt: work-around a libtool limitation /Volumes/USB SSD/VLC/VLCKit/MobileVLCKit/ImportedSources/vlc/.git/rebase-apply/patch:29: trailing whitespace. /Volumes/USB SSD/VLC/VLCKit/MobileVLCKit/ImportedSources/vlc/.git/rebase-apply/patch:31: trailing whitespace. /Volumes/USB SSD/VLC/VLCKit/MobileVLCKit/ImportedSources/vlc/.git/rebase-apply/patch:35: trailing whitespace. /Volumes/USB SSD/VLC/VLCKit/MobileVLCKit/ImportedSources/vlc/.git/rebase-apply/patch:41: trailing whitespace. /Volumes/USB SSD/VLC/VLCKit/MobileVLCKit/ImportedSources/vlc/.git/rebase-apply/patch:49: trailing whitespace. warning: squelched 1 whitespace error warning: 6 lines add whitespace errors. Applying: src/misc: fix compilation for OS without fork() Applying: libvlc: hack to disable daemon mode Applying: contrib/gcrypt: fix tvOS compilation Applying: freetype: added a fake font lookup mechanism for iOS to use the packaged demo fonts /Volumes/USB SSD/VLC/VLCKit/MobileVLCKit/ImportedSources/vlc/.git/rebase-apply/patch:37: trailing whitespace. fileURL = CFBundleCopyResourceURL(CFBundleGetMainBundle(), warning: 1 line adds whitespace errors. Applying: libvlc: add preliminary code path to modify quartztext variables on-the-fly [info] Building vlc [info] Building libvlc for Apple embedded OS style 'AppleTV' [info] Using aarch64 with SDK version 9.0 usage: dirname path SDKROOT not specified, assuming /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk [info] Building tools ./build.sh: line 38: pushd: //extras/tools: No such file or directory
they should come from building script

matrog
Blank Cone
Blank Cone
Posts: 42
Joined: 27 Sep 2015 08:55

Re: tvos compilation problem

Postby matrog » 15 Nov 2015 07:56

probably this is the problem...it should finish with something like this

Code: Select all

[info] ...vlc_entry__adpcm [info] ...vlc_entry__adjust [info] ...vlc_entry__adaptative [info] ...vlc_entry__file [info] ...vlc_entry__access_mms [info] ...vlc_entry__concat [info] ...vlc_entry__a52 [info] all done

lks
New Cone
New Cone
Posts: 5
Joined: 12 Nov 2015 10:57

Re: tvos compilation problem

Postby lks » 15 Nov 2015 17:27

Can someone post an sucessfully compiled version for the TV? Of course only if this is allowed.
Would be so awesome!

matrog
Blank Cone
Blank Cone
Posts: 42
Joined: 27 Sep 2015 08:55

Re: tvos compilation problem

Postby matrog » 15 Nov 2015 18:12

i hope so

Code: Select all

https://mega.nz/#!7MgAWb6Y!fzjEUMKe6NQfBhGHJaJt4wh6Acw-OSnVQ-aIfCExEXg

lks
New Cone
New Cone
Posts: 5
Joined: 12 Nov 2015 10:57

Re: tvos compilation problem

Postby lks » 16 Nov 2015 08:09

@matrog: Thanks for putting this up, but the download is not working for me :/
Getting this error:
Image

Can also be an MEGA error, just wanted to let you know.

Update:
Now the download is working! (: Problem solved. Thank you!

Vetru85
New Cone
New Cone
Posts: 7
Joined: 16 Nov 2015 21:04

Re: tvos compilation problem

Postby Vetru85 » 16 Nov 2015 21:15

I downloaded the compiled version and I added to my project . On my appletv works perfectly , but when creating archive , I get a bitcode error.
Can you give me a compiled version with correct bitcode?

Thanks

matrog
Blank Cone
Blank Cone
Posts: 42
Joined: 27 Sep 2015 08:55

Re: tvos compilation problem

Postby matrog » 17 Nov 2015 07:44

I'm albe to archive by creating a workspace, add your project and mobilevlc project then compile, you should be able to archive

Vetru85
New Cone
New Cone
Posts: 7
Joined: 16 Nov 2015 21:04

Re: tvos compilation problem

Postby Vetru85 » 17 Nov 2015 18:25

Unfortunately, when I try to compile TVVLCKit not find the file vlc - plugins- AppleTV.h ????
The only solution was to use TVVLCKit.a of matrog but I get the bitcode error.
Can you give me a compiled version with correct bitcode?

Thanks

Vibou
Blank Cone
Blank Cone
Posts: 10
Joined: 09 Nov 2015 10:58

Re: tvos compilation problem

Postby Vibou » 18 Nov 2015 08:59

I experienced the same issue. Try to build it several times with the same option. It finally works for me.
I try build with -t then with -t -s then open xCode try to build but file.h were missing I try to build again with -v -t didnot work then try again with -t and it worked !

I do not really understand I didnt do anything else... hope this still help ...

Vibou
Blank Cone
Blank Cone
Posts: 10
Joined: 09 Nov 2015 10:58

Re: tvos compilation problem

Postby Vibou » 18 Nov 2015 09:06

Another minor issues I experimented is the following one:
Je xcode project alone compile in xcode but when it is included into my workspace of my application and configured the building settings for tvOS i got an error in VLCMediaPlayer.h saying: unknown type name "UIImage". I just added import UIKit
like such:

Code: Select all

#import "UIKit/UIKit.h"
at the beginning of the .h file and it works. Just wanted to let you know about this issue.

In addition, I also had to add to my project the following things:
TVVLCKit.h
libTVVLCKit.a
libc++.tdb
libiconv.tdb

and this is it :) Hope this help people :D


Return to “VLC for iOS, iPadOS and Apple TV”

Who is online

Users browsing this forum: No registered users and 12 guests