All Products
Search
Document Center

Mobile Platform as a Service:mPaaS mini program prompts "Application update error" in code scan

Last Updated:Jul 20, 2023

Problem description

The Mobile PaaS (mPaaS) mini program prompts a toast message, "Application update error (50002)", in app scan.

Common cause

To use the real-device debug feature by code scan, perform the following steps:

  1. Generate a QR code in the integrated development environment (IDE) of the mini program for mobile phone clients to scan. Then, the mini program package is uploaded to Mini Program Release on the mPaaS console.

  2. After a mobile phone client scans the QR code, it automatically sends an RPC request to pull the AMR file on the console.

After the Mini Program update API is called, if the corresponding mini program information is not obtained, the "Application update error (50002)" message will be prompted.

The possible causes of the problem include:

  • The mini program is not released on the server.

  • The console does not release the uploaded mini program.

  • When a mini program is released, the server has not received the newly released mini program.

  • The client version is out of the range.

  • The requested information does not match the rules released on the server.

Troubleshooting procedure

  1. Filter the logs. Filter the DynamicRelease keyword in the log information of the Android Studio console. Check whether the Item information is included in UnionResourceInfo.

    • In normal cases, the item information is included, as shown in the following example:

      UnionResourceResult{success=true, message=成功, info=[UnionResourceInfo{bizType=NEBULA, success=true, rollback=false, item=[UnionResourceItem{resId=2021011520210115, resVersion=1.0.5.1, fileMD5=9a31d39d20301b74c93317e75f36dd58, fileUrl=https://mcube-prod.oss-cn-hangzhou.aliyuncs.com/ONEX4CFD5B3081617-default/2021011520210115/1.0.5.1_all/nebula/2021011520210115_1.0.5.1.amr, downloadType=CDN, storeType=MEM, resStatus=1, resExtraData=[UnionExtraData{key=app_type, value=1}, UnionExtraData{key=resType, value=4}, UnionExtraData{key=autoinstall, value=1}, UnionExtraData{key=fallbackbaseurl, value=https://mcube-prod.oss-cn-hangzhou.aliyuncs.com/ONEX4CFD5B3081617-default/2021011520210115/1.0.5.1_all/nebula/fallback/}, UnionExtraData{key=scene, value=DEBUG}...,
    • If the item information is not included, an exception occurs, as shown in the following example:

      [URGENT_DISP_12] mpaas_url = https://cn-hangzhou-component-gw.cloud.alipay.com/mgw.htm
      DynamicRelease: [NetworkThread#1] DynamicReleaseLauncher rpc time: 1611736340256
      DynamicRelease: [URGENT_DISP_12] rpc result: UnionResourceResult{success=true, message=success, info=[UnionResourceInfo{bizType=NEBULA, success=true, rollback=false, quickRollback=0}]}
  2. Check the feature of real-device preview and debugging is integrated. Follow the procedure of integrating real-device preview and debugging into an Android mini program. You can then verify whether the integration is performed correctly.

  3. Check the range of the client version. The version number corresponds to the versionName value of the Android project. The mini program can be pulled normally only when the following condition is satisfied: the lowest version number < the version number of current app < the highest version number. If the version number is not in the range, the app will fail to pull the mini program when starting it, and will report the "Application update error" message. Therefore, we recommend that you enter 0.0.0.0 for the lowest version and leave the highest version box empty (which means infinity).

    Note

    Because the mini program is automatically uploaded to the console when you upload, preview, or use a real device to debug in the IDE of the mini program, you do not need to modify the configuration information on the console. Therefore, we do not recommend that you add mini program packages from Mini Program Release so as to avoid main path inconsistency. To modify a mini program, you can modify it in the IDE of the mini program.

  4. Check the main entry path. Verify that the main entry path of the mini program configured on the mPaaS console is the same as that configured in the IDE of the mini program. By default, the main path on the mPaaS console is in the following format: /index.html#xxx/xxx/xxx/xxx, where, xxx/xxx/xxx/xxx after # is the first value in pages of app.json.

If the problem persists, prepare a demo project that reproduces the problem and join the DingTalk group 41708565 for consultation.