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:
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”.
- Filter logs.
Filter the RPC Exception field in the log message in the Android Studio console.
- 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.getUnionResourcein 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.
Resolve RPC exceptions according to different exceptions.
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.
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:
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.
- Check if the Package Name in the Android configuration and the uploaded APK file are consistent with the app project in the mPaas console.
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.