Can't load my world, issue with loading architect://architect.js

孤人 提交于 2019-12-24 07:35:52

问题


I am able to run the HelloWorld sample within the Wikitude PhoneGap Plugin package for iOS.

However, when I carefully copy the necessary files and frameworks to my own vanilla PhoneGap project, I experience the following when trying to load the same HelloWorld world:

  • Whenever I leave <script src="architect://architect.js"></script> in my code, the app crashes at the big Wikitude logo (right before is minimizes to the lower left corner)
  • When I delete that line, the app does not crash but does not display Hello World.

I have tried loading the ade.js, but I understand now the D stands for Desktop. I have looked for the architect.js file all over my Mac and the internet, but cannot find it. I do not understand what the difference is between the sample project and mine.

Can anyone help me getting a world in my own project?

(I have asked this here (http://forum.wikitude.com/home/-/message_boards/message/260302) as well. I will post any answer I get wherever I posted the question with credit and linkback to the original answer giver)

For completeness, this is the code from the HelloWorld world:

    <!-- Include the ARchitect library -->
    <script src="architect://architect.js"></script>

    <script type="text/javascript">
       var label = null;

        function createLabelAtLocation(geoLocation)
        {
            label = new AR.Label("No Text", 2, {onClick : function(){
                                        document.location = 'architectsdk://labelClick?text='+label.text;
                                     }});

            var geoObject = new AR.GeoObject(geoLocation, {drawables: {cam: label}});
        }

        function setupScene()
        {
            createLabelAtLocation( new AR.RelativeLocation(null, 100, 0, 0) );
        }

        function didReceivedNewTextForLabel(text)
        {
            if(label)
            {
                label.text = text;
            }
        }

        function clickedClose() {
            document.location = 'architectsdk://actionButton?action=close';
        }

        function clickedHide() {
            document.location = 'architectsdk://hideButton?status=hide';
        }

    </script>
</head>

<body onload="setupScene()">

    <!-- Button to close AR view, you may use this to hide arView and navigate back to familiar phoneGap environment -->
    <button title="close" onclick="clickedClose()">Close AR View</button>
    <button title="hide" onclick="clickedHide()">Hide AR View</button>
</body>


回答1:


It appears the problem in my Xcode project was one of the linker flags. I had -Obj-C, whilst -ObjC was required.

This answer was provided by Andreas Schacherbauer, on the Wikitude boards: http://forum.wikitude.com/home/-/message_boards/message/260302#_19_message_262371



来源:https://stackoverflow.com/questions/16152654/cant-load-my-world-issue-with-loading-architect-architect-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!