Alljoyn file transfer issue when connect with android M device - android

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

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

Related

Android Bundle package crash on startup

My Delphi project have both android 32 and 64 destination. I can deploy them on my test devices and they both works fine.
Now google forces me to upload a single app bundle file (.aab), so i flagged the "Generate Android App Bundle file (arm + arm64)" option, set up my provisioning keystore, loaded the alias and then generated that .aab file
I uploaded that as a beta release for my app from the android developer portal and after a few hours it became available to download for my test devices. But.. it shows the start up logo.. and nothing else.
I don't really know how to debug this since both the apks are working fine (32 and 64 bit), so i tried to launch adb logcat *:W, but i still cannot get useful info. I got those lines in endless loop:
10-30 09:59:21.656 13723 13723 E systems.<my app name>: Not starting debugger since process cannot load the jdwp agent.
10-30 09:59:21.688 13723 13723 W systems.<my app name>: JIT profile information will not be recorded: profile file does not exits.
10-30 09:59:21.688 13723 13723 W systems.<my app name>: JIT profile information will not be recorded: profile file does not exits.
10-30 09:59:21.703 922 1100 E ANDR-IOP: IIop:: Iop HAL Service is not available.
10-30 09:59:21.707 13723 13743 E Perf : Fail to get file list oat
10-30 09:59:21.707 13723 13743 E Perf : getFolderSize() : Exception_1 = java.lang.NullPointerException: Attempt to get length of null array
10-30 09:59:21.743 13723 13723 W linker : Warning: "/data/app/<my app name>-43xRWdYLtXcvUAbEkuUk6g==/split_config.arm64_v8a.apk!/lib/arm64-v8a/lib<my app name>.so" unused DT entry: DT_RPATH (type 0xf arg 0x2cf24) (ignoring)
Just for info: getFolderSize() is not a function i use in my code (its not even declared).
Also, i think this is pretty important: my app deploys some .so files (different files for 32 and 64 bit) and some other files, like images and fonts.
Why i think this is important? Just a suspect born reading this similar issue (but with xamarin): https://github.com/xamarin/Xamarin.Forms/issues/11450
I also tried to deploy the .aab manually on my devices but the only thing i found is how to generate the .apks file from the .aab, and i still cannot deploy it on my devices.
I'm using Delphi 10.4.1 and i also tried to recreate the .dproj file setting up everything again.
How i can debug this? Or how i can get more info about the cause?
Edit: Solved it! I had a few problems that, mixed together, caused this; i'll try to list them in case someone will have a similar issue and will end here!
my androidmanifest.template.xml file was generated by an older version of delphi and was missing some important parts
you need to include all the needed .so files in both 32 and 64bit build to actually have them in the bundle
using TPath.GetLibraryPath() when loading .so files can produce different results if you are using it inside a .aab bundle package
i was trying to load one of those .so file from the initialization section using the function TPath.GetLibraryPath() to get the root path, that was causing a unhandled exception that make my app crash into the splash screen
I solved simply removing TPath.GetLibraryPath() from the path i was using to load my .so and now it works

Unable to decode stream: android.graphics.ImageDecoder$DecodeException: Failed to create image decoder with message 'unimplemented'

I've recently tried implementing Pusher's Chatkit into my android app along with some Kotlin plugins and am now running into this error that I cannot resolve.
E/Drawable: Unable to decode stream: android.graphics.ImageDecoder$DecodeException: Failed to create image decoder with message 'unimplemented'Input contained an error.
the error I'm getting right below it is:
E/FirebaseInstanceId: Token retrieval failed: SERVICE_NOT_AVAILABLE
Which is through throwing me for a loop because my internet is working fine although a couple lines further down, I get:
W/Firestore: (21.3.0) [OnlineStateTracker]: Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds.
This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.
Process 15216 terminated.
Note: I've started to get this error above about not having a good connection ever since I started working more at cafes instead of at home since I needed to get out. In order to work offline, firebase asked me to opt into an offline mode I've been getting this notification of not being able to connect ever since.
I am following along to the getting started page here and have completed up to the end of the "Displaying Messages" section however when I go to the activity, it just stalls and blanks out. I have been searching StackO and the rest of the web for the past 2 days to try to resolve the conflict to no avail. All of the similar posts I have looked at dont seem to resolve the issue.
similarPost#1 but I'm not trying to save to a bitmap
Here is the entire stack trace:
E/Drawable: Unable to decode stream: android.graphics.ImageDecoder$DecodeException: Failed to create image decoder with message 'unimplemented'Input contained an error.
E/FirebaseInstanceId: Token retrieval failed: SERVICE_NOT_AVAILABLE
W/DynamiteModule: Local module descriptor class for providerinstaller not found.
I/DynamiteModule: Considering local module providerinstaller:0 and remote module providerinstaller:0
W/ProviderInstaller: Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0.
I/ghborsbookshel: The ClassLoaderContext is a special shared library.
I/chatty: uid=10086(com.example.android_myneighborsbookshelf) AsyncTask #2 identical 1 line
I/ghborsbookshel: The ClassLoaderContext is a special shared library.
V/NativeCrypto: Registering com/google/android/gms/org/conscrypt/NativeCrypto's 286 native methods...
W/ghborsbookshel: Accessing hidden method Ljava/security/spec/ECParameterSpec;->getCurveName()Ljava/lang/String; (light greylist, reflection)
I/ProviderInstaller: Installed default security provider GmsCore_OpenSSL
W/Firestore: (21.3.0) [OnlineStateTracker]: Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds
This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.
Process 15216 terminated.
It seems to have fixed itself except for the unable to decode stream error however it doesn't crash, it just shows up in the log.
I checked for updates, cleaned, rebuild, invalidated caches and restarted, and shut down my emulator. I also restarted my computer completely 2x and that seems to have fixed it.

Android Asynchronous Http Client - Can't install on Mac OS 10.10.5

I just downloaded the main Java Jar file directly from here: http://loopj.com/android-async-http/
Double-clicked the jar file and got this error message pop up:
"The Java JAR file "android-async-http-1.4.9.jar" could not be launched.
Check the Console for possible error messages."
In the console, it had the following 4 messages pop up:
4/23/16 7:34:40.805 AM com.apple.xpc.launchd[1]: (com.apple.xpc.launchd.domain.pid.quicklookd.2848) Path not allowed in target domain: type = pid, path = /Library/Frameworks/iTunesLibrary.framework/Versions/A/XPCServices/com.apple.iTunesLibraryService.xpc error = 147: The specified service did not ship in the requestor's bundle, origin = /System/Library/Frameworks/QuickLook.framework/Versions/A/Resources/quicklookd.app
4/23/16 7:34:53.261 AM QuickLookSatellite[2861]: [QL] Using too much memory (127 MB), hit critical threshold (120 MB), exiting immediately to clean up.
4/23/16 7:34:53.280 AM com.apple.xpc.launchd[1]: (com.apple.quicklook.satellite.2CBCE90F-159F-4B12-83D8-1859B1F39063[2861]) Service exited due to signal: Killed: 9
4/23/16 7:34:53.597 AM QuickLookSatellite[2879]: ImageIO: JPEG Corrupt JPEG data: 1502 extraneous bytes before marker 0xfe
4/23/16 7:34:53.600 AM QuickLookSatellite[2879]: ImageIO: JPEG JPEG datastream contains no image
For reference, I've confirmed that in my mac security, I've switched it to "allow apps downloaded from anywhere," so that shouldn't be an issue.
In addition, I suspect the last two are related to the actual image of the pop-up error (the first thing I reported)... so once the root cause is resolved, there shouldn't be a need for an error message and everything should be dandy.
How can I resolve this?
This jar file is Android library, it is not application file ==> You can not run this file.

Android failing to download obb file using unity

I have a unity project for android which is larger than 50MB and so must be split. I have had working apt splitting for a couple months now. Starting a few days ago I mad a couple changes which were purely aesthetic. I uploaded the new build and now(days after the api and obb files were uploaded) I receive an error at the download point on the device "Download failed because the resources could not be found."
I manually added the obb file to the device and it worked, I have tried re uploading the apk and bob files with minor changes and still after a day of waiting see the same errors.
viewing with logcat I see these errors when i try to download
I/LicenseChecker(20270): Binding to licensing service.
W/ContextImpl(20270): Implicit intents with startService are not safe: Intent { act=com.android.vending.licensing.ILicensingService } android.content.ContextWrapper.bindService:517 com.unity3d.plugin.downloader.c.j.a:-1 com.unity3d.plugin.downloader.b.s.run:-1
I/LicenseChecker(20270): Calling checkLicense on service for [my project com]
I/LicenseChecker(20270): Start monitoring timeout.
W/GLSUser (26959): GoogleAccountDataService.getToken()
I/qtaguid (18936): Failed write_ctrl(u 53) res=-1 errno=22
I/qtaguid (18936): Untagging socket 53 failed errno=-22
W/NetworkManagementSocketTagger(18936): untagSocket(53) failed with errno -22
I/ElegantRequestDirector(18936): I/O exception (org.apache.http.NoHttpResponseException) caught when processing request: The target server failed to respond
I/ElegantRequestDirector(18936): Retrying request
I/LicenseChecker(20270): Received response.
I/LicenseChecker(20270): Clearing timeout.
Its not obvious to me what I did to make obb downloading stop working. I don't know enough about the error messages to pick anything out of it.
What can I do to make it download the bob files again?
In case anyone else runs into this here was my solution. It looks like Google made a policy change.
"To test your application's implementation of the manual download procedure, you can publish it to the alpha or beta channel, so it will only be available to authorized testers. If everything works as expected, your application should begin downloading the expansion files as soon as the main activity starts.
Note: Previously you could test an app by uploading an unpublished "draft" version. This functionality is no longer supported; instead, you must publish it to the alpha or beta distribution channel. For more information, see Draft Apps are No Longer Supported."
so now you need to publish your alpha/beta builds before you can download the files.

Trigger.io bluetooth permission?

I am working with a bluetooth hardware device and I am trying to get it to interface with my Trigger.IO application. It seems as though it is not possible, even though technically it should. Here are my steps so far:
Used the Trigger.IO module functionality to create a module which was able to successfully send and receive messages between the Trigger.IO app and native Java code
Created a native Android application which successfully communicated with the bluetooth hardware device
Ported my native Android bluetooth code over into my Trigger.IO module
At this point the custom module is included in the Trigger app and seems to starting correctly, but when I make a call that should initiate the bluetooth device connection logic I am getting errors about bluetooth permissions. I ensured that my module has the necessary bluetooth permissions within its AndroidManifest.xml, but my fear is that the base Trigger app does not have the required permissions.
These are logs that output within the LogCat when the attempting to start the bluetooth connection:
D/Forge: Native call module.startDevicePolling with task.params: {}
D/BluetoothManagerService: Message: 20
D/BluetoothManagerService: Added callback: Android.bluetooth.IBluetoothManagerCallback$Stub$Proxy#41f84218:true
W/dalvikvm: threadid=25: thread exiting with uncaught exception (group=0x41612ba8)
I/Process: Sending signal. PID: 11967 SIG: 9
E/AndroidRuntime: FATAL EXCEPTION: Incoming Data Thread
E/AndroidRuntime: Process: io.trigger.forge42a1430afae511e2a0e61231392b77b0, PID: 11967
E/AndroidRuntime: java.lang.SecurityException: Need BLUETOOTH permission: Neither user 10230 nor current process has android.permission.BLUETOOTH.
Looking at the AndroidManfiest.xml at the root of the deployed .APK it looks as though Trigger only has permissions for INTERNET and ACCESS_NETWORK_STATE. Anyone else run into this? I think if I can get the BLUETOOTH permission into the root AndroidManifest.xml that things will work, but that file is encoded to not make that easy.
Trigger.io does support the ability for module's to add permissions - see Changing build configuration
In summary:
Add a build steps file in android/build_steps.json
For your scenario, update the build steps file with: [ { "do": { "android_add_permission": { "permission": "android.permission.BLUETOOTH" } } } ]
After changing the build steps for either Android or iOS it is important to update the inspector project
I was able to solve my problem by changing the local trigger android template to give me the permission I needed. This is obviously not ideal. It would be ideal to have the Trigger logic look at the native modules, derive the required permissions, and update their master AndroidManifest.xml accordingly.

Categories

Resources