Jump to content
havrlisan

Unable to debug blank application on Android 12

Recommended Posts

Hi. As the title says, I cannot debug any Delphi FMX application on my Android phone. I'm using the latest Delphi version (Alexandria, Update 1), and my phone is Samsung A52s. When I try to run in debug mode, the app installs, a black screen shows up on the phone, and RAD studio layout transforms to Debug layout. Two outcomes may happen after that:

  1. I get the exception Stop(17), which leads me to CPU view and a call stack containing only "clone" and "bionic_clone",
  2. The app stays entirely black, and either nothing happens or RAD studio disconnects after a minute of being in the debug mode.

On further investigation, I realized that if I set a breakpoint on Application.Initialize, it is never triggered. Also, if I set a breakpoint while the debugger is attached, RAD studio freezes for ~10 seconds, and after it unfreezes the debugger disconnects (while the app is still running on the phone, still as a black screen).

 

Useful info:

  • The app runs completely normal when opened without the debugger.
  • I am able to debug blank apps with Android Studio.
  • I tried using a different SDK version.
  • I have another phone, Samsung A5 (2017) that can be used with the debugger (but it randomly restarts when debugging, hence unusable).
  • A52s uses Android 12, while A5 is Android 8 (Oreo).

 

I also attached logs from logcat, that are filtered for anything that matches with the app name 'com.embarcadero.BetterProgress'.

 

I don't know what other information may be of use, so if I missed something feel free to write it in the comments. Any idea is appreciated!

android-log.txt

Share this post


Link to post

I don't have the same issue but after the last load of updates my A52 5G installed, the Delphi debugger won't break at any breakpoint. The end process works though.


My A51 (and all the the other Android phones I tried) still work OK.

I've tried on both RAD Studio 11 and 11.1. 

11.1 did some odd things, I disabled USB debugging, reconnected and it asked about trusting the computer. Then it decided it wasn't in developer mode any more so I had to re-enable it.

Wondering if the Samsung updates broke something?

Share this post


Link to post
40 minutes ago, Vince Bartlett said:

I don't have the same issue but after the last load of updates my A52 5G installed, the Delphi debugger won't break at any breakpoint. The end process works though.


My A51 (and all the the other Android phones I tried) still work OK.

I've tried on both RAD Studio 11 and 11.1. 

11.1 did some odd things, I disabled USB debugging, reconnected and it asked about trusting the computer. Then it decided it wasn't in developer mode any more so I had to re-enable it.

Wondering if the Samsung updates broke something?

Perhaps. I tried setting up a wireless debugging option, maybe that's what messed up the configuration. Weird behavior, but I believe I tried everything except factory reset.

Share this post


Link to post

Hi,

 

I'm having same issue after phone update. Have you found a workaround?

 

Thanks in advance,

 

Omar Zelaya

 

Share this post


Link to post
1 hour ago, Omar Zelaya said:

Hi,

 

I'm having same issue after phone update. Have you found a workaround?

 

Thanks in advance,

 

Omar Zelaya

 

Unfortunately no. The only option left is to factory reset my phone, but I doubt I'll do that.

Share this post


Link to post

I got the very same issue with my MOTO Z1.

And I got the answer from Embarcadero Site: Android OS 8.1 will be required for debug feature from 10.4

 

I got a Google Pixel 4 with Android 10, and the debug feature works without error prompt message.

However, the breakpoint stops only when I select "Android 64", and it does not work while I select "Android 32".

 

Share the above experience with you guys.

 

Best Regards,

Dennies Chang.

Share this post


Link to post
Quote

Debugging

We recommend the following devices for debugging Android 64-bit applications. There are many Android devices created by many manufacturers, and the experience or ability to successfully debug an application on a device can vary widely. You should test a device to ensure it supports debugging. In general, Android devices with stock, unmodified Android, and provided by the major vendors are most likely to work well; devices with unusual hardware changes to Android may have issues debugging. The following devices are a sample list recommended for debugging Android 64-bit applications.

To debug a 64-bit application, your device must run a 64-bit version of the Android operating system.

Note: A device appearing in this list is not a guarantee of supported debugging, since this can change from device to device and across operating system versions and point releases.
Device Android Version OS bitness Debug 32-bit apps Debug 64-bit apps

Nexus 7 (2nd version)

6.0.1

32bit

Allowed.png

N/A

Nexus 9

5.0.1

64bit

Allowed.png
Allowed.png

Nexus 9

7.1.1

64bit

Allowed.png
Allowed.png

Pixel (original release)

10

64bit

Allowed.png
Allowed.png

Essential Phone 1

10

64bit

Allowed.png
Allowed.png

Nexus 6P

8.1.0

64bit

Allowed.png
Allowed.png

Pixel 3XL

10

64bit

Allowed.png
Allowed.png

Nexus 5

6.0.1

32bit

Allowed.png

N/A

64-bit apps on 32-bit hardware

To run Android 64-bit applications on your device, there are two conditions it needs to match:

  1. The phone needs to have a 64-bit capable CPU
  2. The installed version of Android needs to be 64-bit. Android version 5 and later support 64-bit.

However, some devices are not configured to use the 64-bit mode. If the device does not support a 64-bit native application, an error message is displayed.

When attempting to debug a 64-bit app from within the IDE on a target device that does not support a 64-bit application, an error message is displayed.

How to verify your Android device can run 64-bit apps

If you want to verify your Android device's CPU can run 64-bit apps, one option is to use existing applications on the Play Store, such as:

  1. https://play.google.com/store/apps/details?id=com.finalwire.aida64 - Checks the CPU page
  2. https://play.google.com/store/apps/details?id=com.cpuid.cpu_z - Checks the System page

If it indicates your CPU has a 64-bit ARMv8-A instruction set, but it is set in 32-bit mode, it implies the Android version is not 64-bit. In case of a mismatch, at the moment, you will get the INSTALL_FAILED_NO_MATCHING_ABIS error message.

Testing to See Whether Your Android Device is Supported

The SysCheck utility provides a quick and easy way to test your system for compatibility. If you are unsure if your device has the required features, you can get SysCheck from the Google Play store and run it on your device: https://play.google.com/store/apps/details?id=com.ss.syscheck&hl=en SysCheck is free, has no ads, and does not require special privileges to run.

MORE INFO: https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Android_Devices_Supported_for_Application_Development

 

Verify if any "FIREWALL/ANTIVIRUS" is blocking or not!!!

 

AIDA64 for Android by GooglePlay

Screenshot_20221226-020148.png

Edited by programmerdelphi2k

Share this post


Link to post

For those who had the same issue, it seems that the 11.3 update fixed it. Sometimes though, I have to first install the app on the phone, then go to Developer options and select that app in the Wait for debugger to connect option.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×