Android - FAQ and Common IssuesOfficial Content

Which version is supported?

Refer to Android Requirements for version specific information.

Enabling logging

Check that you have Enable Logging main object property set to "debug" (i.e. any value but "off")

Getting Crash Logs and Console Output

In order to see what is happening when app is executing in background exists Catalog. The Catalog is an Android application that allows you to debug your apps or find error stacktraces in order to see what is happening in the background of your applications. If you are using the Android emulator instead of a device, you can generate some debugging information by executing the following command line:

> <android_sdk_path_platforms-tools>\adb.exe logcat > <some_path_in_your_machine>\<some_file_name>.txt

Example:
> adb.exe logcat > c:\temp\log

Note: check Offline Synchronization Log Level property for offline app debugging

How to customize the emulator (AVD)

The AVD used by GeneXus is created the first time an application is run (i.e. F5 is pressed). AVD-Manager tool allows changing AVD properties (e.g. change AVD resolution) when the emulator is not launched and even create new ones. In order to launch a non-default emulator, you must run it manually from the avdmanager, and then rerun your application from GeneXus.

 

How to manually install the KBN

KBN is installed automatically when the application is run. However, if you want to install it manually follow these instructions:

  1. Open a command line prompt.
  2. Change the current directory to Android SDK\tools directory (e.g. "C:\Program Files\android-sdk-windows\tools")
  3. Run this command: "adb install -r "C:\<GenexusInstallationDirectory>\Android\GenexusPrototyper.apk"

Notes

  • Depending on the build being used the APK name could be "KBNavigator.apk".
  • adb command location may vary (e.g. C:\Program Files\android-sdk-windows\platform-tools).
  • This tool has been deprecated as of GeneXus 15.

 

When a Menu (ex Dashboard) object is run, what options are displayed?

The options are obtained from a JSON file located on the server you’re accessing. The content of this metadata can be verified using a browser. The URL has the following aspect http://<BaseURL>/gxmetadata/<dashboard_name>.menu.json (e.g. http://sdxapps.genexus.com/gcinv10e/gxmetadata/maindashboard.menu.json). 

The result should be something as follows:

{
  "Dashboard": {
    "@Title": "",
    "@Background": "",
    "@Header": "",
    "@Icon": "",
    "@Class": "",
    "instanceProperties": {
      "@IsMain": "True"
    },
    "Item": [
      {
        "@Name": "Customer",
        "@Description": "",
        "@LowCardinality": "False",
        "@Image": "",
        "@Class": "",
        "@Link": "",
        "@LinkType": "Page",
        "@Data": "15cf49b5-fc38-4899-91b5-395d02d79889-WorkWithDevicesCustomer"
      },
     ....
     ]
}

Note
This answer applies for both Android and iOS.

 

Troubleshooting

The android device is connected by usb cable, but the emulator is always opened instead of prototyping with the device.

The main reason is that the android driver is not installed. Even if you may see your device model with the Windows Explorer, you may access your device's files, or the Windows Device Manager is showing your device as Portable Device, it doesn't mean that the android device is recognized.

Thus, the build process will not find any android device connected, and the run process check sequence will start a new emulator, using the default AVD.

To check if the android device is properly recognized by Windows, you should execute the following command line: 

<android_sdk_path_platforms-tools>\adb.exe devices >

Example:

adb.exe devices

If the devices is recognized, the adb utility will show the device id:

adb devices

Another way to check that the android device is recognized as a device for Windows, is to open the Device Manager and look for an entry called i.e.: "SAMSUNG Android ADB Interface", under "SAMSUNG Android Phone":

Android ADB Interface

If you don't have the driver installed, you may look for it at the factory Internet site.

Another way to get the suitable driver, is by installing the software you use to synchronize the device with your computer. The software will install the adequate driver for your device.


What does the "Force close or wait" dialog that reads "Application Android keyboard (in process com.android.inputmethod.latin) is not responding." mean?

Android - Keyboard message This error could be displayed when the emulator is running slowly. Try using the "wait" option. More info.

I'm getting the message: "android.util.AndroidException: Can't connect to activity manager; is the system running?"

Just try pressing F5 again.


I'm getting the message: "Waiting for device to become ready... (this may take a while)" and it takes forever

The output is similar to:

Command:emulator -avd myGxAvd
Waiting for device to become ready... (this may take a while)

Also, if you try to run the emulator manually with this command (located in "<Android SDK Directory>\tools"):

emulator -avd myGxAvd

...you get:

emulator: Error: unknown virtual device name: "myGxAvd"
emulator: could not find virtual device name: "myGxAvd"

However, the AVD is listed in the SDK Manager. This is due to a known bug in the SDK emulator.exe app that doesn't find the avd file. Please fix by adding a System Variable called ANDROID_SDK_HOME that points to the root of where the SDK Manager is storing your AVD (you can find this path at the top of the list of virtual devices in the SDK Manager).

Example:
ANDROID_SDK_HOME = "C:\Windows\system32\config\systemprofile\"
or
ANDROID_SDK_HOME  = "C:\User\myuser\"

More info here. Then try again running the emulator.


Run Developer Menu Failed

Output window shows:

Calculating Mobile Targets...
Command:android list avd
Run Developer Menu Failed"

Cause: GeneXus doesn't find the avd.exe file.

Solution: Check "Android SDK Directory" Smart Device generator property and check Android Requirements.


Error: no applications found

The following window appears:

Android No application found

Cause: The emulator was launched but no application was found.

Solution: You must create a main object (SD Panel, WWSD or Dashboard).


Error HTTP 404.0 - Not Found

When browsing a REST service (e.g. http//localhost/<ApplicationName>/rest/<transactionName>) the following error appears:

Error HTTP 404.0 - Not Found

Cause: The server is running on IIS and URL rewriting is not installed or .svc extension is not properly registered in IIS.

Solution: Refer to How to install URL Rewrite and if it does not work, execute the following command at a command prompt : 
"%WINDIR%\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -i

 


Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]

When the F5 process takes place, the following message appears:

\Command:adb install -r "G:\devModels\ModelsEv2\InvoiceSampleSDEv2\RubyModel\mobile\Android\MainDashboard\bin\MainDashboard.apk"
pkg: /data/local/tmp/MainDashboard.apk
Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]
664 KB/s (443392 bytes in 0.651s)
Android Execution Failed
Run Developer Menu Failed

Cause: The application was marked with a different release key that is already installed in the device.

SolutionUninstall the application from the emulator and execute F5 again.


Failure [INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION]

When running the application (i.e. from F5) the following message appears:

Command:adb install -r "C:\temp\TesteSD\RubyModel\mobile\Android\Dashboard\bin\Dashboard1.apk"
pkg: /data/local/tmp/Dashboard.apk
Failure  [INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION]
Android Execution Failed
Run Developer Menu Failed

CauseThis error occurs at the end of the build process when GX is trying to sign the application with SDK 7. 

SolutionPlease, uninstall this version and install the JDK 6 or JDK 8 instead


Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE]

When running the application (i.e. from F5) the following message appears:

Command:emulator -avd myGxAvd
Waiting for device to become ready... (this may take a while)
Command:adb install -r "C:\test\Dashboard.apk"
pkg: /data/local/tmp/Dashboard.apk
Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE]
Android Execution Failed
Run Developer Menu Failed

Cause: The emulator is run anyway but the application has not been deployed, so it could show an error or run the previously deployed application (e.g. Dashboard.apk previous version). Storage full status is shown as follows:
emulator AVD full

Solution: Remove the default generated AVD by using avdmanager tool. When the application is run again, the AVD will be automatically created.


Error: Activity not started, unable to resolve Intent { act=android.intent.action.VIEW dat=Android flg=0x10000000 }

When running the application the following message appears:

Command:adb install -r "C:\Archivos de programa\ARTech\GeneXus\GeneXusXEv2\Android\GenexusPrototyper.apk"
           pkg: /data/local/tmp/GenexusPrototyper.apk
Success
306 KB/s (0 bytes in 440906.001s)
Command:adb shell am start -n com.artech/.PrototyperActivity -e url http://10.0.2.2:10080/FirstAndroidappRubyEnvironment/ -e name First Android app
Starting: Intent { act=android.intent.action.VIEW dat=Android }
Error: Activity not started, unable to resolve Intent { act=android.intent.action.VIEW dat=Android flg=0x10000000 }

Cause: Your model directory path has spaces that Android-SDK cannot resolve properly.

Solution: Refer to StackOverflow - dex not working with spaces in path on the new android platform tools v8


Error: Failure [INSTALL_FAILED_MISSING_SHARED_LIBRARY]

When running the application the following error appears:

========== Android Execution started ==========
Command:android list avd
Available Android Virtual Devices:
The following Android Virtual Devices could not be loaded:
    Name: myGxAvd
    Path: C:\SDK\.android\avd\myGxAvd.avd
   Error: Invalid value in image.sysdir. Run 'android update avd -n myGxAvd'
Command:adb start-server
Command:adb get-state -e myGxAvd
device
Waiting for device to become ready... (this may take a while)
Command:adb install -r "C:\myModel\Data\mobile\Android\App\bin\App.apk"
                pkg: /data/local/tmp/App.apk

Failure [INSTALL_FAILED_MISSING_SHARED_LIBRARY]

Command:adb shell am start -n com.artech.mymodel.App/.Main
Starting: Intent { cmp=com.artech.mymodel.App/.Main }
Error type 3
Error: Activity class {com.artech.myModel.App/com.artech.myModel.App.Main} does not exist.

Causes:

  1. Google API is not installed.
  2. The AVD is damaged - repair it using AVD Manager or delete it (It'll be created next time the application is run).

Solution: Check Android-SDK requirements or repair the AVD by using avdmanager tool (or simply delete it -- It'll be created again the next time the application is run).


Error: Failure [INSTALL_FAILED_DEXOPT]

When running the application the following error appears:

========== Android Execution started ==========
Command:android list avd
Available Android Virtual Devices:
    Name: myGxAvd
    Path: C:\Users\myuser\.android\avd\myGxAvd.avd
  Target: Google APIs (Google Inc.)
          Based on Android 2.1 (API level 7)
     ABI: armeabi
    Skin: HVGA
  Sdcard: 128M
Command:adb start-server
Command:adb get-state -e myGxAvd
unknown
Command:emulator -avd myGxAvd
Waiting for device to become ready... (this may take a while)
Command:adb install -r "c:\..WorkWithDevicesCustomer.apk"
pkg: /data/local/tmp/WorkWithDevicesCustomer.apk
Failure [INSTALL_FAILED_DEXOPT]

Causes: the application was previously installed using different Libraries version.

Solution: delete the myGxAvd emulator using AVD Manager. It will be created next time F5 (run) is executed.


Error: No Internet Connection

When running the application the following error appears:

No internet connection

Cause: The emulator has no access to the internet (you can check it by trying open a website through the device browser). The root cause could be: 

  1. Your machine has no internet access
  2. Your launched emulator has no internet access (WiFi or data-plan is off).

Solution: Delete the default generated emulator by using avdmanager tool. It will be created the next time F5 (run) is executed with Internet access by default. Refer to StackOverlof - Android emulator internet access


Error: UNEXPECTED TOP-LEVEL EXCEPTION

When compiling the application an error like the following occurs:

[dx]
[dx] UNEXPECTED TOP-LEVEL EXCEPTION:
[dx] com.android.dx.util.DexException: Cannot merge new index 66032 into a non-jumbo instruction!

[dx]     at com.android.dx.merge.InstructionTransformer.jumboCheck(InstructionTransformer.java:108)
[dx]     at com.android.dx.merge.InstructionTransformer.access$800(InstructionTransformer.java:25)
[dx]     at com.android.dx.merge.InstructionTransformer$StringVisitor.visit(InstructionTransformer.java:71)
[dx]     at com.android.dx.io.CodeReader.callVisit(CodeReader.java:114)
[dx]     at com.android.dx.io.CodeReader.visitAll(CodeReader.java:89)
[dx]     at com.android.dx.merge.InstructionTransformer.transform(InstructionTransformer.java:48)
[dx]     at com.android.dx.merge.DexMerger.transformCode(DexMerger.java:808)
[dx]     at com.android.dx.merge.DexMerger.transformMethods(DexMerger.java:779)
[dx]     at com.android.dx.merge.DexMerger.transformClassData(DexMerger..java:751)
[dx]     at com.android.dx.merge.DexMerger.transformClassDef(DexMerger.java:654)
[dx]     at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:526)
[dx]     at com.android.dx.merge.DexMerger.mergeDexBuffers(DexMerger.java:168)
[dx]     at com.android.dx.merge.DexMerger.merge(DexMerger.java:186)
[dx]     at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:300)
[dx]     at com.android.dx.command.dexer.Main.run(Main.java:232)
[dx]     at com.android.dx.command.dexer.Main.main(Main.java:174)
[dx]     at com.android.dx.command.Main.main(Main.java:91)
[dx]

Cause: There is a setting issue resolved as of GeneXus Tilo Beta 2.

Solution:  You have to manually add the line dex.force.jumbo=true to the file <GX>/Android/Templates/default.properties or <GX>/Android/Templates/project.propertiesdelete <model>\mobile\android\ directory and compile again.


Error: Unable to resolve project target

When running the application similar error as follows appears:

error: BUILD FAILED
error: C:\Android-SDK\tools\ant\build.xml:542: Unable to resolve project target 'android-23'
error: 
error: Total time: 3 seconds
Android Compilation Failed
Run MyMain Failed

Cause: You are using a GeneXus upgrade that is tries to use a newest Android-SDK that you have installed.

Solution: You must update your SDK since SDK Platform and Google APIs are required. Learn more.


An implementation for object 'xxx' was not found in package.

Cause: This error may appear in runtime if an offline object is called by an online app.

Solution: That scenario is not supported.


Error: AAPT err(Facade for 24252884): libpng error: CgBI: unhandled critical chunk 

When compiling the Android application the following error appears:

AAPT err(Facade for 24252884): libpng error: CgBI: unhandled critical chunk 

Cause: There are image extension integrity issues.

Solution: Run the pngcheck tool on different directories res\drawable-<density> of the main object, to verify the integrity of PNG, JNG and MNG files.


Error Could not reserve enough space for 2097152KB object heap

When building the application the following error appears:

FAILURE: Build failed with an exception.
* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/2.13/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Cause: JDK x64 is not installed or the PC has not memory enough to build the Gradle project (at least 2GB). 

Solution: Check the  Android Requirements and/or change Android specific properties to assign less memory to Gradle. Alternatively, delete the %USERPROFILE%/.Gradle directory, and Rebuild-All.


Emulator 'GeneXus-API24-X86' was launched, but timed out waiting for it to respond.

When building the application the following error appears:

========== Android Execution started ==========
Creating Android Virtual Device 'GeneXus-API24-X86'...
Command: android create avd --name GeneXus-API24-X86 --target android-24 --abi google_apis/x86 --skin WXGA720 --device "Nexus 4" --sdcard 200M
Launching Android Virtual Device 'GeneXus-API23-X86'...
Command: emulator -avd GeneXus-API24-X86 -gpu auto
Waiting for device to become ready... (this may take a while)
error: Emulator 'GeneXus-API24-X86' was launched, but we timed out waiting for it to respond.
Android Execution Failed
Run SDLlevoTodo Failed

Cause: There is an ABD process already running on your machine or the AVD is corrupted.

Solution: Check if there exists an adb.exe program executing (use the Task Manager). In such case, kill the process and retry.
If the problem persists, delete the %USERPOFILE%/.Android/avd directory.


The "android" command is no longer available.

When building the application the following error appears:

error: Error creating Android Virtual Device 'GeneXus-API24-X86'.
The "android" command is no longer available.
For manual SDK and AVD management, please use Android Studio.
For command-line tools, use
tools\bin\sdkmanager.bat and tools\bin\avdmanager.bat

Cause: As of Android-SDK 25.3.0, Google has changed its command tools and make them non-backward compatible. This requirement was introduced to the Android Generator as of GeneXus 15 Upgrade 5. For that reason, once the developer updates this requirement without backing up previous requirements (set in Android SDK Directory property), it is not possible for previous versions of GeneXus to create a new AVD or run an existing one. In other words, GeneXus Android Generator is trying to use a newer version of the Android-SDK that is non-backward compatible.

Solution: There are two alternatives for avoiding this problem.

  1. Migrate your application to GeneXus 15 Upgrade 5 and use Update Android SDK tool.
  2. Reconstruct the Android-SDK required for that GeneXus upgrade. This process can be done as follows:
    1) Duplicate your Android-SDK installation directory in order to backtrack changes if some problem occurs (e.g. /Android-SDK and /Android-SDK-GeneXus-15u3).
    2) Download the previous requirements from this site.
    3) Once the *.zip file is downloaded, you must replace the /tool directory on your Android-SDK directory (i.e. /Android-SDK-GeneXus15u3).
    4) Ensure that your Android Requirements are according to your GeneXus upgrade (It might be helpful the "SDK Manager.exe" program or Android.bat).
    5) Set the Android SDK Directory property) with the installation folder which we have previously modified.

Windows cannot find '\lib\monitor-location'.

When executing monitor.bat tool from Android-SDK for debugging purposes, the following dialog is displayed:

Android - Troubleshooting - Monitor bat

Cause: As of Android-SDK 25.3.0, Google has deprecated the logcat debugging by using the monitor.bat tool. 

Solution: Execute the logcat of adb command line tool. Below there is an example of how can execute the command

> adb logcat -v tag GeneXusApplication:* System.out:I *:S

Note: You must ensure that adb tool is reachable from the CMD by adding to the Android-SDK\platform-tools directory to the environment variables or you must be positioned in that directory before executing the command.

This command will filter only those GeneXus applications and System output streams from all the process running on the device.


Error: Android Virtual Device 'GeneXus-API24-X86' already exists

When running an Android application the AVD (Android Virtual Device) is not recognized and the following message is displayed:

========== Execution started ==========
Execution Success
Calculating Mobile Targets for SmartDevices (Smart Devices)
========== Android Execution started ==========
Creating Android Virtual Device 'GeneXus-API24-X86'...
Command: avdmanager create avd --name GeneXus-API24-X86 --package system-images;android-24;google_apis;x86 --abi google_apis/x86 --device "Nexus 4" --sdcard 200M
error: Error creating Android Virtual Device 'GeneXus-API24-X86'.
Error: Android Virtual Device 'GeneXus-API24-X86' already exists.
Use --force if you want to replace it.

Android Execution Failed

Cause: As of GeneXus 15 Upgrade 5, due to the Android SDK requirements of Android SDK, Google has made the avdmanager tool non-backward compatible, unrecognizing those AVDs created with previous versions of this tool.

Solution: You must delete the following resources and run (F5) the application again.

  • %USER_PROFILE%\.android\avd\GeneXus-API24-X86.avd 
  • %USER_PROFILE%\.android\avd\GeneXus-API24-X86.ini

Chronometer control does not trigger Tick event

This undesired behavior causes the application does not work properly according to my business logic.

Cause: You are running the app on Android 8.0 or higher version and Chronometer control is invisible. This behavior is a known bad practice for Google since Chronometer is a UI widget, no an async task.

Solution: Make the control visible and assign 0dip on its container row height.


Error: File path too long on Windows, keep below 240 characters

Cause: The path to a resource is too long.

Solution: Shorten the path of the KB. ref.: https://stackoverflow.com/questions/33905687/error-file-path-too-long-on-windows-keep-below-240-characters. Depending on your Windows version, you may enable long paths: https://betanews.com/2016/05/29/long-paths-windows-10/



Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.