Start a new topic

Problems setting up Wikitude in an existing Cordova app

 

Greetings,


I am trying to add an existing project from GitHub to my existing application.


I have some problems achieving this.

I have downloaded architect.js file. If I use this downloaded file, i get the following error:


1.       If I use https://www.wikitude.com/libs/architect.js and meta tag

“<meta http-equiv="Content-Security-Policy" content="default-src * gap://ready file:; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">”

I get “Refused to load the script 'https://www.wikitude.com/libs/architect.js' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-inline' 'unsafe-eval'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.”


1.       If I use https://www.wikitude.com/libs/architect.js and meta tag

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

I get “architect.js:1 Failed to load resource: the server responded with a status of 404 ()”.


When the app loads, I see a white screen and an orange triangle in right bottom of the screen. Click on white space causes “TypeError: AR.js.click.executePlatformClick is not a function”.



Here is my entire HTML code (taken from one of the examples):


<!DOCTYPE HTML>
<html>

<head>
    <meta
http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
   
<!--<meta http-equiv="Content-Security-Policy" content="default-src * gap://ready file:; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">-->
   
<meta content="width=device-width,initial-scale=1,maximum-scale=5,user-scalable=yes" name="viewport">

    <title></title>

   
<!--<script src="../../dist/scripts/ar/architect.js"></script>-->
   
<script src="https://www.wikitude.com/libs/architect.js"></script>
    <script
src="../../dist/scripts/ar/ade.js"></script>
   
<!--<script src="dist/scripts/ar/architect.js"></script>
    <script type="text/javascript" src="dist/scripts/ar/ade.js"></script>-->

   
<style>
       
.info {
           
font-size: large;
           
position: absolute;
           
width: 100%;
           
padding-top: 12px;
           
padding-bottom: 12px;
           
background-color: #BBBBBB;
           
text-align: center;
           
top: 0;
           
left: 0;
            
opacity: 0.7;
           
display: table;
       
}

       
#infoBox {
           
display: none;
       
}

       
#infoBox .text {
           
display: table-cell;
           
vertical-align: middle;
           
text-align: right;
            
width: 50%;
       
}

       
#infoBox .icons {
           
display: table-cell;
           
vertical-align: middle;
           
text-align: left;
       
}

       
#infoBox .icons img {
           
margin-left: 15px;
       
}
   
</style>
    <script
src="../../dist/scripts/ar/imageontarget.js"></script>
</head>

<body>
<div
data-role="page" id="page1" style="background: none;">
   
<!-- MAIN PAGE CONTENT -->
    <!-- transparent footer-->
   
<div data-role="footer" class="ui-bar" data-theme="f" data-position="fixed" style="text-align:center;">

       
<!-- small status-button -->
       
<a style="text-align:right;" id="popupInfoButton" href="#popupInfo" data-rel="popup" data-role="button"
          
class="ui-icon-alt" data-inline="true" data-transition="pop" data-icon="alert" data-theme="e"
          
data-iconpos="notext">Log</a> </p>

       
<!-- popup displayed when button clicked -->
       
<div data-role="popup" id="popupInfo" class="ui-content" data-theme="e" style="max-width:350px;">
            <p
style="text-align:right;" id="status-message">Trying to find out where you are</p>
        </div>

    </div>
</div>

And these are the plugins that I am using:

image


I also tried the "Automatic Setup of Sample App". It would install after I changed how it gets the plugin in the generator script (I changed the Git url to $BUILD_PROGRAM plugin add com.wikitude.phonegap.wikitudeplugin@8.0.0).


The app does build, but even after I added my licence key in Wikitude.js, on every example I open "License key missing" is shown. I also get the Failed to load resource: the server responded with a status of 404 () for architect.js and AR.js.click.executePlatformClick is not a function from ade.js.


Do you have any suggestions as to what could be wrong and how I can resolve my problems?


Best regards,


Rosa





1 Comment

Good morning Rosa, 



if the watermark is being rendered, you can't be far off. Have you added your personal license key or a trial license key?



- Daniel

Login or Signup to post a comment