Network error (file:///storage/...)

7 posts, 0 answers
  1. softwarea
    softwarea avatar
    77 posts
    Member since:
    Feb 2007

    Posted 06 Aug 2013 Link to this post

    I have two issues with deploying my app to an HUAWAI Y300 phone (Android 4.1.1).

    The phone shows up with a green bulb in Graphite, and it seems like I can build and deploy without any problems.

    When I start the app it shows the "First Start" screen for a while. After a minute or so I get an application error message on the device: "Network error. (file:///storage/sdcard0/Icenium/x/y/index.html?z). x, y and z are project specific names and paramers which I anonymized here.

    At this point, the phone is still connected with a USB cable.

    When I close the app, and then remove the USB cable, the phone's title bar reports that the SD card is being prepared. This message is shown for a second or so.

    Now I restart the app (as mentioned without USB cable). The grey Icenium splash screen is shown for a couple seconds. After that I am getting a totally white screen and nothing happens any more.

    The same app runs just fine when deployed to an iPhone 4s. However, the white screen reminds me of the current ION issue when I run the app on my iPhone in ION. Is the white screen on my Android related to the same issue?

    Can you guys help me out?

    Thanks
    Ingmar
  2. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 08 Aug 2013 Link to this post

    Hello Ingmar,

    Can you share which app is the problematic one? We've went through your account and the only one updated recently was 'Din....Go' which however has an empty index.html i.e. a white screen is expected.
    According to your description and error, we suspect that you get the problem when your device is connected because your storage is locked for the android system and deployed APK can't unpack. This usually happens when device has SD card and it is mounted as USB storage to the PC. Can you verify that your SD card is accessible on your device i.e. use a file manager program and try to save/copy a file on it (e.g. image).

    On a side note, you can try to build your application in "Release" and check if it works on your device. Use Graphite, right click on your solution in "Project Navigator", select "Build Settings" and select "Release". Delete the app from the device before trying to deploy again. This would verify whether the problem is SD Card/ Internal Memory related.

    Regards,
    Steve
    Telerik

    Do you enjoy Icenium? Vote for it as your favorite new product here (use short code H048S).
    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Share feedback and vote for features on our Feedback Portal.
  3. softwarea
    softwarea avatar
    77 posts
    Member since:
    Feb 2007

    Posted 08 Aug 2013 Link to this post

    Hi Steve, 

    and thanks for your support!

    Yes, you are right. It is the "Din...Go" project I was talking about. And sorry for the confusion about the index.html. At the time when I started this thread the index.html had some real/visual content. In the current version, however, we tried to narrow the problem down. That's why the current index.html doesn't make much sense on first sight at the moment.

    Here are some news:
    I removed the SD card and restarted the phone to go sure that it's not the SD card causing all these problems. So, everything I am referring to from now on is about my phone *without* SD card.

    I uninstalled the app as you suggested and the re-deployed it in "Release" mode.

    Here are our newest findings. In the index.hml you will find the following snippet:

    <script type="text/javascript">
                $(document).ready(function() {
                   $.cookie('token', 'test'); // Try to set a cookie through the jQuery Cookie plugin (we also tried pure JS, also without success).
                   alert('Cookie: ' + $.cookie('token')); //We get a "Cookie: undefined" message 
                });
      </script>

    Narrowing down the issues we found the problem in setting a simple cookie. This code fails on the mentioned Huawei Y300 (Android 4.1.1).
     
    Surprisingly the dame code (actually the whole app) works just fine in the Graphite simulator, on an iPhone4 and 4s, and on a Samsung Galaxy Y (Android 2.3).

    Does this ring any bell? Can this still be about permissions? I mean, is it possible that our app has no write permissions for cookies? 

    Thanks again for your help, Steve. We really appreciate it!
    Ingmar




  4. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 09 Aug 2013 Link to this post

    Hi Ingmar,

    Cookie support seems problematic and inconsistent in Cordova and Android WebView. We would recommend using localstorage instead as do others:

    Regards,
    Steve
    Telerik

    Do you enjoy Icenium? Vote for it as your favorite new product here (use short code H048S).
    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Share feedback and vote for features on our Feedback Portal.
  5. softwarea
    softwarea avatar
    77 posts
    Member since:
    Feb 2007

    Posted 09 Aug 2013 Link to this post

    Thanks Steve. I think this will be a good and easy solution for us.
    Thanks again!
  6. Vakeel
    Vakeel avatar
    2 posts
    Member since:
    May 2014

    Posted 12 Jun 2015 in reply to Steve Link to this post

    Hi,

    I am installed app using QR code and also tried with installed through USB in my Android mobile it installed successfully on mobile index page seen properly but when I go other page I facing Application  error popup just like "application error there was a network error file ///test.html"
       I am also sending my project as well please find attachment
    reply me as soon as possible
  7. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 17 Jun 2015 Link to this post

    Hi Vakeel,

    Thank you for submitting a suport ticket with the project attached. We addressed the case there so please feel free to write back if you have any further comments on it. In the meantime, I will post the information here as well for the benefit of the community.

    When we inspected your project, we noticed that you refer all hyperlinks with a leading forward slash. This causes the Android OS to look for the file in its home directory, instead of the app's directory.

    Running the provided project in the AppBuilder Simulator does not reproduce the navigation issue, because the simulator places all files in the simulated device's root. However, running the application on a real device results in the problem you've come across.

    In order for the Android OS to look for files in the app's home directory, all hyperlinks need to lose the forward slash. For example this file:
    <a href="/MyAccount.html">My Account</a>
    Should be referenced without the slash:
    <a href="MyAccount.html">My Account</a>

    Regards,
    Tina Stancheva
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
Back to Top