You are here: Configuring Your Computer > Install platform SDKs and their emulators > Android SDK and Emulator

Android SDK and Emulator

Building and testing Android applications in Quantum Visualizer requires two primary resources: Android SDK and Gradle. Gradle is an advanced build toolkit that manages dependencies and allows a developer to define custom build logic. This section describes how to install and configure these resources.

Prerequisites that you need to download:

For any queries you may have about installing Android SDKs and Android Studio, see Android SDK and Platform FAQs.

To build and view applications on the Android platform, do the following:

Download and install Android Studio

You must install Android Studio for building and testing Android applications using Quantum Visualizer. To download and install Android Studio, click Google Android Studio.

Download and unzip the Android SDK and support packages

Required SDKs and support packages can be optionally downloaded during the Android Studio installation process. If you have not downloaded the required SDKs during the Android Studio installation, you can download and install the Android Command line tools (stand-alone SDK tools) by doing the following:

To download and install the Android Command line tools and necessary support packages, do the following:

  1. Using a web browser, navigate to the Command Line Tools download section on the Android studio and SDK tools download site.
  2. Depending on the operating system of your computer, click the appropriate SDK tools package. After reviewing the terms and conditions of the Android SDK license agreement, if you agree to them, check the option indicating that you have read and agree to them, and then click the download button.
  3. Once the zip file downloads, navigate to the downloaded zip file location and unzip it. Place the contents in a folder in your system.

    Important: For Windows users, install the Android SDK to a folder with a path that has no spaces, for example:
    The default installation path contains at least one space, which may result in the emulator not being accessible in Eclipse and, therefore, Quantum Visualizer.

  4. Quantum Visualizer Android project will download all required SDKs, support packages, and any project specific build library dependencies using the Gradle Auto Download mechanism during the Android native project build.

    All required SDK, support packages, and dependent libraries are auto downloaded by Gradle build.
  5. You can also download the missing artifacts using Android Studio.

    Click Install missing platform(s) and sync project link in the message that appears.

    Select the defaults through the Component Installer and wait until Finish is enabled.

    Click the Install Build Tools 26.2 and sync project link in the message window.

    Select the defaults through the Component Installer and wait until Finish is enabled.

Known Issues:


Configure Quantum Visualizer to build for the Android platform

Now that you have installed the Android SDK, you need to configure Quantum Visualizer to recognize the Android platform.

To configure Quantum Visualizer to build for the Android platform, do the following:

  1. In Quantum Visualizer, click the Window menu, and then click Preferences.
  2. In the left pane, double-click Quantum Visualizer, and then click Build.
  3. If it hasn't done so already, at this point Quantum Visualizer auto-detects the Android SDK and asks if you would like to use the path that it has discovered as the Android Home. If you wish to, click OK. If Quantum Visualizer did not auto-detect the Android SDK, in the Android Home text box, enter the path to the Android SDK packages. To ensure you don't introduce errors into the path that you type, you may want to click the accompanying Browse button, navigate to the Android SDK's location, and then click OK.
  4. Click OK.
  5. Specify which Android SDK to use when building an app. To do so, on the Project menu, click Settings.
  6. In the Project Properties dialog box, click the Native tab. A row of secondary tabs displays. From this row, click Android.
  7. In the SDK Versions section of the tab, from the Minimum drop-down list, ensure you set the minimum SDK version.
  8. From the Target drop-down list, select the SDK version you would prefer to build for.
  9. Click Finish.

Set the Android SDK Home Environment Variable

The following procedure is for the Windows environment, for the Mac, run the following command:
export ANDROID_HOME=/<installation location>

To set the Android SDK home environment variable, do the following:

  1. Click Start.
  2. Right-click Computer, and then select Properties.
  3. Click Advanced system settings.
  4. On the Advanced tab, click Environment Variables.
  5. Under User variables, click New.
  6. For Variable name, type the following value:
  7. For Variable value, type the path to the parent directory where your Android SDK is installed. For instance:
  8. Click OK until you have closed all dialog boxes. Do not click Cancel.
  9. Restart your computer.

Manually Set the Android Environment Variables

Under some circumstances, you might have to add the Android SDK environment variables manually. This is most commonly necessary if you installed Quantum Visualizer before installing the Android SDK. If you already had the Android SDK installed when you install Quantum Visualizer, Quantum Visualizer detects the presence of the Android SDK and adds the necessary environment variables automatically.

For more information, click the procedure you want.

Add Windows Android Environment Variables Manually

Add Mac Android Environment Variables Manually

Add Windows Android Environment Variables Manually

To manually set the Android environment variables for a Windows computer, do the following:

  1. Click Start.
  2. Right-click Computer, and then select Properties.
  3. Click Advanced system settings.
  4. On the Advanced tab, click Environment Variables.
  5. Under System Variables, double-click Path.
  6. Add to the Path variable the location of the /bin folder in your installation of the JDK. For example:
  7. C:\Java\jdk1.7.0_79\bin

  8. Add to the Path variable the locations of the /emulators, /tools, and /platform-tools folders in your installation of the Android SDK. For example:
  9. C:\Android\android-sdk\emulator; C:\Android\android-sdk\tools;C:\Android\android-sdk\platform-tools

  10. Click OK until you have closed all dialog boxes. Do not click Cancel.
  11. Restart your computer.

Add Mac Android Environment Variables Manually

To manually set the Android environment variables for a Mac computer, do the following:

  1. In the home directory, locate .bash_profile, and then open it. If you do not have the .bash_profile file, create it.
  2. Add to the Path variable the locations of the /emulators, /tools, and /platform-tools folders in your installation of the Android SDK. For example:
    export PATH=/users/<userid>/android-sdk/emulator; /users/<userid>/android-sdk/tools; /users/<userid>/android-sdk/platform-tools:$PATH
  3. Save the file and close it.

Enable USB debugging on your Android Device

On Android 4.1 and lower, the Developer options screen is available by default. On Android 4.2 and higher, do the following:

  1. Open the Settings app.
  2. Select System.
  3. Scroll to the bottom and select About phone.
  4. Scroll to the bottom and tap Build number 7 times.
  5. Return to the previous screen to find Developer options near the bottom.
  6. Scroll down and enable USB debugging.

List Devices and View Logs

To List the Android devices connected to the Windows 10 PC, do the following:

  1. Navigate to C:\Users\USERNAME\AppData\Local\Android\platform-tools.
  2. Open a command window.
  3. Run adb devices -l to list the Android devices connected to the Windows 10 PC.

To connect to an Android device on your Windows machine, do the following:

  1. Navigate to C:\Users\USERNAME\AppData\Local\Android\tools
  2. Run monitor.bat and click on the connected device.

Configure an Android Emulator

Google has stopped supporting the standalone AVD manager and SDK Manager GUI tools, with latest Android SDK tools. When using, latest Android SDK tools >= 25.3.0, support for launching AVD Manager GUI to create android emulators and SDK manager to download missing components are deprecated from Quantum Visualizer V8 release. You must install Android Studio on your machine to get GUI to create and use Android emulators. Click here for more information.

Alternatively, you can use avdmanager command line utility to create the emulators. Refer for avdmanager command usage.

When using older Android SDK tools( < 25.3.0), you still would be able to create and launch AVDs using AVD Manager and SDK Manager GUI Tools.

Launch the App Using Run on My Device or the Emulator Menu

  1. Open your application project in Quantum Visualizer.
    The application opens in the default view.
  2. From the Build menu, select Build Native Local/Build and Publish Native.
    The Build Native Local/Build and Publish Native window appears.
  3. From the Post Build Action drop-down list, select Run on my Device/Emulator.
    A new category Configured Devices & Emulators appears.
    The Configured Devices & Emulators window displays available devices and emulators. Mobile Emulators appear under the Mobile section, and Table Emulators appear below the Tablets section.

  4. Select the Emulator on which you want to test the app.
  5. Click Build.
    The application generates and automatically opens on the devices or the AVD’s that are selected before. A message Application launched successfully on the device appears.
  6. Click OK.

There are two other options in this window that you can use.

Launch the App Post Successful Build

  1. Open your application project in Quantum Visualizer.
    The application opens in the default view.
  2. From the main menu, navigate to Build, select Build Native Local.
    The Build Native Local window appears.
  3. From the Post Build Action drop-down list, select Generate Native App or Run on my Device/Emulator.
  4. From the Platforms and Channels section, choose the channels you want to build the app.
  5. Click Build.
    Once the build is complete, details of the generated binaries appear in the Build.

    If you select Run on my Device/Emulator under the Post Build Action tab, the application installs and runs on the selected emulator.

    If you select Generate Native App under the Post Build Action tab, then Quantum Visualizer builds the app, you should run the application manually.
  6. Under the Build tab, you can see two sections: General and Mobile. Launch Emulators appear under the General, and Mobile platforms appear under Mobile. The mobile platform list appears based on your selection from the Build Native Local tab. This includes devices, emulators, and AVDs.

  7. Click Run to launch the app on your AVD.


Follow Gradle-related Changes for different Quantum Visualizer Versions

This section describes the various Gradle-related changes pertaining to different versions of Quantum Visualizer.

V8 SP2 Changes

V8 SP3 Changes

V8 SP4 Changes

Important Considerations

V9 Changes

V9 SP1 Changes

Important Considerations

Resolve AAPT errors on Windows 8 machines

If you are using Windows 8 machines, you may run into AAPT issues. Follow these steps to resolve AAPT errors on Windows 8 machines:

  1. Install the Windows 10 Universal C Runtime from :
  2. Extract the downloaded zip file.
  3. Double-click the .msu file that corresponds to your system configuration to run the Microsoft Update Standalone Package.

If you view the alert message Windows Update cannot check for updates, the service is not running, follow these steps to fix the error:

  1. Click Start from the taskbar.
  2. In the Search field, type Administrative Tools.
  3. In the Administrative Tools window, double-click Services.
  4. In the Services window, right-click Windows Update, and then click Properties.
    The Windows Update Properties (Local Computer) window appears.
  5. In the General tab, for the Startup type, select  Automatic (Delayed Start).
  6. In the Services window, ensure that the Windows Update Status has changed to Started, and close the window.
    If the Windows Update Status has not changed to Started, close the window and Restart your system.
Limitation with 32-bit Architecture Support on Mac OS Catalina

While building an app, if the Support for 32-bit devices option is enabled, build issues may occur. For information on how to resolve these build issues, refer MacOS Catalina issues.

Heap size issue

Depending on the available RAM, you can increase the heap size of the Android build by adding any of the following entries in entries:

For more information, refer gradle entries.

Migration to AndroidX from package

With the introduction of Android X packages, is now deprecated.

All references to made through NFIs, Android Manifest tag entries in Visualizer, Cordova and Reactnative entries must be replaced with androidx references manually, and the application must be rebuilt. This issue occurs due to an Android Build tools issue.
For more information on migration to AndroidX, click here.

Deprecated widgets

If an app contains deprecated widgets, when a user tries to launch the app, an exception appears and the app does not launch.

NDK Version Compatibility Issue

When you install the latest V9SP1GA Quantum Visualizer or, if you have the Android plugin version 9.1, you may face the following build error.

What went wrong:
Execution failed for task ':stripDebugDebugSymbols'.

No version of NDK matched the requested version 21.0.6113669. Versions available locally: 20.1.5948944 (or with different version)

To overcome the issue, you must install the 21.0.6113669 version of the NDK using Android Studio.

After opening the SDK manager under the SDK Tools section, select the Show package details checkbox to list all NDK versions in Android Studio.

If your project does not require the NDK support, you can fix the issue by renaming or deleting the NDK bundle folder in Android. The path for the NDF folder is ANDROID_HOME/ndk-bundle. ANDROID_HOME is the android sdk root folder.

Follow Gradle Recommendations

For using Gradle, you must go through the following sections:

Important: When you upgrade to Quantum Visualizer 8.2 and later, ensure that there are no conflicts in the dependencies of the build.gradle and libs folder. For example, appcompat-v7 added to the build.gradle is X version and if the same file is in the libs folder is of Y version. Due to differences in versions of the file, following build exceptions occur.
duplicate entry exception or Unable to merge dex
For more information on how to debug these type of conflicts, click here.

General Recommendations

Build-related Recommendations

Build failures occur if there are any deviations from the Android-specified requirements. To build an understanding of how Android enforces its requirements, you can create a native application and test various scenarios. In creating such an app, you will want to be aware of the following:

Compilation Dependencies and Gradle Build Java Symbol Conflicts Resolution Methodology

If the build fails with the following exceptions and you do not know the root cause, following the debugging procedure provided here:

The debugging procedure for these build issues is as follows:

  1. Find the two jars/dependencies that are conflicting by making the following changes in the generated native Android build project. These latest tools will print exactly which classes conflict and their sources/origins. These are taken from Google's suggestions form:
    1. Go to the folder where the native Android project is generated:
      • For Mobile: <workspace>\temp\<appid folder>\build\luaandroid\dist\<appid folder>\

      • For Tablet: <workspace>\temp\<appid folder>\build\luatabandroid\dist\<appid folder>\

    2. Change version to 3.4.0-beta03 in the build.gradle file:
      buildscript {dependencies{classpath ''}}
    3. Change the distributionUrl in the file (available in dist\<appid folder>\gradle\wrapper) to
    4. Type the following command in the command prompt, with the same directory as the native Android project: gradlew assembleDebug

    The build log then prints the complete details of all the conflicting libraries that fetch duplicate classes.

  2. Identify from where the conflicting dependencies are pulled by using this command: gradlew dependencies
    This command helps you to view the dependency tree hierarchy in your project. You can then locate the dependency version that was enforced by the relevant compilation dependency.
  3. Resolve the conflicts by following these steps:
    1. Adopt the conflict resolution strategy, if dependency version conflicts is the reason. For example, if the project specifies design dependency version (say X) and another version of design dependency (say version Y) is pulled form recursive dependencies of another dependency (say appcompat-v7), then the build fails.
      To resolve this build issue, you can force the build to use only the Y version, regardless of any version included by the dependency tree by adding a snippet as shown in the build.gradle.
    configurations.all {
        resolutionStrategy {
            force ""
    1. Remove any duplicate jars or classes found in any of the .aar files and libraries.
      For example, you can use the following script to delete the volley and gson-2.2.4 jar files from libs if they conflict with your dependencies in the build.gradle file.

      task deleteJars
      delete "libs/volley.jar"
      delete "libs/gson-2.2.4.jar"

Note: To add additional entries in the build.gradle file, select the build.gradle entries to suffix option under the Gradle Entries tab in Application Properties. For more information on Gradle properties, click here.

Proxy-Related Build Recommendations

If your computer has proxy settings, you can alleviate build errors at the system level, and at the project level.

System-Level Proxy Recommendations

To address proxy-related build issues at the system level, you can either disable your computer's proxy settings, or create a file to your Gradle installation.

To create a file, do the following:

  1. Navigate to the following folder:
    For Windows

    For the Mac
  2. Create a new text file using a text editor such as Notepad or TextEdit, and save it with the following file name:
  3. Edit the file to include the following settings (replace the values given in the example with your own settings).
  4. Replace http with https, based on the proxy server settings.
  5. For more information, see The Build Environment on the Gradle web site.

Project-Level Automated Recommendations

To automate project-level requirements, do the following:

    1. Create Android pre-compile and post-compile automated tasks. For more information, see Android Pre-compile and Post-compile Ant Tasks Support.
    2. Add the file mentioned earlier to the project folder. For example:
      For Windows

      For the Mac
    3. Copy the file androidprecompiletask.xml from the path
    4. Open androidprecompiletask.xml in a text editor such as Notepad or TextEdit, and edit it as your situation requires. For example:
    <target name = "PreCompileSetup">
    <echo message = "basedir = ${basedir}, appdir = ${app.dir}, isMobileBuild = ${isMobileBuild}">
    <echo message = "Build mode = ${build.option}, Packagepath = ${packagepath}, x86 Support = ${supportx86}">
    <delete file = "${app.dir}/">
    <copy file = "${basedir}/">
    tofile = "${app.dir}/">
  • Project-Level Manual Recommendations

    To manually make the necessary changes at the project level, do the following:

    Note: This needs to be done following each time you build the project

    1. In Windows Explorer or Finder, navigate to the following path:

      For Windows

      For the Mac
    2. If you haven't done so already, edit the file to include the proxy settings mentioned earlier.
    3. Open a command or terminal window.
    4. Navigate to the path in step 1.
    5. Build the application using the following command line:
      gradle assembleDebug

    Packaging Error Build Recommendations

    Android generates a packaging error if one or more JAR files have duplicate files or classes. To solve this issue, do one of the following:

    Convert JPGs named as PNGs to the PNG Format

    Gradle checks for PNG files while building your application. If a JPEG file in the folder is named as a PNG file (that is, the JPG has a .png extension) Gradle generates a build error. To avoid this issue, Quantum developed a Python script tool to check if the image files are correctly named. You can use this tool to convert the JPEG files to PNG.

    To use the Python JPG conversion tool, do the following:

    1. Install the following Python executables: 

    3. Download the following archive from here and execute the following command: 
    4. $ python -p E:\res\drawable(replace with the folder)

    Common Issues with Gradle Migration

    The following issues and errors can arise as a result of a Gradle migration.

    Gradle Could not resolve
    This condition can occur if there is no internet connection or when the system is being used when the proxy is not set. To resolve, set the proxy, or connect the computer to an internet connection.

    Error: Gradle Wrapper not found in Android SDK
    If you have been using Cordova applications in Visualizer and upgrade your Android SDK tools version to later than 25.2.5, when you build a project with Cordova support the Gradle Wrapper not found error occurs. Android removed Gradle wrapper package from the Android SDK tools version later than 25.2.5. As a result, Gradle wrapper does not exist in the Android SDK PATH and that results in the error.

    To resolve, add Gradle to your path environment variable. For more information, refer to Gradle in Android Platform Guide.

    Error: Unsupported type net, etc.
    This condition can occur if the application is packing some internal files which are used in the android fwk, this would normally happen if the application is be packing *.xml which can be found in the following folder:
    To resolve, modify the XML files to change the custom tags net to string.

    Duplicate Entry error
    Occurs when the same .jar files are being added multiple times, or when different .jar files have the same classes. To resolve, remove the duplicate classes from .jar files.

    Gradle OOM issue
    To resolve, add javaMaxHeapSize (build.gradle), org.gradle.jvmargs( values to the script. These are general options, which you can configure according to the needs of your app.

    Peer not authenticated (proxy with https setting)
    To resolve, download the local proxy server certificate and add it to the Java Key store.

    Error: Could not create the Java Virtual Machine
    Usually occurs when Gradle is not able to allocate the required memory to build the project, generally noticed on 32-bit computers. If the error occurs on a 64-bit computer, add javaMaxHeapSize (build.gradle), org.gradle.jvmargs ( values to the script. These are general options, which you can configure according to the needs of your app.





    Copyright © 2020 Temenos. All rights reserved.