Start a new topic

Flutter Hot Reload/Restart not updating the AR Scene

As mentioned in the title, I've encountered the problem that hot reloading/restarting with the Flutter Demo App from Github and custom app as well is not working for the JS AR contents (Flutter 1.14, Wikitude 8.10). The "normal" Flutter part is reloading as expected. It seems to make no difference if it is loaded from local or hosted (Apache2) and loaded via http.


It perfectly works with the Wikitude Browser from App Store, but In-App I always have to Stop and Start again (flutter run).


I'm not quite sure, but could it be that the WebViews on iOS and Android are caching? 


Hi Daniel,


It is true that the Hot Reload functionallity is not working for the JS AR contents. 


The problem is that when you open the arview.dart, you are creating an instance of our wikitude plugin which is opening the camera, loading the example and so on. When you change anything in the JS part, since this is an internal change in the sample that is load throw the wikitude plugin and Flutter doesn't know anything about reloading the samples in the Wikitude plugin, the Hot Reload won't do anything but show the same view. For a good use of the Hot Reload, we would need that when any change happens in the JS part, Flutter calls the Wikitude plugin to reload the sample that has internally loaded, which is not possible at the moment.


Regards,


Aitor.

Thanks for your response. Ok I think I understand why hot reload isn't working. But I have the same problem when loading the JS AR contents via network http://ip:port. 


So when using the Custom URL Launcher and loading http://192.168.0.1:8080 for example, changes made are not loaded when reloading the url. But it works with the Wikitude Browser app. Therefore I thought it might be that the WebView is caching and not reloading from server. But not sure if that's the reason why it's not loading the changes.


Thanks.

Hi again,


Do you mean it is not reloading without pausing and resuming the view? It's exactly the same, we are clearing the cache once the activity is being destroyed so we reuse most of the resources/ don't load again, so when using the Hot Reload the cache is still undestroyed.


Regards,


Aitor.

It's not reloading until reinstalling the app. Closing and restarting also did not work.

A ticket has been created for further investigation.


1 person likes this

Hi Daniel,


I did more tests about your issue, and unfortunately i could not reproduce them. 


What i did is to create a free host domain to do some tests with a custom page and uploaded an index.html file with some text there. Then i used the Custom Url functionallity that is available in the Flutter app and loaded the URL. Once it was loaded, i change the index.html text, went back in the Flutter app to enter the Custom URL again and when the page was loaded, the text was changed.


I think i have followed your steps, and at least i can assure you that nothing is cached.  If you find something weird in what i did, please let me know, otherwise i would need more details of your issue, as long as some code to test with.


Regards,


Aitor.

Login or Signup to post a comment