The HBuilder-made app runs normally on the local simulator, but the bug that js does not run after packaging

Description of the problem: This is a very troublesome problem that I encountered at the beginning. In a project, the app of our project can run normally on the local night god simulator and mobile phone, but when I package it After installing it on the mobile phone, it is found that the page js does not execute and generates garbled characters. What is the problem?

Troubleshoot issues: 

      1. First of all, I thought about compatibility. I checked the js code I wrote, and there was no compatibility problem.

  2. After eliminating the compatibility problem, I loaded this page repeatedly, it seems that none of the js of this page has been executed. I blocked all the js and put a pop-up box, and found that none of them were executed.

  3. If a single js on the page is not executed, it must be because the js is not loaded. I checked the link of scrict repeatedly, and finally I found that one letter of the linked js is uppercase, while my js files are all lowercase.

      4. Then the problem is obvious. The local operation ignores the case of the file name. When the official app runs on the mobile phone, the case is strictly stipulated, which leads to the problem that the js cannot be loaded.

      5. Sure enough, everything works fine after changing the case

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324774682&siteId=291194637