anonymousLog in-Register  
Groups

Android - FAQ and Common Issues

Same page but  with a 'rename safe' link (used for external links)

 


How I can 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 2.x.


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

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

What does the "unknown" message after "Command:adb get-state -e myGxAvd" mean?

When running the Android application I'm getting this output:

\========== Android Execution started ==========
Command:android list avd
Available Android Virtual Devices:
    Name: myGxAvd
    Path: C:\Users\user\.android\avd\myGxAvd.avd
  Target: Google APIs (Google Inc.)
          Based on Android 2.1-update1 (API level 7)
    Skin: HVGA
   Sdcard: 128M
Command:adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
Command:adb get-state -e myGxAvd
unknown
Command:emulator -avd myGxAvd
Waiting for device to become ready... (this may take a while)

What does this "unknown" message mean? To find out the AVD (myGxAvd) status, the command “adb get-state -e myGxAvd” is run. If this command returns “unknown” it means AVD is not “up & running”; so the command “emulator -avd myGxAvd” is run to start the AVD.


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: "Error: Could not access the Package Manager. Is the system running?"

The output is similar to:

Calculating Mobile Targets...
Command:android list avd
Available Android Virtual Devices:
    Name: myGxAvd
    Path: C:\Users\user.ARTECH.000\.android\avd\myGxAvd.avd
    Target: Google APIs (Google Inc.)
          Based on Android 2.1-update1 (API level 7)
    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:\gc\kbs\ev2\sd\Places2\RubyModel\mobile\Android\Menu\bin\Menu-debug.apk"
Error: Could not access the Package Manager. Is the system running?

786 KB/s (434372 bytes in 0.539s)
Command:adb shell am start -n com.artech.places2.Menu/.Main
Error type 2
android.util.AndroidException: Can't connect to activity manager; is the system running?

This reason could be the emulator is running slowly. Pressing F5 without quitting the emulator usually works.


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:

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

Image:Android AVD - google api level 7
 


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:

Image: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
error:
error: BUILD FAILED
error: C:\MyProject\JavaModel\mobile\Android\Dashboard\build.xml:65:
error:
error: Error. You are using an obsolete build.xml
error: You need to delete it and regenerate it using
error:  android update project
error:

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:

error: BUILD FAILED
error: 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'

Cause: When 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 delete <model>\mobile\android\ directory and compile again.

This error was resolved on GeneXus Tilo Beta 2

 

 

 
Created: 29 October 2010 07:17 PM by guscarr2 Last update: 4 June 2014 02:56 AM by lsilveira