mobfishgmbh / Cardboard-VR-Unity-SDK

Apache License 2.0
56 stars 11 forks source link

When Build for platforms other than iOS with il2cpp, build will fail with exception. #53

Closed cai-mobfish closed 4 years ago

cai-mobfish commented 4 years ago

It seems that these codes are compiled which they shouldn't.

Here is a part of the error message.

C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardDistortionRenderer_CardboardDistortionRenderer_create_m8CB7BB854D7B7E666DD5A428E890726A908E4A42':
C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardDistortionRenderer_CardboardDistortionRenderer_destroy_m87BDA1A3B940122E3FD33080FAA3F762E07F6892':
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:8712: undefined reference to `CardboardDistortionRenderer_destroy'
C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardDistortionRenderer_CardboardDistortionRenderer_setMesh_m4A852CAE5779349E6B8884A164034335C08B6FB8':
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:8730: undefined reference to `CardboardDistortionRenderer_setMesh'
C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardDistortionRenderer_CardboardDistortionRenderer_renderEyeToDisplay_m982EA5AF559EA8851A773A005B72CC1901F20BC5':
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:8747: undefined reference to `CardboardDistortionRenderer_renderEyeToDisplay'
C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardDistortionRenderer_CardboardDistortionRenderer_create_m8CB7BB854D7B7E666DD5A428E890726A908E4A42':
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:8701: undefined reference to `CardboardDistortionRenderer_create'
C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardDistortionRenderer_CardboardDistortionRenderer_renderEyeToDisplay_m982EA5AF559EA8851A773A005B72CC1901F20BC5':
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:8747: undefined reference to `CardboardDistortionRenderer_renderEyeToDisplay'
C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardHeadTracker_CardboardHeadTracker_create_mD39F572CB9CB610C76FE57B7C814101DE24B8738':
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:8956: undefined reference to `CardboardHeadTracker_create'
C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardHeadTracker_CardboardHeadTracker_destroy_m4B664AD025CFE36890BE79F5FEB7984444B57968':
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:8967: undefined reference to `CardboardHeadTracker_destroy'
C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardHeadTracker_CardboardHeadTracker_getPose_mC487EBB63DE17858F1B437D5DA9C3A483E1F305B':
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:8991: undefined reference to `CardboardHeadTracker_getPose'
C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardHeadTracker_CardboardHeadTracker_pause_m4A50767E37A59F3533AE89D21823498C7373A4E5':
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:9001: undefined reference to `CardboardHeadTracker_pause'
C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardHeadTracker_CardboardHeadTracker_resume_m809ECD497B3936F27C7C81F2D0319A83B9EDB0AF':
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:9011: undefined reference to `CardboardHeadTracker_resume'
C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardHeadTracker_CardboardHeadTracker_create_mD39F572CB9CB610C76FE57B7C814101DE24B8738':
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:8956: undefined reference to `CardboardHeadTracker_create'
C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardHeadTracker_CardboardHeadTracker_getPose_mC487EBB63DE17858F1B437D5DA9C3A483E1F305B':
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:8991: undefined reference to `CardboardHeadTracker_getPose'
C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardHeadTracker_CardboardHeadTracker_pause_m4A50767E37A59F3533AE89D21823498C7373A4E5':
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:9001: undefined reference to `CardboardHeadTracker_pause'
C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardHeadTracker_CardboardHeadTracker_resume_m809ECD497B3936F27C7C81F2D0319A83B9EDB0AF':
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:9011: undefined reference to `CardboardHeadTracker_resume'
C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardLensDistortion_CardboardLensDistortion_create_mBC2B0109E2A221728FD37D1FB08B0DFFCB10D88B':
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:9439: undefined reference to `CardboardLensDistortion_create'
C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardLensDistortion_CardboardLensDistortion_destroy_m8E4C24F751863CE001EE6120CDEE9D884B524364':
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:9450: undefined reference to `CardboardLensDistortion_destroy'
C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardLensDistortion_CardboardLensDistortion_getDistortionMesh_m7B2A73086E86143994F12FE0EDE5677D5D2886A6':
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:9468: undefined reference to `CardboardLensDistortion_getDistortionMesh'
C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardLensDistortion_CardboardLensDistortion_distortedUvForUndistortedUv_mFD3432C48AD4269B0D5D4A6BA4901E4FED6DE070':
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:9485: undefined reference to `CardboardLensDistortion_distortedUvForUndistortedUv'
C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardLensDistortion_CardboardLensDistortion_undistortedUvForDistortedUv_m11DAF7EFC595F983CCF46D6913E0E4972D660993':
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:9496: undefined reference to `CardboardLensDistortion_undistortedUvForDistortedUv'
C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardLensDistortion_CardboardLensDistortion_getProjectionMatrix_mFB8CA6137BCFA152FF44377A8A3A4A1DD4B73F13':
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:9514: undefined reference to `CardboardLensDistortion_getProjectionMatrix'
C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardLensDistortion_CardboardLensDistortion_getEyeFromHeadMatrix_m338AB108AC957EF1D02E57A03A8C11731C233FDB':
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:9531: undefined reference to `CardboardLensDistortion_getEyeFromHeadMatrix'
C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardLensDistortion_CardboardLensDistortion_getFieldOfView_m95A3F8CF4267FBF58C46AD3BAAA4FED696ABBAA4':
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:9541: undefined reference to `CardboardLensDistortion_getFieldOfView'
C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardLensDistortion_CardboardLensDistortion_create_mBC2B0109E2A221728FD37D1FB08B0DFFCB10D88B':
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:9439: undefined reference to `CardboardLensDistortion_create'
C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardLensDistortion_CardboardLensDistortion_destroy_m8E4C24F751863CE001EE6120CDEE9D884B524364':
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:9450: undefined reference to `CardboardLensDistortion_destroy'
C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardLensDistortion_CardboardLensDistortion_getProjectionMatrix_mFB8CA6137BCFA152FF44377A8A3A4A1DD4B73F13':
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:9514: undefined reference to `CardboardLensDistortion_getProjectionMatrix'
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:9514: undefined reference to `CardboardLensDistortion_getProjectionMatrix'
C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardLensDistortion_CardboardLensDistortion_getEyeFromHeadMatrix_m338AB108AC957EF1D02E57A03A8C11731C233FDB':
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:9531: undefined reference to `CardboardLensDistortion_getEyeFromHeadMatrix'
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:9531: undefined reference to `CardboardLensDistortion_getEyeFromHeadMatrix'
C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardManager_ScanQrCode_mA9E8DB577E871DCE8A67250DAA252B47D9407372':
C:\Users\[location]\Temp\StagingArea\Il2Cpp\il2cppOutput/Bulk_MobfishCardboard_0.cpp:11507: undefined reference to `CardboardQrCode_scanQrCodeAndSaveDeviceParams'
C:/Users/[location]/Library/il2cpp_android_arm64-v8a/il2cpp_cache/4AEDF5126AB6557BF0A20661C5D8994E.o: In function `CardboardQrCode_StartScanQrCode_mA48C64EC95C<message truncated>
cai-mobfish commented 4 years ago

Simply change platform in assembly define file (.asmdef) in Cardboard folder will do the trick.

hawkwood commented 4 years ago

This "fix" broke iOS building for me, and adding iOS to the platforms fixed that, but I did not test Android building.

cai-mobfish commented 4 years ago

I'm terribly sorry, it should be "iOS and Editor" instead of "Android and Editor". Something was wrong with my head when I commit and merge this. I'm going to rollback this, and you can also fix yourself by editing the asmdef file in Unity.

cai-mobfish commented 4 years ago

Fixed through android support.