Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: VM aborting when launching Android example  (Read 3677 times)

0 Members and 1 Guest are viewing this topic.

baccari

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Email
VM aborting when launching Android example
« on: November 29, 2014, 03:47:37 pm »
Hi,

I built SFML for Android as explained in Github Wiki tutorial. I created a new Android application project in Eclipse and then replaced the default Manifest and project.properties files with the ones included in the example provided with the source code. I also dropped all the files from the example in the project folder.

I created an AVD emulating a device running android-9 (2.3.3) with a armeabi CPU architecture and launched the application. The application crashes as soon as it starts both on the emulator and on the actual device (HTC Desire HD).

The logcat output is:
11-29 14:44:26.391: D/libEGL(485): egl.cfg not found, using default config
11-29 14:44:26.401: D/libEGL(485): loaded /system/lib/egl/libGLES_android.so
11-29 14:44:26.991: I/sfml-error(485): Failed to activate the window's context
11-29 14:44:26.991: I/sfml-error(485): Failed to activate the window's context
11-29 14:44:27.013: W/dalvikvm(485): JNI WARNING: JNI method called with exception raised
11-29 14:44:27.013: W/dalvikvm(485):              in Landroid/app/NativeActivity;.onResumeNative (I)V (GetStaticIntField)
11-29 14:44:27.021: W/dalvikvm(485): Pending exception is:
11-29 14:44:27.021: I/dalvikvm(485): Ljava/lang/NoSuchFieldError;: SYSTEM_UI_FLAG_LOW_PROFILE
11-29 14:44:27.021: I/dalvikvm(485):    at android.app.NativeActivity.onResumeNative(Native Method)
11-29 14:44:27.031: I/dalvikvm(485):    at android.app.NativeActivity.onResume(NativeActivity.java:228)
11-29 14:44:27.031: I/dalvikvm(485):    at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1150)
11-29 14:44:27.031: I/dalvikvm(485):    at android.app.Activity.performResume(Activity.java:3832)
11-29 14:44:27.031: I/dalvikvm(485):    at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2110)
11-29 14:44:27.031: I/dalvikvm(485):    at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2135)
11-29 14:44:27.031: I/dalvikvm(485):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1668)
11-29 14:44:27.031: I/dalvikvm(485):    at android.app.ActivityThread.access$1500(ActivityThread.java:117)
11-29 14:44:27.031: I/dalvikvm(485):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
11-29 14:44:27.031: I/dalvikvm(485):    at android.os.Handler.dispatchMessage(Handler.java:99)
11-29 14:44:27.031: I/dalvikvm(485):    at android.os.Looper.loop(Looper.java:123)
11-29 14:44:27.031: I/dalvikvm(485):    at android.app.ActivityThread.main(ActivityThread.java:3683)
11-29 14:44:27.031: I/dalvikvm(485):    at java.lang.reflect.Method.invokeNative(Native Method)
11-29 14:44:27.031: I/dalvikvm(485):    at java.lang.reflect.Method.invoke(Method.java:507)
11-29 14:44:27.031: I/dalvikvm(485):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
11-29 14:44:27.031: I/dalvikvm(485):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
11-29 14:44:27.031: I/dalvikvm(485):    at dalvik.system.NativeStart.main(Native Method)
11-29 14:44:27.081: I/dalvikvm(485): "main" prio=5 tid=1 NATIVE
11-29 14:44:27.081: I/dalvikvm(485):   | group="main" sCount=0 dsCount=0 obj=0x4001f1a8 self=0xce48
11-29 14:44:27.081: I/dalvikvm(485):   | sysTid=485 nice=0 sched=0/0 cgrp=default handle=-1345006528
11-29 14:44:27.081: I/dalvikvm(485):   | schedstat=( 709030121 900968440 86 )
11-29 14:44:27.081: I/dalvikvm(485):   at android.app.NativeActivity.onResumeNative(Native Method)
11-29 14:44:27.081: I/dalvikvm(485):   at android.app.NativeActivity.onResume(NativeActivity.java:228)
11-29 14:44:27.081: I/dalvikvm(485):   at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1150)
11-29 14:44:27.081: I/dalvikvm(485):   at android.app.Activity.performResume(Activity.java:3832)
11-29 14:44:27.081: I/dalvikvm(485):   at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2110)
11-29 14:44:27.081: I/dalvikvm(485):   at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2135)
11-29 14:44:27.081: I/dalvikvm(485):   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1668)
11-29 14:44:27.081: I/dalvikvm(485):   at android.app.ActivityThread.access$1500(ActivityThread.java:117)
11-29 14:44:27.081: I/dalvikvm(485):   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
11-29 14:44:27.081: I/dalvikvm(485):   at android.os.Handler.dispatchMessage(Handler.java:99)
11-29 14:44:27.081: I/dalvikvm(485):   at android.os.Looper.loop(Looper.java:123)
11-29 14:44:27.081: I/dalvikvm(485):   at android.app.ActivityThread.main(ActivityThread.java:3683)
11-29 14:44:27.081: I/dalvikvm(485):   at java.lang.reflect.Method.invokeNative(Native Method)
11-29 14:44:27.081: I/dalvikvm(485):   at java.lang.reflect.Method.invoke(Method.java:507)
11-29 14:44:27.081: I/dalvikvm(485):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
11-29 14:44:27.081: I/dalvikvm(485):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
11-29 14:44:27.081: I/dalvikvm(485):   at dalvik.system.NativeStart.main(Native Method)
11-29 14:44:27.131: E/dalvikvm(485): VM aborting

 

What could be the cause of this?

Strelok

  • Full Member
  • ***
  • Posts: 139
    • View Profile
    • GitHub
Re: VM aborting when launching Android example
« Reply #1 on: November 29, 2014, 03:58:52 pm »
I read somewhere opengl es 2 works on 4.0+ emulated devices. Let me double check.
There we go post
« Last Edit: November 29, 2014, 04:00:24 pm by Strelok »

baccari

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Email
Re: VM aborting when launching Android example
« Reply #2 on: November 29, 2014, 04:14:34 pm »
The sample project uses OpenGL ES 1.1 as can be found in the AndroidManifest.xml file:

<uses-feature android:glEsVersion="0x00010001" />

And this version is supported by any device running android-1.0 or higher as mentioned in the Android API guide here http://developer.android.com/guide/topics/graphics/opengl.html
« Last Edit: January 17, 2015, 12:29:26 am by baccari »

baccari

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Email
Re: VM aborting when launching Android example
« Reply #3 on: November 29, 2014, 08:35:01 pm »
I installed Kroniax on my HTC Desire HD to check it out and it did the same thing as the SFML android example. It crashes as soon as I launch it.

baccari

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Email
Re: VM aborting when launching Android example
« Reply #4 on: January 17, 2015, 12:23:11 am »
I decided to try again to make the Android example application run on Android 2.3.3. I now found out that the execution stops at the first call to window.pollEvent(event).

More precisely at the m_impl->popEvent(event, false); call in Window/Window.cpp inside function Window::pollEvent

More precisely at the processEvents(); call in Window/WindowImpl.cpp inside function WindowImpl::popEvent

More precisely at the sf::Lock lock(states->mutex); call in Window/Android/WindowImplAndroid.cpp inside function WindowImplAndroid::processEvents

More precisely at the m_mutex.lock(); call in System/Lock.cpp inside constructor Lock::Lock

More precisely at the m_mutexImpl->lock(); call in System/Mutex.cpp inside function Mutex::lock()

More precisely at the pthread_mutex_trylock(&m_mutex); call in System/Unix/MutexImpl.cpp inside function MutexImpl::lock()

Could you please fix this so that SFML2 be supported on Android 2.3.3? You know, it is still a widely used version of Android on the market.

 

anything