Unity-Technologies / arfoundation-samples

Example content for Unity projects based on AR Foundation
Other
3.03k stars 1.13k forks source link

Updating ARFoundation package issues. #207

Closed tiancaipipi110 closed 5 years ago

tiancaipipi110 commented 5 years ago

Updating to ARFoundation 1.5.0-preview-5, ARCore-2.1.0-preview-5, ARKit-2.2.0-preview-1, with Unity 2018.3.0f1 is showing me 20 errors(listing some of them):

Library\PackageCache\com.unity.xr.arfoundation@1.5.0-preview.5\Runtime\AR\ARFace.cs(18,46): error CS0246: The type or namespace name 'XRFace' could not be found (are you missing a using directive or an assembly reference?)
Library\PackageCache\com.unity.xr.arfoundation@1.5.0-preview.5\Runtime\AR\ARFace.cs(103,34): error CS0246: The type or namespace name 'XRFaceSubsystem' could not be found (are you missing a using directive or an assembly reference?)
Library\PackageCache\com.unity.xr.arfoundation@1.5.0-preview.5\Runtime\AR\ARFaceManager.cs(21,9): error CS0246: The type or namespace name 'XRFaceSubsystem' could not be found (are you missing a using directive or an assembly reference?)
Library\PackageCache\com.unity.xr.arfoundation@1.5.0-preview.5\Runtime\AR\ARFaceManager.cs(23,9): error CS0246: The type or namespace name 'XRFace' could not be found (are you missing a using directive or an assembly reference?)
Library\PackageCache\com.unity.xr.arfoundation@1.5.0-preview.5\Runtime\AR\ARFaceManager.cs(22,9): error CS0246: The type or namespace name 'XRFaceSubsystemDescriptor' could not be found (are you missing a using directive or an assembly reference?)
Library\PackageCache\com.unity.xr.arcore@2.1.0-preview.5\Runtime\ARCoreFaceSubsystem.cs(129,28): error CS0246: The type or namespace name 'IProvider' could not be found (are you missing a using directive or an assembly reference?)
Library\PackageCache\com.unity.xr.arcore@2.1.0-preview.5\Runtime\ARCoreFaceSubsystem.cs(134,26): error CS0246: The type or namespace name 'IProvider' could not be found (are you missing a using directive or an assembly reference?)
Library\PackageCache\com.unity.xr.arcore@2.1.0-preview.5\Runtime\ARCoreFaceSubsystem.cs(129,38): error CS0115: 'ARCoreFaceSubsystem.CreateProvider()': no suitable method found to override
Library\PackageCache\com.unity.xr.arcore@2.1.0-preview.5\Runtime\ARCoreFaceSubsystem.cs(17,40): error CS0246: The type or namespace name 'XRFaceSubsystem' could not be found (are you missing a using directive or an assembly reference?)
Library\PackageCache\com.unity.xr.arcore@2.1.0-preview.5\Runtime\ARCoreFaceSubsystem.cs(146,34): error CS0115: 'ARCoreFaceSubsystem.Provider.Destroy()': no suitable method found to override
Library\PackageCache\com.unity.xr.arcore@2.1.0-preview.5\Runtime\ARCoreFaceSubsystem.cs(274,61): error CS0115: 'ARCoreFaceSubsystem.Provider.GetChanges(XRFace, Allocator)': no suitable method found to override

Updating to latest ARFoundation, ARCore, ARKit is giving me similar errors.

tdmowrer commented 5 years ago

Looks like you're missing ARSubsystems (a dependency of all those packages). Have you explicitly set a version in your project's manifest.json?

tiancaipipi110 commented 5 years ago

You mean this? "com.unity.xr.arsubsystems" : "2.1.0-preview.1", Just added it to manifest.json, errors are still there.

tiancaipipi110 commented 5 years ago

@tdmowrer Found out I was missing ARKitFaceTracking, added "com.unity.xr.arkit-face-tracking": "1.1.0-preview.1". Have some code calling arPlaneManager.GetAllPlanes()from old arf 1.0.0, is there a way to do that with the new arPlaneManger.cs?

tdmowrer commented 5 years ago

You mean this? "com.unity.xr.arsubsystems" : "2.1.0-preview.1", Just added it to manifest.json, errors are still there.

You should not add this to your manifest explicitly. It is a dependency of other packages, and manually specifying it will override the version in the other packages. My thought was that if you had manually specified an older version, then I would expect the errors you received.

Have some code calling arPlaneManager.GetAllPlanes() from old arf 1.0.0, is there a way to do that with the new arPlaneManger.cs?

Here is an example.

tiancaipipi110 commented 5 years ago

@tdmowrer Ooooooh, yes, was looking for this manual for a while. How do you find it? Thanks a bunch tho!

tiancaipipi110 commented 5 years ago

@tdmowrer Btw has anything changed on the plane searching algorithm? Somehow the horizontal planes detection is no longer horizontal, it's rotated 35 degree clockwise perpendicularly to phone direction.

tdmowrer commented 5 years ago

@tdmowrer Ooooooh, yes, was looking for this manual for a while. How do you find it? Thanks a bunch tho!

All packages have documentation available from Window > Package Manager > View Documentation

Screen Shot 2019-07-18 at 7 46 58 PM

@tdmowrer Btw has anything changed on the plane searching algorithm? Somehow the horizontal planes detection is no longer horizontal, it's rotated 35 degree clockwise perpendicularly to phone direction.

No, that shouldn't happen. Is your AR Camera a child of your ARSessionOrigin?

tiancaipipi110 commented 5 years ago

Window > Package Manager > View Documentation

Thanks, totally forgot to check here.

Is your AR Camera a child of your ARSessionOrigin?

Yes.

tiancaipipi110 commented 5 years ago

@tdmowrer Was getting this error, same as #153. Which arf version is the highest to run on xocde 10 iOS 11?

ld: warning: arm64 function not 4-byte aligned: _unwind_tester from /Users/junwang/Desktop/0720_arf2.2.0/Libraries/libiPhone-lib.a(unwind_test_arm64.o)
Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_ARSkeletonDefinition", referenced from:
      objc-class-ref in UnityARKit.a(ARKitXRHumanBodyProvider.o)
  "_OBJC_CLASS_$_ARBodyAnchor", referenced from:
      objc-class-ref in UnityARKit.a(ARKitXRHumanBodyProvider.o)
  "_OBJC_CLASS_$_ARCollaborationData", referenced from:
      objc-class-ref in UnityARKit.a(ARKitXRSessionProvider.o)
  "_OBJC_CLASS_$_ARBodyTrackingConfiguration", referenced from:
      objc-class-ref in UnityARKit.a(ARKitXRHumanBodyProvider.o)
  "_OBJC_CLASS_$_ARMatteGenerator", referenced from:
      objc-class-ref in UnityARKit.a(ARKitXRHumanBodyProvider.o)
  "___isPlatformVersionAtLeast", referenced from:
      ReferencePointProvider::GetReferencePoint(ARAnchor*, UnityXRTrackingState) in UnityARKit.a(ARKitXRReferencePointProvider.o)
      _UnityARKit_session_construct in UnityARKit.a(ARKitXRSessionProvider.o)
      _UnityARKit_session_destroy in UnityARKit.a(ARKitXRSessionProvider.o)
      _UnityARKit_session_update in UnityARKit.a(ARKitXRSessionProvider.o)
      _UnityARKit_session_reset in UnityARKit.a(ARKitXRSessionProvider.o)
      _UnityARKit_Camera_AcquireConfigurations in UnityARKit.a(ARKitXRCameraProvider.o)
      _UnityARKit_Camera_TryGetCurrentConfiguration in UnityARKit.a(ARKitXRCameraProvider.o)
      ...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
tiancaipipi110 commented 5 years ago

This setup fixed it with Unity 2019.1.6, iOS 12.2/Xcode 10.2

    "com.unity.xr.arcore": "2.1.0-preview.4",
    "com.unity.xr.arfoundation": "2.1.0-preview.2",
    "com.unity.xr.arkit": "2.1.0-preview.3",
    "com.unity.xr.arkit-face-tracking": "1.0.0-preview.4"
manolomirandac commented 5 years ago

This setup fixed it with Unity 2019.1.6, iOS 12.2/Xcode 10.2

    "com.unity.xr.arcore": "2.1.0-preview.4",
    "com.unity.xr.arfoundation": "2.1.0-preview.2",
    "com.unity.xr.arkit": "2.1.0-preview.3",
    "com.unity.xr.arkit-face-tracking": "1.0.0-preview.4"

That helped me, thanks a lot.

codemaker2015 commented 3 years ago

This is due to incompatible version of the packages. We know that each Unity 3D supporting only few list of versions and it is not backward compatible too. means if you are trying to open a project in Unity 3D 2018 version but it is actually developed on Unity 3D 2019 then definitely you will get some sort of package issues in your console.

The following are the packages with versions which is compatible in specific version of Unity.

For Unity 2018:

AR Foundation 1.0.0 — preview.22 (the latest for 1.0.0) ARCore XR Plugin 1.0.0 — preview.24 (the latest for 1.0.0) ARKit XR Plugin 1.0.0-preview.27 (the latest for 1.0.0)

For Unity 2019:

AR Foundation 2.0.2 ARCore XR Plugin 2.0.2 ARKit XR Plugin 2.0.2

You can add those packages from Package Manager. You can get it from Window --> Package Manager in Unity 2018.3 + versions. If you are trying to use this packages in Unity which version is less than 2018.3 then add those in your manifest.json file located under Packages folder.

{
  "dependencies": {
    ...
    "com.unity.xr.arcore": "1.0.0-preview.24",
    "com.unity.xr.arfoundation": "1.0.0-preview.22",
    "com.unity.xr.arkit": "1.0.0-preview.27"
  }
}
tdmowrer commented 3 years ago

We also maintain a chart in this repo's README: https://github.com/Unity-Technologies/arfoundation-samples#what-version-should-i-use