All Products
Search
Document Center

Mobile Platform as a Service:FAQ

Last Updated:Feb 03, 2026

Review the following list of frequently asked questions. Click a question to see the answer.

No network connectivity at compile-time

If you do not have network connectivity when compiling files, the compilation may fail. Follow these steps to ensure your compilation environment is connected to the network.

  1. Confirm that you are connected to the Internet.

  2. Confirm that you are not connected to a network proxy, such as a browser proxy or third-party proxy software.

  3. Confirm that no IDE proxy is set.

    idea 代理

  4. In the gradle.properties file, confirm that no Gradle proxy is set. This means the systemProp.http.proxyHost and systemProp.http.proxyPort properties are not set. If they are set, delete them. gradle代理

Program compilation failed

If the program fails to compile, follow these steps to troubleshoot and resolve the issue.

  1. Follow the steps in No network connectivity at compile-time to confirm that your compilation environment has a stable network connection.

  2. Check the Gradle execution log to confirm that the new dependency is valid.

  3. Verify that the group, artifact, and version (GAV) parameters of the dependency are correct.

    // Reference the debug package
    group:artifact:version:raw@jar
    bundle "com.app.xxxxx.xxxx:test-build:1.0-SNAPSHOT:raw@jar"
    // Reference the release package
    group:artifact:version@jar
    bundle "com.app.xxxxx.xxxx:test-build:1.0-SNAPSHOT@jar"
    manifest "com.app.xxxxx.xxxx:test-build:1.0-SNAPSHOT:AndroidManifest@xml"
  4. In your system's command line interface, run the following command to export the Gradle execution log:

    // Before you run the command, confirm that the productflavor property is not defined. Otherwise, the command will fail.
    // The following command exports the execution log to the log.txt file.
    gradle buildDebug --info --debug -Plog=true > log.txt
  5. View the exported log file. A record similar to the following indicates that the new dependency does not exist.

    Caused by: org.gradle.internal.resolve.ArtifactNotFoundException: Could not find nebulacore-build-AndroidManifest.xml (com.alipay.android.phone.wallet:nebulacore-build:1.6.0.171211174825).
    Searched in the following locations:
    http://mvn.cloud.alipay.com/nexus/content/repositories/releases/com/alipay/android/phone/wallet/nebulacore-build/1.6.0.171211174825/nebulacore-build-1.6.0.171211174825-AndroidManifest.xml
         at org.gradle.internal.resolve.result.DefaultBuildableArtifactResolveResult.notFound(DefaultBuildableArtifactResolveResult.java:38)
         at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository$LocateInCacheRepositoryAccess.resolveArtifactFromCache(CachingModuleComponentRepository.java:260)
  6. Access the HTTP link in the log (such as the third line in the log from the previous step) and log on to view the Maven repository.

    Note

    You can find the username and password required for logon in the build.gradle file.

  7. Run the following command to purge the gradle cache.

    gradle clean --refresh-dependencies
  8. If the Maven repository contains the dependency, delete the Gradle cache from your personal directory and then recompile. To delete the Gradle cache:

    • On macOS, Linux, or Unix systems, run the following commands.

      cd ~
      cd .gradle
      cd caches
      rm -rf modules-2
    • On Windows, navigate to the default path C:\Users\{username}\.gradle\caches and delete the modules-2 folder.

Stuttering during compilation

If the compilation process is unusually slow (for example, it takes more than 20 minutes), you can follow these steps to improve compilation efficiency.

  1. Follow the steps in the previous section to confirm that your compilation environment has a stable network connection.

  2. Confirm that the firewall is disabled.

  3. Confirm that no network proxy is configured for the IntelliJ IDEA compiler.

  4. In your code, configure the Maven repository in advance. For example, the following code configures the Alibaba Cloud Maven repository.

     apply plugin: 'maven'
     buildscript {
         repositories {
             mavenLocal()
    
     // First, load the Maven image
             maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
    
             maven {
                 credentials {
                     username "Use a known user"
                     password "Use a known password"
                 }
                 url "http://mvn.cloud.alipay.com/nexus/content/repositories/releases/"
             }
         }
         dependencies {
             classpath 'com.android.tools.build:gradle:2.1.3'
             classpath 'com.alipay.android:android-gradle-plugin:2.1.3.3.3'
             classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
         }
     }
     allprojects {
         repositories {
             flatDir {
                 dirs 'libs'
             }
             mavenLocal()
             maven {
                 credentials {
                     username "xxxxxxxxx"
                     password "xxxxxxx"
                 }
                 url "http://mvn.cloud.alipay.com/nexus/content/repositories/releases/"
             }
             maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
         }
     }

Compilation fails with a NullPointerException

空指针异常When connecting to Apsara Stack, the compilation may fail with a NullPointerException after you download the configuration file and connect to mPaaS. If this occurs, inspect the configuration file. Ensure that all 13 required fields are present and that the field names match those in the file downloaded from the public cloud.

How to debug an application

You need to debug code during development. This topic describes two debugging methods.

  • Start the application in debug mode

  • Debug the application after it is running

Start the application in debug mode

  • Scenarios

    You want to debug the initial code when the application starts, such as the initialization code during application init.

  • Procedure

  1. Run the command adb shell am start -W -S -D <application_package_name>/<first_activity_class_name>. For example, the package name of the mPaaS Demo is com.mpaas.demo, and the first activity class name is com.alipay.mobile.quinox.LauncherActivity. You can run the command adb shell am start -W -S -D com.mpaas.demo/com.alipay.mobile.quinox.LauncherActivity to start the application in debug mode. The first activity class name is shown in the following figure.

    img

  2. After you run the command, the following dialog box appears on your phone.

  3. Set a breakpoint on the line of code you want to debug, and then attach to the application's process, as shown in the figure.

    修改2.jpg

Debug the application after it is running

  • Scenarios

    You need to debug after an event is triggered, such as clicking a button or navigating to a page.

  • Procedure

    After the application is running, click the Attach to process (process) button to start debugging.

Notes on using MultiDex in mPaaS Portal and Bundle projects

We do not recommend using MultiDex for Portal and Bundle projects. The only exception is if a single portal project requires multiDexEnabled true. If a Bundle is too large, split the bundle instead of enabling MultiDex support for it.

How to clear the Gradle cache

Open the settings interface for the Gradle plugin and click the Clean Cache button to delete all cached data for the Gradle plugin.

插件设置界面

How to upgrade to the latest Gradle plugin

Note

This section applies only to the 10.1.68 baseline series. For more information about this baseline version, see Baseline introduction and 10.1.68 baseline series release notes.

The official Android Gradle Plugin from Google is version 3.5.x.

mPaaS also provides a compatible plugin at version 3.5.x, which supports the APIs of Google Android Gradle Plugin 3.5.3 and Gradle 6.2.

Changes to the import method

  1. You only need to add the following dependency to import the mPaaS plugin. You do not need to import the official Android Gradle Plugin because it is automatically imported due to transitive dependencies.

    dependencies {
    classpath 'com.alipay.android:android-gradle-plugin:3.5.18'
    }
  2. The Gradle Wrapper version must be 5.6 or later. We recommend using version 6.2.

Changes to usage

  • You no longer need to use apply plugin:'com.android.application'

    • If you have a portal project, you only need to use apply plugin:'com.alipay.portal'.

    • If you have a bundle project, delete apply plugin:'com.android.application', and use only apply plugin:'com.alipay.bundle'.

    • If you have a library project, delete apply plugin:'com.alipay.library', and use only apply plugin:'com.android.library'.

  • If you use the latest stable version of Android Studio 3.5 or later, you need to add android.buildOnlyTargetAbi=false to the gradle.properties file.

  • Because the mPaaS Security Guard component does not support V2 signing, you must disable V2 signing to debug and install the APK using Android Studio. If you build from the command line and your minSdkVersion is 24 or greater, you also need to disable V2 signing. To disable V2 signing:

    v2SigningEnabled false

Important

After clearing the cache, monitor and confirm that the miniapp and H5 pages work as expected.

The input file tag cannot open the camera on Huawei EMUI 10

Because the URI implementation on Huawei EMUI 10 differs from standard Android, you may not be able to open the camera on Huawei EMUI 10. Follow these steps to resolve this issue.

1. Upgrade the baseline

  • If you are using the 32 series baseline, upgrade to 10.1.32.18 or later.

  • If you are using the 60 series baseline, upgrade to 10.1.60.9 or later.

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

2. Configure FileProvider

You can reuse your existing FileProvider or create a new one.

  1. Create a new Java class that inherits from FileProvider.

    import android.support.v4.content.FileProvider;
    public class NebulaDemoFileProvider extends FileProvider {
    }
  2. In res/xml, create a new file named nebula_fileprovider_path.xml.

    <?xml version="1.0" encoding="utf-8"?>
    <paths xmlns:android="http://schemas.android.com/apk/res/android">
     <external-path name="external" path="."/>
    </paths>
  3. Add the configuration to AndroidManifest.

    <provider
     android:name="com.mpaas.demo.nebula.NebulaDemoFileProvider"
     android:authorities="com.mpaas.demo.nebula.provider"
     android:exported="false"
     android:grantUriPermissions="true">
     <meta-data
         android:name="android.support.FILE_PROVIDER_PATHS"
         android:resource="@xml/nebula_fileprovider_path" />
    </provider>
    Note

    The value of android:authorities, com.mpaas.demo.nebula.provider, is a sample from the mPaaS demo. You must set this value for your own application and must not use com.mpaas.demo.nebula.provider to prevent conflicts with other mPaaS applications.

3. Implement H5NebulaFileProvider

  1. Create a new Java class that implements H5NebulaFileProvider. Implement the getUriForFile method. In this method, call the FileProvider you implemented above to generate a URI.

    public class H5NebulaFileProviderImpl implements H5NebulaFileProvider {
     private static final String TAG = "H5FileProviderImpl";
    
     @Override
     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 H5NebulaFileProvider. After mPaaS initialization is complete and before starting the offline package, register H5NebulaFileProvider. The registration is global and only needs to be done once.

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

How to use or depend on mPaaS in a Library

When using the mPaaS framework, you sometimes need to reuse modules. To do this, add the module as a dependency. This topic uses the mPaaS Scan component's module as an example.

Prerequisites

You have connected your project to mPaaS using the native AAR method.

Procedure

  1. In your Android project, create an Android Library module named scan.

  2. In the build.gradle file of the new scan module, add api platform("com.mpaas.android:$mpaas_artifact:$mpaas_baseline"). The following is an example:

     dependencies {
         ……
         // This must be added when using mPaaS component features in a module.
         api platform("com.mpaas.android:$mpaas_artifact:$mpaas_baseline")
    
         ……
      }
  3. Use the mPaaS plugin in Android Studio to install the Scan component for the scan module. The menu path is: mPaaS > Native AAR Connection > Configure/Update Component > Start Configuration. After installation, the Scan component loads automatically.

  4. Configure the main app project.

     plugins {
         id 'com.android.application'
    
         ......    
         // You must add baseline.config (baseline) to the build.gradle file under app.
         id 'com.alipay.apollo.baseline.config'
     }
  5. Add the scan module as a dependency where you need to use the Scan component.

     dependencies {
         api platform("com.mpaas.android:$mpaas_artifact:$mpaas_baseline")
    
         ....
         api project(':scan')// Scan component
     }

How to resolve runtime error 608 or libsgmain native errors

If an exception occurs at runtime, search for the keyword SecException in the Android Studio operational log. If you find error code 608 or a libsgmain native error, follow these steps to troubleshoot.

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

    • Check if the configuration file contains Base64.

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

  2. Check if the META-INF folder contains the three files: CERT.SF, MANIFEST.MF, and CERT.RSA.

    • In app/build.gradle, enable v1SignEnabled.

    • Check if the build.gradle file in the project's root directory contains apply plugin: 'com.alipay.apollo.optimize'.3

If all these checks pass, the issue is likely with the signed APK package that was uploaded to the console, such as a signature error. You must upload the APK package again.