本文介绍了无法加载我的世界,加载architect://architect.js时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在iOS的Wikitude PhoneGap插件包中运行HelloWorld示例.

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

但是,当我将必要的文件和框架小心地复制到自己的原始PhoneGap项目中时,在尝试加载相同的HelloWorld世界时,我会遇到以下问题:

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:

  • 每当我在代码中保留<script src="architect://architect.js"></script>时,该应用就会在Wikitude大徽标上崩溃(之前最小化到左下角)
  • 当我删除该行时,该应用程序不会崩溃,但不会显示Hello 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.

我曾尝试加载ade.js,但现在我知道D代表桌面.我已经在Mac和Internet上寻找了architect.js文件,但找不到它.我不了解样本项目和我的项目之间有什么区别.

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?

(我在这里问过这个问题( http://forum.wikitude.com /home/-//message_boards/message/260302 ).无论我在哪里发布问题,我都将发布任何答案,并附有信用并链接回原始答案提供者)

(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)

为完整起见,这是HelloWorld世界中的代码:

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>

推荐答案

看来,我的Xcode项目中的问题是链接器标志之一.我有-Obj-C,而需要-ObjC.

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

这个答案是由Wikitude板上的Andreas Schacherbauer提供的: http://forum.wikitude.com/home/-/message_boards/message /260302#_19_message_262371

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

这篇关于无法加载我的世界,加载architect://architect.js时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 16:10
查看更多