Start a new topic
Solved

The Poi marks are not loaded in Profile and Production Mode

Hello,


I have build my app in Flutter and when in Debug mode the Poi marks are parsed from json and populated in the js file.

But when the application runs in Profile or Build mode the json from dart to js is null.

I have checked the json on dart file and is filled with the data, but when it is parsed from js file is empty.


From the dart file I call the 

this.architectWidget.callJavascript("World.loadPoisFromJsonData(" + jsonEncode(poi) + ");");

  and then on the js file


 

 loadPoisFromJsonData: function loadPoisFromJsonDataFn(poiData) {

 AR.context.destroyAll();

        /* Show radar. */
        PoiRadar.show();

        /* Empty list of visible markers. */
        World.markerList = [];

        /* Start loading marker assets. */
        World.markerDrawableIdle = new AR.ImageResource("assets/marker_idle_new.png", {
            onError: World.onError
        });
        World.markerDrawableSelected = new AR.ImageResource("assets/marker_selected_new.png", {
            onError: World.onError
        });
        World.markerDrawableDirectionIndicator = new AR.ImageResource("assets/indi.png", {
            onError: World.onError
        });

        /* Loop through POI-information and create an AR.GeoObject (=Marker) per POI. */
        for (var currentPlaceNr = 0; currentPlaceNr < poiData.length; currentPlaceNr++) {
            var singlePoi = {
                "id": poiData[currentPlaceNr].id,
                "latitude": parseFloat(poiData[currentPlaceNr].lat),
                "longitude": parseFloat(poiData[currentPlaceNr].lng),
                "altitude": parseFloat(poiData[currentPlaceNr].altitude),
                "title": poiData[currentPlaceNr].title,
            };

            World.markerList.push(new Marker(singlePoi));
        }

        /* Updates distance information of all placemarks. */
        World.updateDistanceToUserValues();

        World.updateStatusMessage(currentPlaceNr + ' places loaded');
        World.updateRangeValues();

        /* Set distance slider to 100%. */
        document.getElementById("panelRangeSliderValue").innerHTML = 100;
    },

 


Why is this issue created on the Profile and Build Modes, do I have to set any special rights to make it work?


Hi,


We don't have any special right that make the build different in Debug or Build Mode. Were you able to reproduce this issue in our sample app or just in your application? In the pois samples that we have, I am able to load the json data in all type of builds, that's why I am asking.


Regards,


Aitor.

No, I haven't tried your sample application on build mode.

But the issue doesn't make sense. I mean even on the build the data is visible on the variable until they are being processed from the js file!

I know it doesn't make any sense, but as long as I can't reproduce your issue it will be hard for me to give you a proper solution. When you mention that the data is visible on the variable, do you mean the poi variable, the result of the jsonEncode() call or both?

From the dart file I can see the contents of the jsonEncode(poi).

But on the js file when I log the poiData it return null.

So somehow when the data is being parsed from the js file it turns to null.

I did try to reproduce your issue with all the poi samples that we have in our sample app (profile and release modes) and could not reproduce it. If you find a way to do it, please let me know so I can further investigate this issue, otherwise I'm afraid I can't see anything wrong at the moment.


Sorry for the inconvenience.

Do you have bitbucket account to share the git code with you so you can make a test of the application and check the issue.

Hi Michael,


Unfortunately, it is strictly forbidden from the developers to debug projects from other users/customers. Unless there is a way for you to share a video or steps on how to reproduce your issue, and as long as we tried and could not reproduce it with our sample app, there is not much left that we can do.


I hope you understand our policy,

The Wikitude Support Team

OK, understood.

thank you.

I am still having the same problem when on profile or release the application.


I believe that the problem is on the file used to read the POI data.

Once I launch the application the data is written on a file in application folder and then I use this file to read the POI.

When in debug mode the file is readable / writable. But despite that the data is written on the file I believe that the application cannot read from the file.


I have Add on the AndroidManifest.xml below options on the uses-persmissions, but still the poi list that is injected from arview.dart to the native js file is null.

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
    android:maxSdkVersion="28" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />

Are the any more options that I need to enable in order to read from storage?

the issue was not on the permissions of the android, but on how I was accessing the local variable in Flutter.

Strangely it was working in debug mode and not in release and profile modes.

Login or Signup to post a comment