Download

Packaging errors when building Android for GearVR!

Hi all, I’m getting errors when packaging my project for GearVR and I have no idea why. It seems fine when GearVR plugin is disabled and I deploy straight to device. I could really use some help on this!

Engine 4.7.6 from source

MainFrameActions: Packaging (Android (ETC2)): UnrealBuildTool: C:/NVPACK/android-ndk-r10d/toolchains/x86-4.9/prebuilt/windows-x86_64/lib/gcc/i686-linux-android/4.9/…/…/…/…/i686-linux-android/bin\ld.exe: error: cannot find -loculus
MainFrameActions: Packaging (Android (ETC2)): UnrealBuildTool: C:/NVPACK/android-ndk-r10d/toolchains/x86-4.9/prebuilt/windows-x86_64/lib/gcc/i686-linux-android/4.9/…/…/…/…/i686-linux-android/bin\ld.exe: error: cannot find -ljpeg
MainFrameActions: Packaging (Android (ETC2)): UnrealBuildTool: G:\UDK\UnrealEngine4Repo\UnrealEngine\Engine\Plugins\Runtime\GearVR\Source\GearVR\Private/GearVR.cpp:99: error: undefined reference to ‘ovr_OnLoad’
MainFrameActions: Packaging (Android (ETC2)): UnrealBuildTool: G:\UDK\UnrealEngine4Repo\UnrealEngine\Engine\Plugins\Runtime\GearVR\Source\GearVR\Private/GearVR.cpp:100: error: undefined reference to ‘ovr_Init’
MainFrameActions: Packaging (Android (ETC2)): UnrealBuildTool: G:\UDK\UnrealEngine4Repo\UnrealEngine\Engine\Plugins\Runtime\GearVR\Source\GearVR\Private/GearVR.cpp:99: error: undefined reference to ‘ovr_OnLoad’
MainFrameActions: Packaging (Android (ETC2)): UnrealBuildTool: G:\UDK\UnrealEngine4Repo\UnrealEngine\Engine\Plugins\Runtime\GearVR\Source\GearVR\Private/GearVR.cpp:100: error: undefined reference to ‘ovr_Init’
MainFrameActions: Packaging (Android (ETC2)): UnrealBuildTool: G:\UDK\UnrealEngine4Repo\UnrealEngine\Engine\Plugins\Runtime\GearVR\Source\GearVR\Private/GearVR.cpp:201: error: undefined reference to ‘OvrHmd’
MainFrameActions: Packaging (Android (ETC2)): UnrealBuildTool: G:\UDK\UnrealEngine4Repo\UnrealEngine\Engine\Plugins\Runtime\GearVR\Source\GearVR\Private/GearVR.cpp:201: error: undefined reference to ‘ovr_GetTimeInSeconds()’
MainFrameActions: Packaging (Android (ETC2)): UnrealBuildTool: G:\UDK\UnrealEngine4Repo\UnrealEngine\Engine\Plugins\Runtime\GearVR\Source\GearVR\Private/GearVR.cpp:201: error: undefined reference to ‘ovrHmd_GetSensorState(ovrHmdStruct*, double, bool)’
MainFrameActions: Packaging (Android (ETC2)): UnrealBuildTool: G:\UDK\UnrealEngine4Repo\UnrealEngine\Engine\Plugins\Runtime\GearVR\Source\GearVR\Private/GearVR.cpp:583: error: undefined reference to ‘ovr_StartPackageActivity’
MainFrameActions: Packaging (Android (ETC2)): UnrealBuildTool: G:\UDK\UnrealEngine4Repo\UnrealEngine\Engine\Plugins\Runtime\GearVR\Source\GearVR\Private/GearVR.cpp:763: error: undefined reference to ‘OvrHmd’
MainFrameActions: Packaging (Android (ETC2)): UnrealBuildTool: G:\UDK\UnrealEngine4Repo\UnrealEngine\Engine\Plugins\Runtime\GearVR\Source\GearVR\Private/GearVR.cpp:763: error: undefined reference to ‘ovr_GetTimeInSeconds()’
MainFrameActions: Packaging (Android (ETC2)): UnrealBuildTool: G:\UDK\UnrealEngine4Repo\UnrealEngine\Engine\Plugins\Runtime\GearVR\Source\GearVR\Private/GearVR.cpp:763: error: undefined reference to ‘ovrHmd_GetSensorState(ovrHmdStruct*, double, bool)’
MainFrameActions: Packaging (Android (ETC2)): UnrealBuildTool: ThirdParty/Oculus/LibOVRMobile/LibOVRMobile_042/VRLib/jni/LibOVR/Include…/Src/Kernel/OVR_Atomic.h:824: error: undefined reference to ‘OVR::lock::RecursiveAttrInit’
MainFrameActions: Packaging (Android (ETC2)): UnrealBuildTool: ThirdParty/Oculus/LibOVRMobile/LibOVRMobile_042/VRLib/jni/LibOVR/Include…/Src/Kernel/OVR_Atomic.h:826: error: undefined reference to ‘OVR::lock::RecursiveAttr’
MainFrameActions: Packaging (Android (ETC2)): UnrealBuildTool: ThirdParty/Oculus/LibOVRMobile/LibOVRMobile_042/VRLib/jni/LibOVR/Include…/Src/Kernel/OVR_Atomic.h:830: error: undefined reference to ‘OVR::lock::RecursiveAttr’
MainFrameActions: Packaging (Android (ETC2)): UnrealBuildTool: G:\UDK\UnrealEngine4Repo\UnrealEngine\Engine\Plugins\Runtime\GearVR\Source\GearVR\Private/GearVR.cpp:1286: error: undefined reference to ‘ovr_EnterVrMode’
MainFrameActions: Packaging (Android (ETC2)): UnrealBuildTool: G:\UDK\UnrealEngine4Repo\UnrealEngine\Engine\Plugins\Runtime\GearVR\Source\GearVR\Private/GearVR.cpp:1299: error: undefined reference to ‘OvrHmd’
MainFrameActions: Packaging (Android (ETC2)): UnrealBuildTool: G:\UDK\UnrealEngine4Repo\UnrealEngine\Engine\Plugins\Runtime\GearVR\Source\GearVR\Private/GearVR.cpp:1299: error: undefined reference to ‘ovr_GetTimeInSeconds()’
MainFrameActions: Packaging (Android (ETC2)): UnrealBuildTool: G:\UDK\UnrealEngine4Repo\UnrealEngine\Engine\Plugins\Runtime\GearVR\Source\GearVR\Private/GearVR.cpp:1299: error: undefined reference to ‘ovrHmd_GetSensorState(ovrHmdStruct*, double, bool)’
MainFrameActions: Packaging (Android (ETC2)): UnrealBuildTool: G:\UDK\UnrealEngine4Repo\UnrealEngine\Engine\Plugins\Runtime\GearVR\Source\GearVR\Private/GearVR.cpp:1378: error: undefined reference to ‘ovr_LeaveVrMode’
MainFrameActions: Packaging (Android (ETC2)): UnrealBuildTool: G:\UDK\UnrealEngine4Repo\UnrealEngine\Engine\Plugins\Runtime\GearVR\Source\GearVR\Private/GearVR.cpp:1587: error: undefined reference to ‘TanAngleMatrixFromProjection(ovrMatrix4f_ const&)’
MainFrameActions: Packaging (Android (ETC2)): UnrealBuildTool: G:\UDK\UnrealEngine4Repo\UnrealEngine\Engine\Plugins\Runtime\GearVR\Source\GearVR\Private/GearVR.cpp:1591: error: undefined reference to ‘TanAngleMatrixFromProjection(ovrMatrix4f_ const&)’
MainFrameActions: Packaging (Android (ETC2)): UnrealBuildTool: G:\UDK\UnrealEngine4Repo\UnrealEngine\Engine\Plugins\Runtime\GearVR\Source\GearVR\Private/GearVR.cpp:1530: error: undefined reference to ‘ovr_WarpSwap’

Thanks,
Jon

Does Engine/Source/ThirdParty/Oculus/LibOVRMobile exist, along with what looks like valid content such as headers and libs?

The errors indicate that the build is unable to find these for some reason.

Which packages settings are you using? Perhaps double check they are matching:

(although I would disable full rebuild to speed up packaging times)

Hi both,

Yeah that directory has files in there, all looks to be fine - thats why I don’t understand! :frowning:

aussieburger: My settings are the same as in that image, except I’m in development mode not shipping.

I may do a full clean and rebuild of the engine, that should do the trick, right? I really didn’t want to do that as it takes forever.

Re-run generateprojectfiles with the plugin enabled, do one Development/Android build of your project or UE4, and reattempt? Might need a bit of a nudge.

I just tried that but no luck. I’ve just cleaned and doing a full rebuild of the engine now. Hopefully that solves it.

I’m still getting the same error after a full engine clean and rebuild. Not sure what else to try, any suggestions?

Thanks

Seems to be working now that I completely recompiled the engine and project and enabled oculus plugin as well as gearVR plugin and tweaked some other settings.

Thanks for your help! Much appreciated.