Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: XE7 Try-Except not working on Android 6.0+ Marshmallow


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 10 - Last Post: Jun 7, 2017 8:22 AM Last Post By: Markus Humm
Ad Langerak

Posts: 2
Registered: 1/4/15
XE7 Try-Except not working on Android 6.0+ Marshmallow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 18, 2015 6:59 AM
Hello all,

I have an application developed for Android. There was never a problem with app until Android 6.0 came.
It seems that on Android 6 and above the Try-Finally/Except is not working anymore and the app just crashes.

Is this problem known and is there a fix for it?

I am testing with a Nexus 6.
App runs perfect when i install Android 5.1 and less on my device.

Greetz
Ad
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: XE7 Try-Except not working on Android 6.0+ Marshmallow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 18, 2015 1:34 PM   in response to: Ad Langerak in response to: Ad Langerak
Ad wrote:

I have an application developed for Android. There was never a problem
with app until Android 6.0 came.

XE7 officially supports only up to Android 4.4. To officially support Android
5, you need XE8. For Android 6, you need Seattle+.

See this page:

Supported Platforms and Operating Systems
http://docwiki.embarcadero.com/PlatformStatus/en/Main_Page

--
Remy Lebeau (TeamB)
Mike Shkolnik

Posts: 19
Registered: 3/11/13
Re: XE7 Try-Except not working on Android 6.0+ Marshmallow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 18, 2015 1:49 PM   in response to: Ad Langerak in response to: Ad Langerak
Is there any way to work around this? To stop the app from crashing and do our own error trapping? I have an app in the Android app store so I really need to fix this, but an upgrade would cost over 200 times more than I have made on the app.
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: XE7 Try-Except not working on Android 6.0+ Marshmallow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 18, 2015 2:09 PM   in response to: Mike Shkolnik in response to: Mike Shkolnik
Mike wrote:

Is there any way to work around this?

Not without knowing what is actually failing to begin with. Have you tried
debugging it yet?

--
Remy Lebeau (TeamB)
Denis Nazarov

Posts: 1
Registered: 7/7/17
Re: XE7 Try-Except not working on Android 6.0+ Marshmallow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 7, 2017 7:12 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
Mike wrote:

Is there any way to work around this?

Not without knowing what is actually failing to begin with. Have you tried
debugging it yet?

--
Remy Lebeau (TeamB)

sorry for my english ))

1. Android 6.0 - raise exception.create - go to System.pas, breakpoint in line 20781

handle := dlopen('/system/libdl.so', RTLD_LAZY); - returns 0 !!!
UnwindFindExidxPtrFunc := TUnwindFindExidxPtr(dlsym(handle, 'dl_unwind_find_exidx'));
dlclose(handle); - segfault (11), because handle=0

2. Android 4.4 - raise exception.create - go to System.pas, breakpoint in line 20781

handle := dlopen('/system/libdl.so', RTLD_LAZY); - returns 0 at first step
UnwindFindExidxPtrFunc := TUnwindFindExidxPtr(dlsym(handle, 'dl_unwind_find_exidx')); - after this step debugger runs previous line and handle <> 0
dlclose(handle); - no segfault, normally runs

in Delphi 10, imho, reverse process.

For the money that embarcadero asks for a product, could and make a normal error handling.
I suspect that in Android 6.0 dlerror will return 'lib not found' because of the absolute path or 'dlopen failed: can not locate symbol' __cxa_finalize "referenced by" /system/lib/libdl.so "'

PS. /system/libdl.so - There is no such file, there is such /system/lib/libdl.so

Edited by: Denis Nazarov on Jun 7, 2017 7:12 AM

Edited by: Denis Nazarov on Jun 7, 2017 7:14 AM

Edited by: Denis Nazarov on Jun 7, 2017 7:14 AM

Markus Humm

Posts: 5,113
Registered: 11/9/03
Re: XE7 Try-Except not working on Android 6.0+ Marshmallow [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 7, 2017 8:22 AM   in response to: Denis Nazarov in response to: Denis Nazarov
Am 07.06.2017 um 16:15 schrieb Denis Nazarov:
Remy Lebeau (TeamB) wrote:
Mike wrote:

Is there any way to work around this?

Not without knowing what is actually failing to begin with. Have you tried
debugging it yet?

--
Remy Lebeau (TeamB)

sorry for my english ))

1. Android 6.0 - raise exception.create - go to System.pas, breakpoint in line 20781

handle := dlopen('/system/libdl.so', RTLD_LAZY); - returns 0 !!!
UnwindFindExidxPtrFunc := TUnwindFindExidxPtr(dlsym(handle, 'dl_unwind_find_exidx'));
dlclose(handle); - segfault (11), because handle=0

2. Android 4.4 - raise exception.create - go to System.pas, breakpoint in line 20781

handle := dlopen('/system/libdl.so', RTLD_LAZY); - returns 0 at first step
UnwindFindExidxPtrFunc := TUnwindFindExidxPtr(dlsym(handle, 'dl_unwind_find_exidx')); - after this step debugger runs previous line and handle <> 0
dlclose(handle); - no segfault, normally runs

in Delphi 10, imho, reverse process.

For the money that embarcadero asks for a product, could and make a normal error handling.
I suspect that in Android 6.0 dlerror will return 'lib not found' because of the absolute path or 'dlopen failed: can not locate symbol' __cxa_finalize "referenced by" /system/lib/libdl.so "'

PS. /system/libdl.so - There is no such file, there is such /system/lib/libdl.so


Hello,

you can also create a bug report over on quality.embarcadero.com and see
what EMNT folks say about this.

If possible you should add a small demo app showing the issue.

Greetings

Markus
Markus Humm

Posts: 5,113
Registered: 11/9/03
Re: XE7 Try-Except not working on Android 6.0+ Marshmallow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 19, 2015 8:38 AM   in response to: Mike Shkolnik in response to: Mike Shkolnik
Am 18.12.2015 um 22:49 schrieb Mike Shkolnik:
Is there any way to work around this? To stop the app from crashing and do our own error trapping? I have an app in the Android app store so I really need to fix this, but an upgrade would cost over 200 times more than I have made on the app.

Have you already run monitor.bat from your Android SDK installation?
This would give you access to the debug log messages which can help
trace this case.

If it is actually a bug in XE7 a QP report might trigger some message
from EMBT sheding more light on the matter besides just telling you that
XE7 only supports up to Android 4.4 officially.

Greetings

Markus
Ad Langerak

Posts: 2
Registered: 1/4/15
Re: XE7 Try-Except not working on Android 6.0+ Marshmallow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 21, 2015 12:53 AM   in response to: Markus Humm in response to: Markus Humm
This is what android monitor logs after the last normal log when the app dies.
I don't see any clue to know where to start searching.

12-21 09:44:55.302: E/libEGL(2075): validate_display:255 error 3008 (EGL_BAD_DISPLAY)
12-21 09:44:55.302: E/libEGL(2075): validate_display:255 error 3008 (EGL_BAD_DISPLAY)
12-21 09:44:55.617: D/audio_hw_primary(27713): disable_audio_route: reset and update mixer path: low-latency-playback speaker
12-21 09:44:55.620: D/audio_hw_primary(27713): disable_snd_device: snd_device(2: speaker)
12-21 09:44:55.883: I/WindowState(27952): WIN DEATH: Window{e5f448d u0 com.mypackage/com.embarcadero.firemonkey.FMXNativeActivity}
12-21 09:44:55.886: I/Zygote(27703): Process 2075 exited cleanly (231)
12-21 09:44:55.889: I/ActivityManager(27952): Process com.mypackage (pid 2075) has died
12-21 09:44:55.891: W/ActivityManager(27952): Force removing ActivityRecord{80aa492 u0 com.mypackage/com.embarcadero.firemonkey.FMXNativeActivity t122}: app died, no saved state
12-21 09:44:56.076: W/InputMethodManagerService(27952): Got RemoteException sending setActive(false) notification to pid 2075 uid 10110
12-21 09:44:56.079: I/Keyboard.Facilitator(28468): onFinishInput()


Markus Humm wrote:
Am 18.12.2015 um 22:49 schrieb Mike Shkolnik:
Is there any way to work around this? To stop the app from crashing and do our own error trapping? I have an app in the Android app store so I really need to fix this, but an upgrade would cost over 200 times more than I have made on the app.

Have you already run monitor.bat from your Android SDK installation?
This would give you access to the debug log messages which can help
trace this case.

If it is actually a bug in XE7 a QP report might trigger some message
from EMBT sheding more light on the matter besides just telling you that
XE7 only supports up to Android 4.4 officially.

Greetings

Markus
Mike Shkolnik

Posts: 19
Registered: 3/11/13
Re: XE7 Try-Except not working on Android 6.0+ Marshmallow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 9, 2016 2:33 AM   in response to: Ad Langerak in response to: Ad Langerak
Still no workaround for this? It's clearly the "except" causing the crash. I also tried compiler directive {$I-} but that crashed too.
Markus Humm

Posts: 5,113
Registered: 11/9/03
Re: XE7 Try-Except not working on Android 6.0+ Marshmallow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 10, 2016 9:17 AM   in response to: Mike Shkolnik in response to: Mike Shkolnik
Am 09.02.2016 um 11:33 schrieb Mike Shkolnik:
Still no workaround for this? It's clearly the "except" causing the crash. I also tried compiler directive {$I-} but that crashed too.

Has anybody of you already reported this into quality.embarcadero.com?
Before doing this nothing will happen from EMBT side!

Greetings

Markus
Mike Shkolnik

Posts: 19
Registered: 3/11/13
Re: XE7 Try-Except not working on Android 6.0+ Marshmallow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 12, 2016 12:34 AM   in response to: Markus Humm in response to: Markus Humm
Has anybody of you already reported this into quality.embarcadero.com?
Before doing this nothing will happen from EMBT side!

They claim that XE7 simply doesn't support Marshmallow. XE10 does. All I need is $1000 to upgrade. I've made $40 on my app...
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02