Start a new topic
Solved

Loading AR web view failed: Missing file file:///android_asset/www/experience/index.html0"

I am currently following the cordova plugin documentation on the wikitude website and when I run the specific code in the  "Loading your augmented reality" section, I get an error saying a file is missing. In my code it says set "arExperienceUrl: 'directory" but I am not sure where to get the experience to load in the app. I am very new to this and would like someone to help me find this "experience" so I can test my image recognition for the surf board image.


/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
var app = {

// Url/Path to the augmented reality experience you would like to load
arExperienceUrl: "www/experience/index.html",
// The features your augmented reality experience requires, only define the ones you really need
requiredFeatures: [ "2d_tracking", "geo" ],
// Represents the device capability of launching augmented reality experiences with specific features
isDeviceSupported: false,
// Additional startup settings, for now the only setting available is camera_position (back|front)
startupConfiguration:
{
"camera_position": "back"
},
// Application Constructor
initialize: function() {
this.bindEvents();
},
// Bind Event Listeners
//
// Bind any events that are required on startup. Common events are:
// 'load', 'deviceready', 'offline', and 'online'.
bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
},
// deviceready Event Handler
onDeviceReady: function() {
app.wikitudePlugin = cordova.require("com.wikitude.phonegap.WikitudePlugin.WikitudePlugin");
app.wikitudePlugin.isDeviceSupported(app.onDeviceSupported, app.onDeviceNotSupported, app.requiredFeatures);
},
// Callback if the device supports all required features
onDeviceSupported: function() {
app.wikitudePlugin.loadARchitectWorld(
app.onARExperienceLoadedSuccessful,
app.onARExperienceLoadError,
app.arExperienceUrl,
app.requiredFeatures,
app.startupConfiguration
);
},
// Callback if the device does not support all required features
onDeviceNotSupported: function(errorMessage) {
alert(errorMessage);
},
// Callback if your AR experience loaded successful
onARExperienceLoadedSuccessful: function(loadedURL) {
/* Respond to successful augmented reality experience loading if you need to */
},
// Callback if your AR experience did not load successful
onARExperienceLoadError: function(errorMessage) {
alert('Loading AR web view failed: ' + errorMessage);
}

};
app.initialize();

Hi Jon,



when we refer to an "experience" in the documentation, we essentially mean the javascript code that will call to the Wikitude JavaScript SDK and all the assets related thereto. Sometimes this is also referred to as "world".


We have a public GitHub repository that contains all of the samples we present in our sample apps. They also come bundled with the regular JavaScript SDK packages. They do not come bundled with the Cordova package as we offer a script to set up the sample that will download them automatically.


You'll notice that all of these experiences contain an index.html file at the root level. This is what you need to set your arExperienceUrl to.


So, in summary, you'll have to download the 01_ImageTracking_1_ImageOnTarget folder from the repository, put it into the global www folder and set your arExperienceUrl to www/01_ImageTracking_1_ImageOnTarget/index.html.


If you continue to have trouble with setting things up, please let me know.



- Daniel



OHHHH wow thank you very much! :)

Login or Signup to post a comment