Start a new topic
Solved

Failed to load Architect World

Hello,


I am building my second Flutter application on which I have used the Wikitude plugin for AR.

Once I call the arView page I get on run console:


"Uncaught ReferenceError: World is not defined", source: data:text/html, (1)

"Uncaught ReferenceError: AR is not defined", source: data:text/html, (1)


And on the tablet screen I get a message 

Failed to load the Architect World

net::ERR_FILE_NOT_FOUND


I have the architect.js on top of the html page.


What else could cause those errors?


Hello,


any help is highly appreciated.

I have checked with ADE and indeed it cannot load the architect.js file.

Is there any change on the file location?

Hello there,


I would like to have your feedback on this. I cannot use the plugin!

Hi Michael,


Regarding the file location nothing has changed at all in the last year so I would need more info of the files you are trying to load:


  • Is the html file being loaded properly?
  • Did you try to run your sample on our sample app and did it work?
  • Is there something you are loading differently than what's shown in our sample app?


Regards,


Aitor.

Dear Aitor,


I am using the same implementation as on previous app that I have made.

The only difference between the 2 apps is the different plugin version.

On the previous I have used v.9.6 and now I am using v.9.10 with different flutter and dart versions off course.

But as I have seen there is no difference on your sample code between the different versions.

You are right, there were no major changes between those 2 versions you mention. In order to try to reproduce your issue I would need more details on how are you using the ARView and where is located the sample (the html + the js file). It would also be fine If you could send the sample that was working fine with the previous plugin version, so I have a look at this specific case.


Regards,


Aitor.

Hi Aitor,


THe arview is imported from pubspec and then is located on a plugin directory as described on the documentation. The sample html is inside the asset folder and the js file is on the same folder under the js directory. You can check the directory at attached imgs.

How I could sent you the sample (do you refer to sample folder or to whole project)?

I refer to the sample folder. I could easily load the sample folder into our project, so I can check if your issue is something I can reproduce.

You can find them attached.

The old is the one that is currently working and the new is the one that doesn't work.

zip
zip

I tried both samples and both are failing for me with the same issue you mention. Nevertheless, when I switch your JS file with our NativeDetailScreen js file the  "AR is not defined" is not happening anymore.


Was this sample working for you before? This error usually happens in 2 cases:

  1. When there are errors on the javascript file that prevents it to work properly.
  2. When the architect.js file is not imported, which is not the case as it is present in your html files.


If this sample never worked before I would review/debug the JS file to try to catch the issues.


Regards,


Aitor.

Hi Aitor,


it's not possible to check the samples because from arview.dart I am using 2 files, one is for the language used and the second is with the poi data. Both of them are called from the dart like below:

this.architectWidget.callJavascript("World.loadLanguage("+jsonEncode(lang)+");");
this.architectWidget.callJavascript("World.loadPoisFromJsonData(" + json.encode(poi) + ");");

So there is no way that you can use my sample without them.


The poi and lang variable are populated correctly when they reach this part of the code. So I suppose that they are entered on the js file without any problem. 

Is there any option to have debug prints from the js in flutter console and not through the AR.logger since I don't have access currently.

I am trying to find the issue here and still no luck.

I have tested with the example from the github, but I am getting the same error.

If I remove the callJavascript lines from the onArchitectWidgetCreated() that I have written above I still get the same error on the alert, but on the flutter console I don't have any error.

When I load the poi with poi.toString() instead jsonEncode(poi) I get 

"Uncaught SyntaxError: Unexpected identifier", source: data:text/html, (1)

and when I use the jsonEncode(poi) I get

"Uncaught ReferenceError: World is not defined", source: data:text/html, (1)


below is the log from the console when I don't load the callJavascript.

 

I/ViewRootImpl@612204d[MainActivity](12190): ViewPostIme pointer 0
I/ViewRootImpl@612204d[MainActivity](12190): ViewPostIme pointer 1
I/Dialog  (12190): mIsSamsungBasicInteraction = false, isMetaDataInActivity = false
I/DecorView(12190): [INFO] isPopOver=false, config=false
I/DecorView(12190): updateCaptionType >> DecorView@2af1f7[], isFloating=false, isApplication=false, hasWindowDecorCaption=false, hasWindowControllerCallback=false
D/DecorView(12190): setCaptionType = 0, this = DecorView@2af1f7[]
D/InputTransport(12190): Input channel constructed: 'bd01db3', fd=216
I/ViewRootImpl@96366c9[MainActivity](12190): setView = com.android.internal.policy.DecorView@2af1f7 TM=true
I/SurfaceControl(12190): assignNativeObject: nativeObject = 0 Surface(name=null)/@0x11a31ce / android.view.SurfaceControl.readFromParcel:1117 android.view.IWindowSession$Stub$Proxy.relayout:1820 android.view.ViewRootImpl.relayoutWindow:9130 android.view.ViewRootImpl.performTraversals:3420 android.view.ViewRootImpl.doTraversal:2669 android.view.ViewRootImpl$TraversalRunnable.run:10092 android.view.Choreographer$CallbackRecord.run:1010 android.view.Choreographer.doCallbacks:809 android.view.Choreographer.doFrame:744 android.view.Choreographer$FrameDisplayEventReceiver.run:995 
I/ViewRootImpl@96366c9[MainActivity](12190): Relayout returned: old=(0,0,1200,1808) new=(0,0,1200,1808) req=(1200,1808)0 dur=9 res=0x7 s={true -5476376644725510144} ch=true fn=-1
I/ViewRootImpl@96366c9[MainActivity](12190): [DP] dp(1) 1 android.view.ViewRootImpl.reportNextDraw:11078 android.view.ViewRootImpl.performTraversals:3915 android.view.ViewRootImpl.doTraversal:2669 
I/ViewRootImpl@96366c9[MainActivity](12190): [DP] pd() Asnyc report
I/ViewRootImpl@96366c9[MainActivity](12190): mAttachInfo.mThreadedRenderer.draw, mView = DecorView@2af1f7[MainActivity] w = 1200 h = 1808
I/SurfaceView(12190): onWindowVisibilityChanged(0) true com.wikitude.common.rendering.internal.e{9ec6ffc V.E...... ......I. 0,0-0,0} of ViewRootImpl@96366c9[MainActivity]
V/InputMethodManager(12190): b/117267690: Failed to get fallback IMM with expected displayId=102 actual IMM#displayId=0 view=com.wikitude.architect.d{3b6aca6 VFEDHVC.. ......I. 0,0-0,0}
E/WKTD    (12190): >ERROR: [Runtime][00:05:17.586.429] > Camera disconnected. (code 1003)
I/CameraManagerGlobal(12190): Camera 0 facing CAMERA_FACING_BACK state now CAMERA_STATE_IDLE for client gr.indigital.nafpaktos API Level 2
I/CameraManagerGlobal(12190): Camera 0 facing CAMERA_FACING_BACK state now CAMERA_STATE_CLOSED for client gr.indigital.nafpaktos API Level 2
I/CameraManagerGlobal(12190): Camera 0 facing CAMERA_FACING_BACK state now CAMERA_STATE_OPEN for client gr.indigital.nafpaktos API Level 2
I/ViewRootImpl@96366c9[MainActivity](12190): [DP] pdf(0) 1 android.view.ViewRootImpl.lambda$performDraw$1$ViewRootImpl:4743 android.view.-$$Lambda$ViewRootImpl$DJd0VUYJgsebcnSohO6h8zc_ONI.run:6 android.os.Handler.handleCallback:938 
I/ViewRootImpl@96366c9[MainActivity](12190): [DP] rdf()
I/SurfaceControl(12190): nativeRelease nativeObject s[-5476376644704662112]
I/SurfaceControl(12190): nativeRelease nativeObject e[-5476376644704662112]
I/SurfaceControl(12190): assignNativeObject: nativeObject = 0 Surface(name=null)/@0x11a31ce / android.view.SurfaceControl.readFromParcel:1117 android.view.IWindowSession$Stub$Proxy.relayout:1820 android.view.ViewRootImpl.relayoutWindow:9130 android.view.ViewRootImpl.performTraversals:3420 android.view.ViewRootImpl.doTraversal:2669 android.view.ViewRootImpl$TraversalRunnable.run:10092 android.view.Choreographer$CallbackRecord.run:1010 android.view.Choreographer.doCallbacks:809 android.view.Choreographer.doFrame:744 android.view.Choreographer$FrameDisplayEventReceiver.run:995 
I/ViewRootImpl@96366c9[MainActivity](12190): Relayout returned: old=(0,0,1200,1808) new=(0,0,1200,1808) req=(1200,1808)0 dur=7 res=0x1 s={true -5476376644725510144} ch=false fn=2
I/SurfaceView(12190): updateSurface: visible = true mSurface.isValid() = true
I/SurfaceView(12190): updateSurface: mSurfaceCreated = false surfaceChanged = true visibleChanged = true
I/SurfaceView(12190): surfaceCreated 1 #8 com.wikitude.common.rendering.internal.e{9ec6ffc V.E...... ......ID 0,0-1200,1808}
I/SurfaceView(12190): surfaceChanged (1200,1808) 1 #8 com.wikitude.common.rendering.internal.e{9ec6ffc V.E...... ......ID 0,0-1200,1808}
I/ViewRootImpl@96366c9[MainActivity](12190): [DP] dp(1) 1 android.view.SurfaceView.updateSurface:1379 android.view.SurfaceView$1.onPreDraw:232 android.view.ViewTreeObserver.dispatchOnPreDraw:1124 
I/ViewRootImpl@96366c9[MainActivity](12190): mAttachInfo.mThreadedRenderer.draw, mView = DecorView@2af1f7[MainActivity] w = 1200 h = 1808
I/SurfaceView(12190): applySurfaceTransforms: t = android.view.SurfaceControl$Transaction@510ed32 surfaceControl = Surface(name=SurfaceView - Sys2030:gr.indigital.nafpaktos/gr.indigital.nafpaktos.MainActivity@9ec6ffc@0)/@0x7266a83 frame = 2
E/AndroidProtocolHandler(12190): Unable to open asset URL: file:///android_asset/flutter_assets/assets/samples/ade.js
I/Dialog  (12190): mIsSamsungBasicInteraction = false, isMetaDataInActivity = false
I/DecorView(12190): [INFO] isPopOver=false, config=false
I/DecorView(12190): updateCaptionType >> DecorView@2d99171[], isFloating=true, isApplication=true, hasWindowDecorCaption=false, hasWindowControllerCallback=false
D/DecorView(12190): setCaptionType = 0, this = DecorView@2d99171[]
D/ScrollView(12190): initGoToTop
D/InputTransport(12190): Input channel constructed: 'b4168ce', fd=262
I/ViewRootImpl@936ec92[MainActivity](12190): setView = com.android.internal.policy.DecorView@2d99171 TM=true
I/SurfaceControl(12190): assignNativeObject: nativeObject = 0 Surface(name=null)/@0x3636663 / android.view.SurfaceControl.readFromParcel:1117 android.view.IWindowSession$Stub$Proxy.relayout:1820 android.view.ViewRootImpl.relayoutWindow:9130 android.view.ViewRootImpl.performTraversals:3420 android.view.ViewRootImpl.doTraversal:2669 android.view.ViewRootImpl$TraversalRunnable.run:10092 android.view.Choreographer$CallbackRecord.run:1010 android.view.Choreographer.doCallbacks:809 android.view.Choreographer.doFrame:744 android.view.Choreographer$FrameDisplayEventReceiver.run:995 
I/ViewRootImpl@936ec92[MainActivity](12190): Relayout returned: old=(0,36,1200,1928) new=(318,832,882,1132) req=(564,300)0 dur=14 res=0x7 s={true -5476376644729589760} ch=true fn=-1
D/ScrollView(12190):  onsize change changed 
I/ViewRootImpl@936ec92[MainActivity](12190): [DP] dp(1) 1 android.view.ViewRootImpl.reportNextDraw:11078 android.view.ViewRootImpl.performTraversals:3915 android.view.ViewRootImpl.doTraversal:2669 
I/ViewRootImpl@936ec92[MainActivity](12190): [DP] pd() Asnyc report
I/ViewRootImpl@936ec92[MainActivity](12190): mAttachInfo.mThreadedRenderer.draw, mView = DecorView@2d99171[MainActivity] w = 564 h = 300
I/ViewRootImpl@936ec92[MainActivity](12190): [DP] pdf(0) 1 android.view.ViewRootImpl.lambda$performDraw$1$ViewRootImpl:4743 android.view.-$$Lambda$ViewRootImpl$DJd0VUYJgsebcnSohO6h8zc_ONI.run:6 android.os.Handler.handleCallback:938 
I/ViewRootImpl@936ec92[MainActivity](12190): [DP] rdf()
I/ViewRootImpl@96366c9[MainActivity](12190): [DP] pdf(0) 1 android.view.SurfaceView.notifyDrawFinished:600 android.view.SurfaceView.performDrawFinished:587 android.view.SurfaceView.lambda$TWz4D2u33ZlAmRtgKzbqqDue3iM:0 
I/ViewRootImpl@96366c9[MainActivity](12190): [DP] rdf()
I/SurfaceControl(12190): nativeRelease nativeObject s[-5476376646183202016]
I/SurfaceControl(12190): nativeRelease nativeObject e[-5476376646183202016]
I/SurfaceControl(12190): nativeRelease nativeObject s[-5476376646183186016]
I/SurfaceControl(12190): nativeRelease nativeObject e[-5476376646183186016]
I/SurfaceControl(12190): nativeRelease nativeObject s[-5476376646183194496]
I/SurfaceControl(12190): nativeRelease nativeObject e[-5476376646183194496]
I/SurfaceControl(12190): nativeRelease nativeObject s[-5476376646863013472]
I/SurfaceControl(12190): nativeRelease nativeObject e[-5476376646863013472]
I/SurfaceControl(12190): nativeRelease nativeObject s[-5476376646863013632]
I/SurfaceControl(12190): nativeRelease nativeObject e[-5476376646863013632]
I/ViewRootImpl@612204d[MainActivity](12190): MSG_WINDOW_FOCUS_CHANGED 0 1
I/ViewRootImpl@936ec92[MainActivity](12190): MSG_WINDOW_FOCUS_CHANGED 1 1
I/CameraManagerGlobal(12190): Camera 0 facing CAMERA_FACING_BACK state now CAMERA_STATE_ACTIVE for client gr.indigital.nafpaktos API Level 2
W/Choreographer(12190): Frame time is 0.184993 ms in the future!  Check that graphics HAL is generating vsync timestamps using the correct timebase.
W/Choreographer(12190): Frame time is 0.161399 ms in the future!  Check that graphics HAL is generating vsync timestamps using the correct timebase.
W/Choreographer(12190): Frame time is 0.106243 ms in the future!  Check that graphics HAL is generating vsync timestamps using the correct timebase.
W/Choreographer(12190): Frame time is 0.00996 ms in the future!  Check that graphics HAL is generating vsync timestamps using the correct timebase.

 

I have tested the file on the previous app that I have made and it works, so I believe that the issue is from the 9.10 plugin.

But I cannot go back to the 9.6, because many flutter packages that I use do not have versions for Flutter 1.22.6.


I would like to have your further assistance on this, because I need to deliver the app by the 10th of December and I don't know what else to do.


Thank you

There is definetely something wrong with the v9.10.

As I have written on my posts here when I test the application on the android emulator if the wikitude plugin is enabled I get Unhandled Exception: MissingPluginException(No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider, and when it disabled everything works fine.

Then on the mobile or tablet loading I get the Failed to load Architect world.


Shall I test previous versions or maybe v9.11 or 9.12 if you have it ready?

Login or Signup to post a comment