Jump to content
Andy.B

TLocationSensor on Android 12

Recommended Posts

Good morning,
I was a little surprised today.

The program in which I use localization, written on Delphi 10.4 works on Android 11, but not on Android 12.
So I compiled it on Delphi 11 and it still doesn't work on Android 12 - on older versions of Android (10, 11) it's ok.
Did you manage to run Location Demo on Android 12? Like other programs with TLocationSensor component, this one doesn't work for me either.
While debugging I get the message "Project Location.apk raised exception class Aborted (6)." and the program ends.
I don't really know what to do with it now, can you please give me a hint?

 

Best wishes,
Andrew

Share this post


Link to post
9 hours ago, Andy.B said:

The program in which I use localization, written on Delphi 10.4 works on Android 11, but not on Android 12.

Known issue: https://quality.embarcadero.com/browse/RSP-35804

 

It looks like it will require a change to the JNI Bridge to fix it (unless I'm mistaken). I shudder as to whether that might delay it until Delphi 12 😞

 

Share this post


Link to post

A workaround is provided by Marc Schwarzkopf at https://quality.embarcadero.com/browse/RSP-35804

For Delphi 10.4 you find 

Androidapi.JNI.Location.pas in the directory C:\Program Files (x86)\Embarcadero\Studio\21.0\source\rtl\android

System.Android.Sensors.pas in the directory C:\Program Files (x86)\Embarcadero\Studio\21.0\source\rtl\common

Remember to build and check that both modified files are compiled into the following directories:

C:\Program Files (x86)\Embarcadero\Studio\21.0\lib\android\debug

C:\Program Files (x86)\Embarcadero\Studio\21.0\lib\android\release

C:\Program Files (x86)\Embarcadero\Studio\21.0\lib\android64\debug

C:\Program Files (x86)\Embarcadero\Studio\21.0\lib\android64\release

If not, you can copy the sourcefiles into those directories, which I had to do, and it works for me on Android 12 too.

 

  • Like 2

Share this post


Link to post

Indeed, the workaround proposed by Marc Schwarzkopf works very well.
Greetings!

Share this post


Link to post
On 2/26/2022 at 5:47 PM, Janderson Cardoso said:

Good afternoon!
I'm having the same problem, but I can't access the portal to get the tip.
Can anybody help me?

erro jira.PNG

I too receive an error message when I use my Username and Password that works for other parts of Embarcadero website.

Does this https://quality.embarcadero.com/login.jsp require a different registration?

 

Share this post


Link to post

Where is the workaround currently located? Or can someone just post the steps here. All of the steps. Not just some of them. Thanks!

Edited by cupboy

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

×