uniapp offline packaging can not jump to the new page

Background:
Create a new page, use navigateTo to jump, generate offline packaging resources, and perform offline packaging in Android Studio. After completion, install (the phone already has a lower version) to the Android phone. After installation, click Jump, the first time It is reported that the page cannot be found. After closing the software and re-entering, click to jump normally

Reason:
Andriod Studio has a cache problem when debugging on the real device. There is no cache problem in the official release package.

If you are using a release package, check yourself:

  1. Android studio project clean project before packaging
  2. www/manifest.jsonDetermine the name and code version upgrades in files in local packaged resources
     "version": {
         "name": "xx",
         "code": "xx"
      }

manifest.jsonCorresponding to the versionName and versionCode in the uniapp project

{
    "name" : "",
    "appid" : "",
    "description" : "",
    "versionName" : "2.4.0",
    "versionCode" : 240,
    "transformPx" : false,
    "app-plus" : {}
}

I just did not upgrade versionName and versionCode synchronously, so the resulting page does not jump, and it will be fine after the upgrade.

Guess you like

Origin blog.csdn.net/weixin_41767649/article/details/126536294