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?


Finally I have made it work.

What worked for me, was disabling all the files that were loaded from the index.html file and enabling one after the other except ade.js. Now is finally working and my app looks great.


2 people like this

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?

When you say that you have tested with the sample from the github, do you mean your sample applying the required changes or the 10_BrowsingPois_5_NativeDetailScreen sample? As far as I could see, your sample takes the one I mention as base -> is this specific sample working for you?


Regarding the emulator, the MissingPluginException is expected as the emulator run with a x86 architecture while our SDK is build for ARM7 and ARM8 architectures, which makes them incompatible. This was mentioned some time ago: https://www.wikitude.com/blog-2019-sdk-clean-up/.


Please, let me know if the NativeDetailScreen sample works for you.


Regards,


Aitor.

yes, this is the one. I have based my app on the browsingPois example and I have tested the example from github and doesn't work.

I have also tested all version 9.9 and it has the same issue.


Noted that the emulator doesn't work because of the x86 architecture. 


Just downloaded the project from github, called flutter pub get in the plugin folder and the project folder, removed the abiFilters 'armeabi-v7a' as mentioned in the documentation and the application was working fine for me -> could open the NativeDetailScreen without issues.


Could you tell me your steps to try to reproduce the issue? In which device are you running the sample app?

I have redownloaded the project from github and after flutter pub get on both folders and removing the abifilters (because I get an error java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dlopen failed: library "libflutter.so" not found) I managed to run the demo.


I will go line by line comparing both projects to check for differences. I will report back with findings.

It's not possible to make it work on the project.

I have copied the files to my project and still breaks.

Is there a way to have your assistance on this? 

I believe there is something with the poi data that's been transfered to the js file, but since I don't have access on the AR.logger console I cannot see where exactly the code breaks to correct it.

Same problem, removing the line ade.js in the html file works the POI example, thank you!

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?

Login or Signup to post a comment