Alljoyn file transfer issue when connect with android M device

191 views Asked by At

hi am not able to send and receive file when try to send form alljoyn sample demo.

I have use 16.4 jar and .so file for that provide by alljoyn.

Here is provided jar and .so https://github.com/onbiron/AllJoyn

I am getting that kind of error when try to join session.

12-19 17:42:04.371 14705-14823/org.alljoyn.cops.filetransfer.sampleapp E/PERMISSION_MGR:    1.906 ****** ERROR PERMISSION_MGR lepDisp2_0 ...ndroid/PermissionDB.cc:182 | Failed to open /data/system/packages.xml: ER_FAIL
12-19 17:42:35.739 14705-14867/org.alljoyn.cops.filetransfer.sampleapp E/ALLJOYN_OBJ:   33.275 ****** ERROR ALLJOYN_OBJ JoinS-2       .../router/AllJoynObj.cc:2870 | SendAttachSession failed: ER_BUS_REPLY_IS_ERROR_MESSAGE
12-19 17:42:35.739 14705-14865/org.alljoyn.cops.filetransfer.sampleapp E/ALLJOYN_OBJ:   33.275 ****** ERROR ALLJOYN_OBJ JoinS-1       .../router/AllJoynObj.cc:2870 | SendAttachSession failed: ER_BUS_REPLY_IS_ERROR_MESSAGE
12-19 17:42:35.744 14705-14867/org.alljoyn.cops.filetransfer.sampleapp E/ALLJOYN_OBJ:   33.280 ****** ERROR ALLJOYN_OBJ JoinS-2       .../router/AllJoynObj.cc:1110 | Failed to attach session 3934278432 to :LL5lO2PF.2: ER_BUS_REPLY_IS_ERROR_MESSAGE
12-19 17:42:35.744 14705-14865/org.alljoyn.cops.filetransfer.sampleapp E/ALLJOYN_OBJ:   33.280 ****** ERROR ALLJOYN_OBJ JoinS-1       .../router/AllJoynObj.cc:1110 | Failed to attach session 3934278432 to :LL5lO2PF.2: ER_BUS_REPLY_IS_ERROR_MESSAGE
12-19 17:42:36.206 14705-17188/org.alljoyn.cops.filetransfer.sampleapp E/LOCAL_TRANSPORT:   33.742 ****** ERROR LOCAL_TRANSPORT lepDisp2_0 ...src/LocalTransport.cc:597 | LocalEndpoint::DoPushMessage failed: ER_BUS_UNMATCHED_REPLY_SERIAL
12-19 17:42:36.209 14705-17225/org.alljoyn.cops.filetransfer.sampleapp E/LOCAL_TRANSPORT:   33.745 ****** ERROR LOCAL_TRANSPORT lepDisp2_1 ...src/LocalTransport.cc:597 | LocalEndpoint::DoPushMessage failed: ER_BUS_UNMATCHED_REPLY_SERIAL
12-19 17:42:37.869 14705-14747/org.alljoyn.cops.filetransfer.sampleapp E/Surface: getSlotFromBufferLocked: unknown buffer: 0xb9327058
12-19 17:42:39.866 14705-14747/org.alljoyn.cops.filetransfer.sampleapp E/Surface: getSlotFromBufferLocked: unknown buffer: 0xb944b690
1

There are 1 answers

0
P. Sigurdson On BEST ANSWER

Note that the AllJoyn File Transfer service app hasn't had a commit in 3 years, and is marked as legacy/archived. It is not active.

The issue that you mention appears to be a timeout during the join request. This has not been a significant problem for me (only saw it once over several days, and workaround was to simply retry joining the session which was then successful). I believe this timeout can happen very infrequently when there is congestion/delays in the network.

However, I did experience several other issues with this app when running it on Android 6.0, which prevented file transfers from working. These included:

  • Unable to read/write files from the device. Need to request read/write permissions at run-time even though they were already in the manifest. This appears to be necessary from Android version 6.0 and later (API level 23+). See https://stackoverflow.com/a/38989237/7281796
  • The app uses a hard-coded save directory path of /mnt/sdcard. This path doesn't existing on my Nexus 5 running 6.0.1. Need to use the Environment.getExternalStorageDirectory() absolute path rather than using hard-coded path.
  • Restarting one of the two apps would cause file transfer between peers to no longer work (unless the other app was also restarted). Need to use a SessionListener to release connection objects and reset GUI view on receipt of session lost.
  • Handle case where duplicate join-session processing occurs when multiple concurrent Found Advertisements are received from the hosting app. This was causing the GUI list-view of available peers to display duplicate peer entries. Also caused "share file" to subsequently fail due to ER_BUS_NO_SUCH_OBJECT when app attempts to send an alljoyn signal over the session.

Fixes for these issues are available in my github repository (fork of the AllJoyn File Transfer service app): https://github.com/psigurdson/alljoyn-services-filetransfer