Android harness does not work

I ve done my test android app but i cannot install on my samsung galaxy sl . I add the dist/opt/android/jMonkeyEngine3.jar to my app.build path but nothing.

That’s the code



[java]package it.game;



import com.jme3.app.AndroidHarness;

import com.jme3.system.android.AndroidConfigChooser.ConfigType;



public class AndroidTest extends AndroidHarness{





public AndroidTest() {

// Set the application class to run

appClass = “jme3test.android.SimpleTexturedTest”;

//eglConfigType = ConfigType.FASTEST; // Default

// Edit 22.06.2011: added a switch to get the highest (best) egl config available on this device

// Its usually RGBA8888

eglConfigType = ConfigType.BEST;

// Exit Dialog title & message

exitDialogTitle = “Exit?”;

exitDialogMessage = “Press Yes”;

// Edit: 25.06.2011: Enable verbose logging

eglConfigVerboseLogging= true;

}

}[/java]

“Nothing” is quite improbable, theres at least some error log.

Most probably jme3test.android.SimpleTexturedTest could not be found.



Please post your logcat

Could u believe that logcat stop to log?

jme3test.android.SimpleTexturedTest is included in jmonkey3.jar build from svn repository (opt/dist/android)





Could you please try to do that code just using jmonkey3 jar build from ant task of the repository?



It would be a very simple test but my galaxy start to install it and after a while says me ‘Cannot install it’

Could u believe that logcat stop to log?


Sure about that? What IDE do you use? e.g. in eclipse you have to select the phone in the devices-view
(which is normally done automatically) and then you see the logcat for that device.

If the ide-android stuff isn't working, just go to the command line, go to the your android-sdk's platform-tools-directory
and write:

adb logcat

eclipse but it stop to log .I restarted eclipse but nothing.

Could yuo please try that code using the jar under opt(dist/android?

Try it to your device please?

Dilembo, this is the development version of jme3 and of course everybody is using it and it works for people. This is obviously a problem on your side either with the hardware or your project.

@dilembo:

So did you try the command-line logcat??



From time to time you have to replug the device. Or kill the adb-server! Try this:



[java]adb devices

adb kill-server

adb start-server

adb logcat

[/java]

i ve done as u said but no exception in my logcat:( my app is android-test.apk )

I/KeyInputQueue( 1403): Enqueueing touch event0

I/WindowManager( 1403): Delivering pointer 0 > Window{4852e9c0 com.android.packageinstaller/com.android.packageinstaller.PackageInstallerActivity paused=false}

I/KeyInputQueue( 1403): Enqueueing touch event1

I/WindowManager( 1403): Delivering pointer 1 > Window{4852e9c0 com.android.packageinstaller/com.android.packageinstaller.PackageInstallerActivity paused=false}

D/dalvikvm( 3861): GC_EXPLICIT freed 82 objects / 7800 bytes in 56ms

W/PowerManagerService( 1403): Timer 0x3->0x3|0x0

D/BT HS/HF( 1504): gsmAsuToSignal=10

D/dalvikvm( 1769): GC_EXPLICIT freed 36 objects / 1824 bytes in 50ms

I/KeyInputQueue( 1403): Enqueueing touch event0

I/WindowManager( 1403): Delivering pointer 0 > Window{4852e9c0 com.android.packageinstaller/com.android.packageinstaller.PackageInstallerActivity paused=false}

I/KeyInputQueue( 1403): Enqueueing touch event1

I/WindowManager( 1403): Delivering pointer 1 > Window{4852e9c0 com.android.packageinstaller/com.android.packageinstaller.PackageInstallerActivity paused=false}

W/InputManagerService( 1403): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@484ec918 (uid=10069 pid=3827)

D/dalvikvm( 1903): GC_EXPLICIT freed 86 objects / 4896 bytes in 68ms

D/BatteryService( 1403): update start

D/BatteryService( 1403): update start

D/BatteryService( 1403): updateBattery level:61 scale:100 status:2 health:2 present:true voltage: 3927 temperature: 410 technology: Li-ion AC powered:false USB powered:true icon:17302171

D/Tethering( 1403): active iface (usb0) reported as added, ignoring

D/BatteryService( 1403): update start

I/StatusBarPolicy( 1403): BAT. status:2 health:2

W/PowerManagerService( 1403): Timer 0x3->0x3|0x0

I/KeyInputQueue( 1403): Enqueueing touch event0

I/WindowManager( 1403): Delivering pointer 0 > Window{485f85b8 com.android.packageinstaller/com.android.packageinstaller.PackageInstallerActivity paused=false}

I/KeyInputQueue( 1403): Enqueueing touch event1

I/WindowManager( 1403): Delivering pointer 1 > Window{485f85b8 com.android.packageinstaller/com.android.packageinstaller.PackageInstallerActivity paused=false}

I/ActivityManager( 1403): Starting activity: Intent { dat=file:///mnt/sdcard/external_sd/Games/android-test.apk cmp=com.android.packageinstaller/.InstallAppProgress (has extras) }

W/ActivityManager( 1403): Trying to launch com.android.packageinstaller/.InstallAppProgress

W/InstallAppProgress( 3855): Replacing package:it.game

I/ActivityManager( 1403): Displayed activity com.android.packageinstaller/.InstallAppProgress: 119 ms (total 119 ms)


D/dalvikvm( 3861): GC_EXPLICIT freed 90 objects / 4528 bytes in 60ms

D/VoldCmdListener( 1280): volume aseced /mnt/sdcard/external_sd

D/MountService( 1403): getAsecVolumeState :: result = mounted

D/PackageParser( 1403): Scanning package: /data/app/vmdl16255.tmp

D/dalvikvm( 1403): GC_EXPLICIT freed 20354 objects / 1113784 bytes in 126ms

D/BT HS/HF( 1504): gsmAsuToSignal=11

W/PowerManagerService( 1403): Timer 0x3->0x3|0x0

D/BT HS/HF( 1504): gsmAsuToSignal=11

I/lights ( 1403): ********** set_light_backlight 36

W/PowerManagerService( 1403): Timer 0x3->0x1|0x0

I/PowerManagerService( 1403): Ulight 3->1|0

I/PowerManagerService( 1403): Setting target 2: cur=38.0 target=20 delta=-1.8 nominalCurrentValue=38

I/PowerManagerService( 1403): Scheduling light animator!

I/lights ( 1403): ********** set_light_backlight 34

I/lights ( 1403): ********** set_light_backlight 32

I/lights ( 1403): ********** set_light_backlight 30

I/lights ( 1403): ********** set_light_backlight 29

I/lights ( 1403): ********** set_light_backlight 27

I/lights ( 1403): ********** set_light_backlight 25

I/lights ( 1403): ********** set_light_backlight 23

I/lights ( 1403): ********** set_light_backlight 21

I/lights ( 1403): ********** set_light_backlight 20

I/PowerManagerService( 1403): Light Animator Finished curIntValue=20

D/BatteryService( 1403): update start

D/BatteryService( 1403): updateBattery level:62 scale:100 status:2 health:2 present:true voltage: 3931 temperature: 410 technology: Li-ion AC powered:false USB powered:true icon:17302171

Strange …



What is interesting:



file:///mnt/sdcard/external_sd - external ? never tried to install it on the external SD, thats one of my TODOs, dont know yet how to do it



Trying to launch com.android.packageinstaller/.InstallAppProgress: I think it should launch .AndroidTest class - check your AndroidManifest.xml

that’s my manifest



[xml]<?xml version=“1.0” encoding=“utf-8”?>

<manifest xmlns:android=“http://schemas.android.com/apk/res/android

package=“it.game”

android:versionCode=“1”

android:versionName=“1.0”>

<application android:icon="@drawable/icon" android:label="@string/app_name"



android:debuggable=“true” >





<activity android:name=“AndroidTest”></activity>

</application>





</manifest> [/xml]

but something strange happens when i create my apk using eclipse export tools.I open my apk and there is not the it.game package but something i 've never seen.

I think it should be .AndroidTest (note the point)



My manifest is:

[xml]<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"

package="com.jme3.androiddemo"

android:versionCode="1"

android:versionName="1.0">

<uses-sdk android:minSdkVersion="8" />



<application android:icon="@drawable/icon" android:label="@string/app_name">

<activity android:name=".MainActivity"

android:label="@string/app_name">

<intent-filter>

<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />

</intent-filter>

</activity>



</application>

</manifest>[/xml]

[xml]<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"

package="it.game"

android:versionCode="1"

android:versionName="1.0">

<application android:icon="@drawable/icon" android:label="@string/app_name"



android:debuggable="true" >





<activity android:name=".AndroidTest"></activity>

</application>





</manifest> [/xml]

add a point

but when i do adb install *.apk i have a success but on my device i cannot see the app

I mean there is no dot before your activity class name:

[xml] <activity android:name="AndroidTest">[/xml]

should be:

[xml] <activity android:name=".AndroidTest">[/xml]

Further you have not specified an intent-filter, which i asume is rather important when starting your apk.



This all should have been set by the eclipse ADT plugin correctly. Try to update ADT and your android SDK.

now tha app is installed correctly but i got :



[java] FATAL EXCEPTION: GLThread 9

java.lang.RuntimeException: createWindowSurface failed: EGL_BAD_MATCH

at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1077

at android.opengl.GLSurfaceView$EglHelper.createSurface(GLSurfaceView.java:981)

at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1304)

at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)[/java]

umm it works usin eglConfigType = ConfigType.FASTEST



thank u larynx

set eglConfigVerboseLogging= true; inAndroidTest and post the logcat containing the EGL Configuration list.



Make sure you have the latest jme3 jar.

Ok, good.



Please still post your logcat using BEST, so i can check why it fails - because it shouldnt :slight_smile: