How to fix the connection to the server was unsuccessful. (file ///android_asset/www/index.html)

后端 未结 8 770
借酒劲吻你
借酒劲吻你 2021-02-02 07:24

I\'ve added material icons to ionic2 app , and since then I get error \"\"The connection to the server was unsuccessful. (file:///android_asset/www/index.html)\"\" although the

相关标签:
8条回答
  • 2021-02-02 07:52

    So I added manually the following tags in config.xml right at the beginning:

    <allow-navigation href="*" />
    <content src=“index.html” />
    <content original-src=“index.html” />
    

    it’s working.

    0 讨论(0)
  • 2021-02-02 07:54

    Adding that ...value="70000" or "60000" line in config.xml isn't the best solution and it doesn't always work nor the creation of main.html file .

    I was dealing with the same issue. These two solutions did not work for me.

    SOLUTION

    -Make sure you build with

    ionic cordova build --prod and not ionic cordova build

    -Check if one of your file or folder name doesn't contain Uppercase in it's context before building

    like for example in "pages"

    • templateView (instead of "templateview)

      • -templateview.ts
      • -templateview.html
      • -templateview.scss

    and rename it (otherwise you will have errors)

    When building finished, your app runs correctly without the "(file:///android_asset/www/index.html)" error.

    0 讨论(0)
提交回复
热议问题