Why PublicFrameworks.AddRange always failed with "framework not found" for ios build

Hi friends:
Currently I’m working on some augmented reality stuff by using UE4 and opencv, and here is a part of my *.build.cs:

    if (Target.Platform == UnrealTargetPlatform.IOS)
    {
        PublicFrameworks.AddRange(new string[] { "/Users/<my name>/Documents/opencv2.framework" });
    }
    else if (Target.Platform == UnrealTargetPlatform.Mac)
    {
        PrivateIncludePaths.Add("/usr/local/include");
        PublicAdditionalLibraries.Add("/usr/local/lib/libopencv_core.2.4.9.dylib");
        PublicAdditionalLibraries.Add("/usr/local/lib/libopencv_highgui.2.4.9.dylib");
        PublicAdditionalLibraries.Add("/usr/local/lib/libopencv_imgproc.2.4.9.dylib");
    }

As you can see here: https://.unrealengine.com/showthread.php?49517-Why-PublicFrameworks-AddRange-always-failed-with-quot-framework-not-found-quot

The project works perfect on Mac version, but for the IOS version, I cannot even use the opencv2.framework, during build, then Unreal build system simply report “framework not found /Users//Documents/opencv2.framework”, I 100% make sure the path is right, and I also tried to use this /Users//Documents/opencv2 path, but it still fails…

I found in this thread: https://.unrealengine.com/showthread.php?5869-Accessing-iOS-SDK-possible&highlight=ios+framework, it simply suggest to use publicFrameworks.AddRange, but I really don’t know why cannot find the path.

Can someone tell me do I need to do something else to reference IOS framework? I think I cannot use AddAddtionalLibraries to reference it since in that framework folder, it simply has headers files and a big file named “opencv2”…

If this is a bug, can some one tell me if there are any quick fix for this? My project really depends on opencv.

Thanks

.

In order to determine if this is a bug, please provide more information about your Mac’s specs. You can find this in the Apple menu >About This Mac>More Info> Add the information from this window (serial # not necessary).

We also need the following information from the “System Report:” Apple menu >About This Mac>More Info> System Report>Hardware (All information listed in the “Hardware Overview.”) You can cut and paste this information or provide screen shots, whichever is more convenient.

Thanks,

eh… so sorry I cannot wait to use this feature since my progress…I’ve walk round it.

Glad to hear you were able to find a work around. Could you please provide your workaround steps to help us better address this issue as well as help other users experiencing the same issue?

alright, since I tried to use ios opencv, I reallized that the ios opencv framework just contains a big binary file "opencv2"which is a “.a”, so I use PublicAddtionalFramework.Add(“opencv2”) to add it. However during link it said that the ios opencv cannot find std::__1xxxxxxxx( which is C++ std libirary). So I rebuild the ios opencv framework by modifying the build command: -stdlib=libc++ to -stdlib=libstdc++, and then in build.cs, add specific “.a” as I needed (such as highgui.a).
however it is a pitty that even with this new framework, PublicFrameworks.Add still fails.

Adding Third Party Frameworks is still a bit experimental in UE4. We have one example of it with the TapJoy plugin, but by no means does that cover all possibilities. I do have a task to improve our Third Party Framework support and that is relatively high on the list of tasks, but if you have a workaround for now, then stick with that.

-Pete

Did you finish that task? Is there a better way to include frameworks in 4.8.3?

I ask because I try to add a 3rd party framework (Heyzap-Ads), I managed to compile & package, but it crashes every time I call something from that framework (e.g. initialization of Ad-Id etc.).

Heyzap needs libxml2.2.dylib, and I suspect that this might be the cause for the crash? Do I need to tell UE to link against or include that?

Ya, you’ll need to add that as an extra library to link with. You can do this by adding the path to libxml2.2.a using PublicLibraryPaths.Add() in the plugin’s Build.cs file. Then add libxml2.2.a via PublicAdditionalLibraries.Add(). That should make it so it will link against that as well.

-Pete

Sorry to piggy-back in this question but I believe it’s related.

I’ve tried to add the WindowsAzureMobileServices.framework package using PublicAdditionalFrameworks.Add.

I zipped the framework and can see the unzip in the build log and also have the unzipped framework in my intermediate directory however the code does not compile as the headers are not found.

Are there more required steps than simply adding the framework using the above method?

I’m using UE 4.10.2.

Have you tested the project without the framework being “zipped” at all for debugging purposes (despite seeing it “unzipped” in the build log and having the unzipped framework in your intermediate directory?)

Try that and, if this does not resolve the issue, please supply all logs for your project located here: ~/Library/Logs/Unreal Engine/YourProjectName/

Thanks for the response .

I’ll get those logs to you tonight.

This might be a bust regardless. I’m working on a cross platform Android/iOS game and as far as I can tell there is no method to add the Azure JAR to the Android build for the project without modifying the engine source.

Is that the case?

link text

It looks like this is the problem with the include files.

Is there a way to update the framework search paths using UBT?

It looks like this is the problem:

Is there a way to update the framework search paths from UBT?

When you zipped up the framework, were you on a Mac or on a PC? If you are on a PC, then it will not work as the symlink will not be created and included correctly and the framework include directories will not be found. If the zip was created on a Mac, then make sure there is a symlink which points to the headers for the correct version. See TapJoy as an example.

-Pete

Thanks for the responses Pete.

I’m working exclusively on a Mac at the moment.

Interestingly enough the WindowsAzureMobileServices.framework appears to have folders where you’d expect symlinks. The Headers and Versions/Current folders have duplicates of the files you’d expect from the symlink inside.

Would you still expect the compiler to find the headers in this case? I can’t imagine why they wouldn’t.

I set up a dummy iOS project in Xcode and added the framework, it has exactly the same problem with not being able to find the header files but the StackOverflow response I added (out of order, sorry) suggests Xcode 7 doesn’t automatically update the framework search path for the project. Obviously UBT doesn’t use the Xcode project so I’m a it lost.

I’m guessing I can work around this by adding an include path to the UnzippedFrameworks directory but I haven’t tried that yet to prove it out.

Cheers,
Bruce

Hi Pete,

Sorry to bother you again.

I still can’t get this to work, same problem, clang can’t find the headers.

I’ve included a link to a zip of a basic plugin that I’m using with 4.10.2, would you mind taking a look and letting me know where I’ve gone wrong?

http://1drv.ms/1K9nFbF

Thanks,
Bruce

It’s no problem. I am right in the middle of fixing a pretty nasty issue with code signing on PC, so it may take a couple days before I can take a look at this, but I’ll see what I can do.

-Pete

I think the zip file I uploaded contains a version of my plugin that won’t work.

I’ve tried hacking around and the zip is named MicrosoftAzureMobile.embeddedframework.zip however the framework inside is MicrosoftAzureMobile.framework.

I’ll fix that up tonight.

I’m having the same problem as you. Did you ever find a solution for this?

No, I switched my focus to the AWS C++ SDK rather than Azure.

Something you could try is “installing” your framework to /System/Library/Framework (I think) then including it using PublicFrameworks.

I’ve no idea why it doesn’t work and I couldn’t see any reason in the engine source for it to not work either.