Linker error using the sensor components for Android in RAD Studio 10.3.3
[SHOWTOGROUPS=4,20]
David Millington
25/2/2020
An issue in Androidapi.Sensor.pas referring to symbols introduced in SDK version 26 will cause an linking error when your app references SDK version 22.
If you are building Android applications with C++Builder 10.3.3, you may encounter an error [ldandroid Error] "ld" exited with code 1. The same issue can appear with different symptoms for Delphi 10.3.3 when attempt to match symbol names (such as using a script to gain symbols from call stacks generated by third party call stack libraries on Android, such as Для просмотра ссылки Войдиили Зарегистрируйся) in Delphi, where you will also get a linker error.
The issue is caused by a few symbols in the Androidapi.Sensor.pas file only being introduced in Android SDK version 26, but your application will link against version 22 where those symbols are not present. To resolve the errors, just make a local copy of the unit and comment out the symbols.
Workaround
Brian Long kindly wrote up a Для просмотра ссылки Войдиили Зарегистрируйся. Thanks Brian!
[/SHOWTOGROUPS]
David Millington
25/2/2020
An issue in Androidapi.Sensor.pas referring to symbols introduced in SDK version 26 will cause an linking error when your app references SDK version 22.
If you are building Android applications with C++Builder 10.3.3, you may encounter an error [ldandroid Error] "ld" exited with code 1. The same issue can appear with different symptoms for Delphi 10.3.3 when attempt to match symbol names (such as using a script to gain symbols from call stacks generated by third party call stack libraries on Android, such as Для просмотра ссылки Войди
The issue is caused by a few symbols in the Androidapi.Sensor.pas file only being introduced in Android SDK version 26, but your application will link against version 22 where those symbols are not present. To resolve the errors, just make a local copy of the unit and comment out the symbols.
Workaround
- Find the C:\Program Files (x86)\Embarcadero\Studio\20.0\source\rtl\android\Androidapi.Sensor.pas and Androidapi.inc files (or the same file in your RAD Studio installation folder, if you installed to a different location.)
- Make a copy of them in your project's source folder, and addAndroidapi.Sensor.pas only to your project. Androidapi.inc is required to build your local copy of Androidapi.Sensor.pas.
- Open the file and locate and comment out the declarations for the following symbols:
- ASensorManager_getInstanceForPackage
- ASensorManager_getDefaultSensorEx
- ASensorManager_createSharedMemoryDirectChannel
- ASensorManager_createHardwareBufferDirectChannel
- ASensorManager_destroyDirectChannel
- ASensorManager_configureDirectReport
- ASensorEventQueue_registerSensor
- ASensor_isDirectChannelTypeSupported
- ASensor_getHighestDirectReportRateLevel
- Ensure that when you upgrade to the next version, you remove your local copy of this file from your projects.
Brian Long kindly wrote up a Для просмотра ссылки Войди
[/SHOWTOGROUPS]
Последнее редактирование: