Can't load my world, issue with loading archit

2019-07-25 09:59发布

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条回答
Lonely孤独者°
2楼-- · 2019-07-25 10:29

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

查看更多
登录 后发表回答