All Products
Search
Document Center

mPaaS mini program prompts: Network not available, try again later

Last Updated: Mar 10, 2021

Problem description

When Android developers try to open the mini-program in the application after completing the mini-program access, the container page shows the error message “Network not available, try again later”, which is shown in the following figure:

poor_connection

Common cause

Before mPaaS opens a mini-program application, mPaaS first needs to know the basic information of the mini-program package, so the client will actively pull the offline package information through mPaaS RPC alipay.client.getUnionResource. If the acquisition of mini-program package information fails, which means RPC is abnormal, the mini-program container will prompt the error “Network not available, try again later”.

Troubleshooting procedure

  1. Filter logs.
    Filter the RPC Exception field in the log message in the Android Studio console.
    RPC Exception
  2. Query of the exception code.
    As described in Common cause, the client needs to actively pull offline package information, and the pulling process relies on the RPC request. If there is an issue with the RPC link, the offline package information can not be obtained properly and causes a load failure. To confirm if there is an issue with the RPC request, search for alipay.client.getUnionResource in the Android Studio console to see if the RPC request returns properly. If errors exist, general error codes include the 7XXX series and so on, such as:
    Error code Description Examples
    7000 Public key has not been set up There is no key corresponding to the App ID in the security guard of the mobile app.
    7001 Parameters for signature verification are not sufficient Signature verification on the gateway server side has failed.
    7002 Unable to verify the signature. Signature verification on the gateway server side has failed.
    7003 Signature verification - time-sensitive failure The timestamp of the API request entry ts exceeds the valid time limit set by the system.
    7007 Signature verification - missing of ts parameters The API request is missing the ts parameters of signature verification.
    7014 Signature verification - missing of sign parameters The API request is missing the sign parameters of signature verification.
  3. Resolve RPC exceptions according to different exceptions.

    • 7000-7002
      This exception means that there is an issue with image generation. Follow the steps of accessing Android to regenerate the image. If you are using an Apsara Stack environment, you need to contact the support for troubleshooting.
    • 7003, 7007
      This exception means an issue of the time validity of the signature verification. The exception may be caused by a time difference between the time of the phone and service time of the gateway. If the time difference is more than 30 minutes, this exception may occur, you need to check the time of the phone.
    • 7014
      This exception means that the APK signature uploaded by the mPaas console does not match the signature in the information of the application package. The troubleshooting methods are as follows:

      1. Check the debug environment signature of the APK package uploaded to the mPaaS console is configured correctly. Add debug and release information to the configuration of the Gradle package in the app. Normally the phone runs in a package debug environment, so you need to configure the debug information.

        1. signingConfigs{
        2. debug{
        3. keyAlias 'key0'
        4. keyPassword '123456'
        5. storeFile file('D:/project/signFile/xx.jks')
        6. storePassword '123456'
        7. }
        8. release{
        9. keyAlias 'key0'
        10. keyPassword '123456'
        11. storeFile file('D:project/signFile/xxx.jks')
        12. storePassword '123456'
        13. }
        14. }
    1. Check if the Package Name in the Android configuration and the uploaded APK file are consistent with the app project in the mPaas console.

Ticket for assistance

If you still cannot solve the issue, prepare a demo project to reproduce the issue and contact the mPaaS post-sale support through Alibaba Cloud Ticket system.