1
votes

Create an Android App, drop an edit box, run the App.

  • Connect a barcode scanner, the App Crash.
  • Connect the barcode scanner and run the App, everything works fine.
  • Disconnect the scanner and the App crash.

If the App is runnig you cannot connect/disconnect a keyboard/barcode scanner no matter if it is bluetooth or wired.

Any ideas?

Similar to App crashes when closing Keyboard on Android Delphi Xe7 but it is not the same issue.

LogCat from Running App and then connect the barcode scanner

01-28 15:23:26.724 I/ActivityManager(668): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.embarcadero.HeaderFooterApplication/com.embarcadero.firemonkey.FMXNativeActivity} from pid 2642
01-28 15:23:26.779 I/ActivityManager(668): Start proc com.embarcadero.HeaderFooterApplication for activity com.embarcadero.HeaderFooterApplication/com.embarcadero.firemonkey.FMXNativeActivity: pid=17902 uid=10178 gids={50178, 3002, 3001, 1006, 3003, 5012, 1028, 1015}
01-28 15:23:28.424 I/ActivityManager(668): Displayed com.embarcadero.HeaderFooterApplication/com.embarcadero.firemonkey.FMXNativeActivity: +1s655ms
01-28 15:23:28.884 E/BufferQueue(142): [com.embarcadero.HeaderFooterApplication/com.embarcadero.firemonkey.FMXNativeActivity] setSynchronousMode: SurfaceTexture has been abandoned!
01-28 15:23:28.884 E/BufferQueue(142): [com.embarcadero.HeaderFooterApplication/com.embarcadero.firemonkey.FMXNativeActivity] queueBuffer: SurfaceTexture has been abandoned!
01-28 15:23:28.884 W/BufferQueue(142): [com.embarcadero.HeaderFooterApplication/com.embarcadero.firemonkey.FMXNativeActivity] cancelBuffer: BufferQueue has been abandoned!
01-28 15:23:28.889 E/BufferQueue(142): [com.embarcadero.HeaderFooterApplication/com.embarcadero.firemonkey.FMXNativeActivity] dequeueBuffer: SurfaceTexture has been abandoned!
01-28 15:23:28.889 E/BufferQueue(142): [com.embarcadero.HeaderFooterApplication/com.embarcadero.firemonkey.FMXNativeActivity] dequeueBuffer: SurfaceTexture has been abandoned!
01-28 15:23:28.889 E/BufferQueue(142): [com.embarcadero.HeaderFooterApplication/com.embarcadero.firemonkey.FMXNativeActivity] dequeueBuffer: SurfaceTexture has been abandoned!
01-28 15:23:28.889 E/BufferQueue(142): [com.embarcadero.HeaderFooterApplication/com.embarcadero.firemonkey.FMXNativeActivity] dequeueBuffer: SurfaceTexture has been abandoned!
01-28 15:23:36.054 I/WindowState(668): WIN DEATH: Window{41d09040 u0 com.embarcadero.HeaderFooterApplication/com.embarcadero.firemonkey.FMXNativeActivity}
01-28 15:23:36.054 I/ActivityManager(668): Process com.embarcadero.HeaderFooterApplication (pid 17902) has died.
01-28 15:23:36.054 W/ActivityManager(668): Force removing ActivityRecord{41612fe0 u0 com.embarcadero.HeaderFooterApplication/com.embarcadero.firemonkey.FMXNativeActivity}: app died, no saved state
01-28 15:23:49.274 I/ActivityManager(668): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.embarcadero.HeaderFooterApplication/com.embarcadero.firemonkey.FMXNativeActivity} from pid 2642
01-28 15:23:49.434 I/ActivityManager(668): Start proc com.embarcadero.HeaderFooterApplication for activity com.embarcadero.HeaderFooterApplication/com.embarcadero.firemonkey.FMXNativeActivity: pid=18029 uid=10178 gids={50178, 3002, 3001, 1006, 3003, 5012, 1028, 1015}
01-28 15:23:51.094 I/ActivityManager(668): Displayed com.embarcadero.HeaderFooterApplication/com.embarcadero.firemonkey.FMXNativeActivity: +1s668ms
01-28 15:23:51.589 E/BufferQueue(142): [com.embarcadero.HeaderFooterApplication/com.embarcadero.firemonkey.FMXNativeActivity] setSynchronousMode: SurfaceTexture has been abandoned!
01-28 15:23:51.589 E/BufferQueue(142): [com.embarcadero.HeaderFooterApplication/com.embarcadero.firemonkey.FMXNativeActivity] queueBuffer: SurfaceTexture has been abandoned!
01-28 15:23:51.589 W/BufferQueue(142): [com.embarcadero.HeaderFooterApplication/com.embarcadero.firemonkey.FMXNativeActivity] cancelBuffer: BufferQueue has been abandoned!
01-28 15:23:51.589 E/BufferQueue(142): [com.embarcadero.HeaderFooterApplication/com.embarcadero.firemonkey.FMXNativeActivity] dequeueBuffer: SurfaceTexture has been abandoned!
01-28 15:23:51.594 E/BufferQueue(142): [com.embarcadero.HeaderFooterApplication/com.embarcadero.firemonkey.FMXNativeActivity] dequeueBuffer: SurfaceTexture has been abandoned!
01-28 15:23:51.594 E/BufferQueue(142): [com.embarcadero.HeaderFooterApplication/com.embarcadero.firemonkey.FMXNativeActivity] dequeueBuffer: SurfaceTexture has been abandoned!
01-28 15:23:51.599 E/BufferQueue(142): [com.embarcadero.HeaderFooterApplication/com.embarcadero.firemonkey.FMXNativeActivity] dequeueBuffer: SurfaceTexture has been abandoned!
01-28 15:23:59.329 W/InputDispatcher(668): channel '419b5198 com.embarcadero.HeaderFooterApplication/com.embarcadero.firemonkey.FMXNativeActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
01-28 15:23:59.329 E/InputDispatcher(668): channel '419b5198 com.embarcadero.HeaderFooterApplication/com.embarcadero.firemonkey.FMXNativeActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
01-28 15:23:59.329 W/InputDispatcher(668): Attempted to unregister already unregistered input channel '419b5198 com.embarcadero.HeaderFooterApplication/com.embarcadero.firemonkey.FMXNativeActivity (server)'
01-28 15:23:59.329 I/WindowState(668): WIN DEATH: Window{419b5198 u0 com.embarcadero.HeaderFooterApplication/com.embarcadero.firemonkey.FMXNativeActivity}
01-28 15:23:59.334 I/ActivityManager(668): Process com.embarcadero.HeaderFooterApplication (pid 18029) has died.
01-28 15:23:59.334 W/ActivityManager(668): Force removing ActivityRecord{419ef278 u0 com.embarcadero.HeaderFooterApplication/com.embarcadero.firemonkey.FMXNativeActivity}: app died, no saved state
1
Without providing error codes or further details about the crash, there is nothing anyone can do to help you with this.Octopoid
THere is not error code, the App just close, that's it. How can I get the error code?Fon
Assuming you have root access to the device, use adb logcat to view the system logs. You should find details of the crash in there.Octopoid

1 Answers

3
votes

Solution from Embarcadero Community site (updated with additional items as suggested by Ernie Thomason)

You need to add keyboard into the Android Manifest template AndroidManifest.template.xml to avoid app termination when connecting/disconnecting an external USB keyboard.

Current file:

android:configChanges="orientation|keyboardHidden"

Updated file:

android:configChanges="orientati‌​on|keyboard|keyboardHidden|navigation|screenLayout|screenSize"

Here is some additional information about the template file:

When you build your project, RAD Studio uses AndroidManifest.template.xml as a template to generate AndroidManifest.xml in the output directory. You will need to edit the template file which lives in the same folder as your project.