All Products
Document Center

Mobile Platform as a Service:FAQ

Last Updated:Aug 22, 2023

Check the following FAQ list, then click the specific questions to view the answer.

No network connection when you compile

When you are compiling files, if there is no network, the compilation may fail. Follow the steps to confirm that the network of compilation environment is connected.

  1. Confirm that the Internet is connected.

  2. Confirm that the network proxy is not connected, including browser proxy settings and third-party network proxies.

  3. Confirm that the IDE proxy is not configured.

    idea proxy
  4. In the file, confirm that the Gradle proxy is not configured. That is, the systemProp.http.proxyHost and the systemProp.http.proxyPort attribute is not configured. If configured, you can delete the relevant attribute.

    gradle proxy

Program compilation failed

If program compilation failed, you can make troubleshooting and solutions by following the steps.

  1. According to the preceding steps, you can confirm that the network of compilation environment is connected.

  2. Check the Gradle execution log to confirm if the added dependency is valid.

  3. Check if the dependent GAV parameters including group, artifact, and version are configured correctly.

    //Reference the debug pack group:artifact:version:raw@jar
    bundle ""
    //Reference the release pack group:artifact:version@jar
    bundle ""
    manifest ""
  4. In the command line tool built in the system, execute the following command to export the Gradle execute logs:

    // Before executing the command, confirm the undefined productflavor attribute. Otherwise, the command will fail to run.
    // The following command will export the execution log to the log.txt file.
    gradle buildDebug --info --debug -Plog=true > log.txt
  5. Check the log file exported from the fourth step. In the latest log, you will see the following record, which means the added dependency does not exist.

    Caused by: org.gradle.internal.resolve.ArtifactNotFoundException: Could not find nebulacore-build-AndroidManifest.xml (
    Searched in the following locations:
         at org.gradle.internal.resolve.result.DefaultBuildableArtifactResolveResult.notFound(
         at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository$LocateInCacheRepositoryAccess.resolveArtifactFromCache(
  6. Visit the http link in this log and log on to check the Maven library. For example, the http link can be the third line in the log listed in the preceding step.


    In the build.gradle file, you can check the account name and password that you need to provide when you log on.

  7. Execute the following command to refresh the gradle cache.

    gradle clean --refresh-dependencies
  8. If the Maven library has a relevant dependency, delete the Gradle cache under your personal directory, then recompile.

    The method of deleting the Gradle cache is as follows:

    • In the system such as macOS, Linux, and Unix, run the following commands:

      cd ~
      cd .gradle
      cd caches
      rm -rf modules-2
    • In the Windows system, by default, the path will be located to C:\Users\\{Username}\\.gradle\caches. Delete the modules-2 folder.

Access problem during compilation

If there is an access problem during compilation, (you have waited for more than 20 minutes) you can improve the compilation efficiency by following the steps.

  1. According to the preceding steps, you can confirm that the network of compilation environment is connected.

  2. Confirm that the firewall is closed.

  3. Confirm that the network configuration of the IntelliJ IDEA encoder is inactivated.

  4. In the code, load Maven images in advance. See the following code example of Maven images loaded by Alibaba Cloud.

apply plugin: 'maven'
buildscript {
    repositories {

// Load Maven images at first
        maven{ url ''}

        maven {
            credentials {
                username "Use the known user"
                password "Use the known password"
            url ""
    dependencies {
        classpath ''
        classpath ''
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
allprojects {
    repositories {
        flatDir {
            dirs 'libs'
        maven {
            credentials {
                username "xxxxxxxxx"
                password "xxxxxxx"
            url ""
        maven{ url ''}

When you access to Apsara Stack, after downloading configurations and accessing to mPaaS, compilation is rejected and NullPointerException occurs

Null pointer exceptionIn general, this is the problem of the configuration file, namely, the conf file. You need to check the fields. Check if any of the thirteen fields are missing. Compare with the files downloaded from the public cloud, and confirm if the field name is correct.

How to debug applications

During the development, you need to debug codes. This topic describes two debug methods.

  • Start the application through the debug mode

  • Run the application, then start debugging

Start the application through the debug mode

  • Use cases:

    The initial code that you want to use when the debug application launched. For example, initialize the code during application init.

  • Procedures:

  1. Execute the command adb shell am start -W -S -D application pack name/The type name of the first page launched by the application. For example, the pack name of the mPaaS Demo is com.mpaas.demo, and the type name of the first page launched by the application is You can use the command line adb shell am start -W -S -D com.mpaas.demo/ to launch the application through the debug mode. See the following picture for the first type name launched. img

  2. After the command is executed, the following dialogue box will appear on the mobile phone.

  3. Set the breakpoint to the code line you want to debug. Then attach the breakpoint to the process where the application is. See the following picture.


Run the application, then start debugging

  • Use cases:

    Start debugging after you trigger an event. For example, only when you click a button or redirect to a page, you need to debug.

  • Procedures:

    After running the application, click the attached Process button. Or after executing the preceding command, click the attached button, then start debugging.

Precautions for using MultiDex in the mPaaS Portal and Bundle projects

Portal and Bundle are not suggested to intervene in the MultiDex. Unless you are in the single portal project, and need to use the multiDexEnabled true.If your Bundle is too big, you can only continue by the method of splitting the bundle. Do not activate the multidex support in the bundle.

How to clear the Gradle cache

Open the configuration page of the Gradle plug-in, then click Clean Cache button to delete all the cache data of the Gradle plug-in.

Plug-in configuration interface

Upgrade to the latest Gradle plug-in


The content of this section is only applicable for 10.1.68 baselines. For more information about the baseline of this version, see Introduction to the baseline and Launch instructions of 10.1.68 baselines.

The version of the Android Gradle Plugin provided by Google is 3.5.x at the moment.

mPaaS also provides the plug-in of 3.5.x version as the adapter, which supports the APIs of Google Android Gradle Plugin 3.5.3 and Gradle 6.3.

Change in the access methods

  1. You only need to import our plug-ins by adding the following dependency instead of importing the official plug-in of Android Gradle Plugin. Because of the dependency transmission, the plug-in will be imported automatically.

    dependencies {
    classpath ''
  2. The version of Gradle Wrapper needs to be upgraded to 5.6 or later versions. Version 6.3 is recommended to use.

Change in the usages

  • No need to use the apply plugin:'

    • If you are in the portal project, you only need to use the apply plugin:''.

    • If you are in the bundle project, you need to delete the apply plugin:'' and only need to use the apply plugin:''.

    • If you are in the library project, you need to delete the apply plugin:'' and only need to use the apply plugin:'

  • If using the latest stable version of Android Studio 3.5 or later versions, you need to add android.buildOnlyTargetAbi=false in the

  • Our wireless security components do not support V2 signatures at the moment. Thus, if you need to use Android Studio debugging and install your APK, you need to disable V2 signatures. If you use the command line for creation, and your minSdkVersion is greater than or equal to 24, you need to disable V2 signatures as well. See the following method of disabling V2 signatures:

    v2SigningEnabled false

After clearing the cache, you need to check if the mini program and HTML5 work.

Camera cannot be turned on through the input file label in Huawei 10 System

There are some differences between the implementations of Huawei 10 system URI and the standard Android. Thus, you may meet problems such as failing to turn on the camera in Huawei 10. You need to execute the following steps to solve this problem.

1. Upgrade baselines

  • If you are using 32 baselines, you need to upgrade the baseline to or later.

  • If you are using 60 baselines, you need to upgrade the baseline to or later.

  • If you are using 68 baselines, you need to upgrade the baseline to 10.1.68-beta.3 or later.

2. Configure FileProvider

You can reuse your current FileProvider or create a new FileProvider.

  1. Create a new Java class to inherit the FileProvider.

    public class NebulaDemoFileProvider extends FileProvider {
  2. Create a new nebula_fileprovider_path.xml in res/xml.

    <?xml version="1.0" encoding="utf-8"?>
    <paths xmlns:android="">
     <external-path name="external" path="."/>
  3. Add configurations in AndroidManifest.

         android:resource="@xml/nebula_fileprovider_path" />

Here the value of android:authorities, namely com.mpaas.demo.nebula.provider is an mPaaS sample code. You need to configure by yourself based on your applications. And the value cannot be configured as com.mpaas.demo.nebula.provider, which will have conflicts with other mPaaS applications.

3. Implement the H5NebulaFileProvider

  1. Create a new Java class, then implement the H5NebulaFileProvider and the getUriForFile method. In this method, you can call the implemented FileProvider to generate URI.

    public class H5NebulaFileProviderImpl implements H5NebulaFileProvider {
     private static final String TAG = "H5FileProviderImpl";
     public Uri getUriForFile(File file) {
         try {
             return getUriForFileImpl(file);
         } catch (Exception e) {
             H5Log.e(TAG, e);
         return null;
     private static Uri getUriForFileImpl(File file) {
         Uri fileUri = null;
         if (Build.VERSION.SDK_INT >= 24) {
             fileUri = NebulaDemoFileProvider.getUriForFile(LauncherApplicationAgent.getInstance().getApplicationContext(), "com.mpaas.demo.nebula.provider", file);
         } else {
             fileUri = Uri.fromFile(file);
         return fileUri;
  2. Register the H5NebulaFileProvider.

    After you complete the mPaaS initialization, register the H5NebulaFileProvider before you start the off-line pack. Register once will take effect globally.

    H5Utils.setProvider(H5NebulaFileProvider.class.getName(), new H5NebulaFileProviderImpl());

How to depend on and use mPaaS in library?

While using mPaaS, a module needs to be reused sometimes. The reuse is implemented by adding the module as a dependency. This section illustrates this method with an example of reusing scan module.


The project has been accessed to mPaaS in native AAR mode.


  1. Create an Android Library type scan module in the project.

  2. In the build.gradle file of the newly created scan module, add the following codes api platform("$mpaas_artifact:$mpaas_baseline"). The example is as follows:

     dependencies {
         //This line is necessary when using mPaaS in the module.
         api platform("$mpaas_artifact:$mpaas_baseline")
  3. Install scan component for scan module by Android Studio mPaaS plug-in. The directory is : mPaaS > Native AAR mode > Configure/Update component > Start configuration. After the installation, the scan component will automatically load.

  4. Configure App main project.

     plugins {
         id ''
         // baseline.config (baseline) must be added in the build.gradle file of app module.
         id ''
  5. Call module.

    Import scan module where it is used.

     dependencies {
         api platform("$mpaas_artifact:$mpaas_baseline")
         api project(':scan')//scan module

How to fix 608 errors at runtime or native errors with libsgmain

  1. If an exception occurs during runtime, search for the keyword SecExcetpion in the Android Studio runtime log, and find that there is a 608 error code or a native error of libsgmain, you can follow the steps below to troubleshoot.

    1. Drag and drop the APK directly into Android Studio and check if the targetSdkVersion in the Androidmenifest file is a version between 26-28.1

    2. Check if the res/drawable/yw_1222.jpg file exists.

      • Check the config file for Base64.

      • Check if the Gradle plugin baseline.update or baseline.config is applied.2

    3. Check META-INF for three files, CERT.SF, MANIFEST.MF, and CERT.RSA.

      1. Turn on v1SignEnabled in app/build.gradle.

      2. Whether there is apply plugin: '' in build.gradle in the project root directory.3

    After performing the above check steps and confirming that the result is correct, it means that there is a problem with the signed APK package uploaded on the console. If the signature is incorrect, the APK package needs to be re-uploaded.