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.

 


How can I see what is happening in the background of my app?

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


Which Android version is supported?

The generated applications (apk)  supports version 4.x or higher.


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.


I'm getting the message: "Run Developer Menu Failed"

Output window shows:

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

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

Also, if you have installed the latest SDK (Android SDK version 8), you could get this error because GeneXus doesn't find the avd.exe file.

To temporarily fix this issue, copy the files from "android-sdk r08-windows\android-sdk-windows\platform-tools" to "android-sdk r08-windows\android-sdk-windows\tools" without replacing anything.

This way GeneXus will find the files. This issue will be fixed in the next GeneXus beta 1 night build.


I'm getting the message: "Error!: no applications found"

The following window appears:

Android No application found

You must create a main object (WWSD or Dashboard).


How to customize the emulator (AVD)

The AVD used by GeneXus is called "myGXAvd" and it's automatically created the first time the application is run (i.e. F5 is pressed). SDK Manager does not allow changing AVD properties; however, you can delete myGXAvd and create a new one with the same name and your preferences (e.g. change AVD resolution).

Important: in order to work with GeneXus its "Target" property must be set to "Google APIs Level 7" as shown below:


I'm getting the message: "Error HTTP 404.0 - Not Found" when browsing a rest url for example: http//localhost/<ApplicationName>/rest/<transactionName>

The reason could be that the .svc extension is not properly registered in IIS; to do it execute the following command in a command line:

"%WINDIR%\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -i


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)

When a Dashboard is run, what options are displayed?

The options are obtained from a JSON file located in the server you’re accessing. This JSON is published to internet; so it can be verified using a browser, the URL is: http://AppbaseURL/gxmetadata/dashboardName.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 to Android and iOS too.


Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]

When the F5 process takes place, this message means than the application was marked with a Release key. Please uninstall the application from the emulator end execute F5 again. The complete message is similar to the following:

\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


Failure [INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION]

This error occurs at the end of the build process, when GX is trying to sign the application with SDK 7. Please, uninstall this version and install the JDK 6 or JDK 7 instead. The complete message is similar to:

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


Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE]

This error occurs when the AVD storage is full:

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

Solution: When using AVD Manager, remove "myGXAvd". When the application is run again the AVD is automatically created.

Tip: 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


Could not get url (404)

The message is displayed on the device (or emulator) while prototyping.

  • Possible cause: The server is running on IIS and URL rewriting is not installed.

Fix: See How to install URL Rewrite

  • Possible cause: .svc extension is not properly registered in IIS.

Fix: Execute the following command at a command prompt : "%WINDIR%\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -i


Error: Could not get http://10.0.n.n.:10080/myAppRubyEnvironment/rest/

In the Ruby output window, check what "GET" did in the application, and check if this works in a browser (in the browser, write "localhost" instead 10.0.n.n). Often, a Rebuild All action will be enough to solve this problem (because the Rest services were not generated).


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

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 }

Solution: If your KB directory has spaces, you need to change dx.bat in Android SDK Directory: http://stackoverflow.com/questions/4374660/dex-not-working-with-spaces-in-path-on-the-new-android-platform-tools-v8


Error: You are using an obsolete build.xml

When running the application the following error appears:

========== Android Compilation started ==========
Command:ant -buildfile "C:\MyProject\JavaModel\mobile\Android\Dashboard\build.xml" release
Buildfile: C:\MyProject\\JavaModel\mobile\Android\Dashboard\build.xml

BUILD FAILED
C:\MyProject\JavaModel\mobile\Android\Dashboard\build.xml:65:
Error. You are using an obsolete build.xml
You need to delete it and regenerate it using
android update project

Cause: X Ev2 Beta 4 (and previous) is incompatible with Android SDK Revision 14. You must install a previous SDK Revision or install a newer X Ev2 Beta.


Error: Unable to resolve target 'Google Inc.:Google APIs:15'.

When running the application the following error appears:

BUILD FAILED
G:\develop\Android\android-sdk_r15-windows\android-sdk-windows\tools\ant\build.xml:421: Unable to resolve target 'Google Inc.:Google APIs:15'

Cause: X Ev2 RC (build 52061 and higher) requires Android SDK Revision 15. You can simply download the API 15 with your local SDK Manager.

Tip:  more than one SDK version could be installed. The SDK to be used is automatically set as the last SDK used in any KB; however "Android SDK directory" property could be changed to set a different one.


Error: Unable to resolve target 'Google Inc.:Google APIs:19'.

When running the application the following error appears:

error: BUILD FAILED
error: G:\develop\Android\android-sdk_r15-windows\android-sdk-windows\tools\ant\build.xml:544:
Unable to resolve project target 'Google Inc.:Google APIs:19'

CauseWhen using GeneXus Xev3 version, you need to install the Android Google API 19 version, check the requirements section.


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, check SDK requirements.
  2. The AVD is damaged - repair it using AVD Manager or delete it (It'll be created 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

Solution: delete the myGxAvd emulator using AVD Manager. It will be created the next time F5 (run) is executed. The machine should have internet access, and Android emulator has Internet access by default.

Source

 


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]

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.

This error was resolved on GeneXus Tilo Beta 2


Error: Unable to resolve project target android-23

When running the application the following error appears:

error: 
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

Solution: You must update your SDK since SDK Platform & Google APIs for Android 5.0 (API 23) are required. Learn more.


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

This error may appear in runtime if an offline object is called by an online app. 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 

Solution: Run the pngcheck program (http://www.libpng.org/pub/png/apps/pngcheck.html) 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