I am running the sample companion android app to learn how the SAP SDK works:
AccessorySDK_v2.6.1 from Samsung. Sample: Provider(Tizen)_Consumer(Android).
Everything is working perfectly if I use a real Samsung smartphones to test like my Galaxy S7e, or Galaxy S10. But when I run the sample android app on a non-Samsung emulator, I get the following errors:
E/[SA_SDK]SAGSIMLog: GSIM logging is not enabled.
E/[SA_SDK]SASdkConfig: Accessory Framework Not installed
E/[SA_SDK]SAAgentV2: SDK initialization failed!
View full logs
E/[SA_SDK]SASdkConfig: Accessory Framework Not installed
W/System.err: com.samsung.android.sdk.accessory.d: Accessory Framework Not installed
at com.samsung.android.sdk.accessory.k.(Unknown Source:126)
at com.samsung.android.sdk.accessory.SAAgentV2.e(Unknown Source:6)
at com.samsung.android.sdk.accessory.SAAgentV2.(Unknown Source:101)
at com.samsung.android.sdk.accessory.example.helloaccessory.consumer.ConsumerService.(ConsumerService.java:48)
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
W/System.err: at com.samsung.android.sdk.accessory.SAAgentV2$e.handleMessage(Unknown Source:157)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
D/[SA_SDK]SAAgentV2: SAAgentV2 - initialize:ConsumerService
D/[SA_SDK]SAGSIMLog: init()
D/[SA_SDK]SAGSIMLog: [SecFloating] feature is not supported (non-samsung device)
[SecFloating] feature is not supported this device (non-samsung device)
E/[SA_SDK]SAGSIMLog: GSIM logging is not enabled.
E/[SA_SDK]SASdkConfig: Accessory Framework Not installed
E/[SA_SDK]SAAgentV2: SDK initialization failed!
com.samsung.android.sdk.SsdkUnsupportedException: Accessory Framework Not installed
at com.samsung.android.sdk.accessory.SA.initialize(Unknown Source:63)
at com.samsung.android.sdk.accessory.SAAgentV2.e(Unknown Source:122)
at com.samsung.android.sdk.accessory.SAAgentV2.(Unknown Source:101)
at com.samsung.android.sdk.accessory.example.helloaccessory.consumer.ConsumerService.(ConsumerService.java:48)
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at com.samsung.android.sdk.accessory.SAAgentV2$e.handleMessage(Unknown Source:157)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
E/[SA_SDK]SAAgentV2: Samsung Accessory SDK cannot be initialized
E/[SA_SDK]SAAgentV2: ACCEPT_STATE_ERROR: 2049: Samsung Accessory SDK cannot be initialized. Device or Build not compatible. PeerAgent: null
I/[SA_SDK]SAAgentV2: onError() → ERROR_SDK_NOT_INITIALIZED
D/[SA_SDK]SAAdapter: Agent callback added. Current size - 1
E/[SA_SDK]SAAdapter: getDefaultAdapter: Binding to Accessory service failed!
E/[SA_SDK]SAAgentV2: Binding to Accessory Framework failed
com.samsung.android.sdk.accessory.d: Is the Samsung Accessory Service Framework installed?!
at com.samsung.android.sdk.accessory.SAAdapter.a(Unknown Source:108)
at com.samsung.android.sdk.accessory.SAAgentV2.a(Unknown Source:9)
at com.samsung.android.sdk.accessory.SAAgentV2$b.handleMessage(Unknown Source:303)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.os.HandlerThread.run(HandlerThread.java:67)
ACCEPT_STATE_ERROR: 2048: Samsung Accessory Framework has died!! PeerAgent: null
I tried changing the android versions on the Android emulator but it resulted in the same errors. Because I run the sample app from Samsung, so I don’t think of any reasons from my side. The permissions are fully declared:
Hi,
Accessory Service Framework comes with normally when you install Samsung Wearable app on Samsung devices.
But non-Samsung devices need a separate app installation which is
As you are trying to install on a non-Samsung emulator, you may give it a try!
Please try after installing it and let us know the result.
Thank you for your replies. My emulator doesn’t have Google Play app. So I tried to install the .apk file of Samsung Accessory Service and I got this error:
Now I get it. Samsung phones have Samsung Accessory Service installed automatically when user connects to a watch from Galaxy warable android app.
So on non-samsung devices (android phones like Huawei, oppo,…), if user install Galaxy wearable and connects to galaxy watch, Samsung Accessory Service will be automatically installed too (by the galaxy wearable). And I don’t need to worry about compatibility on non-samsung devices anymore?
Is that correct?
I asked this because when I tried uninstalling Samsung Accessory Service from my galaxy phone, my watch was disconnected. Then I opened Galaxy wearable and press “connect” again, I found out that Samsung Accessory Service is silently installed.
Hi. My popular app (com.wslava.discountwallet) with SAP (Android compainon app) doesn’t work on Android 11!
I have updated SDK to latest AccessorySDK_v2.6.4, but it didn’t help. The phone has a “SsdkUnsupportedException.LIBRARY_NOT_INSTALLED” exception when starting the application. I have tried to compile the latest examples Consumer(Android)_Provider(Tizen),
folder app_SAAgentV2 , but the same error occurs on activity FileTransferActivity
At the moment I do not have a device with Android 11, but users write to me in support, for example, with the Galaxy S20 and a screenshot of the error “Cannot initialize, LIBRARY_NOT_INSTALLED”
After correspondence with Samsung developers, a solution was found.
If your App targets Android R(30) and interacts with other apps which is installed on the same device, you need to use the “queries” element in the Manifest file so that system knows which other apps to show to your app.
Kindly include the below piece of code (queries section) in the manifest file:
Note that I had to update Android Gradle plugin to version 4.1 in order to compile application.
And now everything works!
Wow, great job Samsung (not). How can you guys ignore that your whole accessory service is broken in Android 11? What about providing a hotfix in the SDK or if that’s not possible at least update your (incomplete and outdated) Docs and show how to fix it?? You know that Android 11 is out since MONTHS?! Come on, what the heck Samsung.
@wSlava Thank you for doing Samsungs Job by publishing the solution.
Just registered here to complain about it, if you feel offended by this post just do what you always do and delete my account.
I’m facing a similar issue.
When I build the mobile app with debug mode active, the watch can send and receive data from the mobile app. But, when I build the mobile app in release mode I receive the following error:
Is there someone here that faced the same issue? I’m strugling with this for months :’(
2021-08-11 17:21:44.273 1241-3153/? E/[SA_SDK]SARegistrationTask: Registration failed.Unable to connect to Accessory framework!
com.samsung.android.sdk.accessory.g: Is the Samsung Accessory Service Framework installed?!
at com.samsung.android.sdk.accessory.a.f(Unknown Source:106)
at com.samsung.android.sdk.accessory.i$a.a(Unknown Source:10)
at com.samsung.android.sdk.accessory.i$a.call(Unknown Source:0)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.lang.Thread.run(Thread.java:923)
2021-08-11 17:21:44.274 1241-3152/? E/[SA_SDK]RegisterUponInstallReceiver: Service Registration has failed!
java.util.concurrent.ExecutionException: com.samsung.android.sdk.accessory.g: Is the Samsung Accessory Service Framework installed?!
at java.util.concurrent.FutureTask.report(FutureTask.java:123)
at java.util.concurrent.FutureTask.get(FutureTask.java:193)
at com.samsung.android.sdk.accessory.RegisterUponInstallReceiver$a.run(Unknown Source:4)
Caused by: com.samsung.android.sdk.accessory.g: Is the Samsung Accessory Service Framework installed?!
at com.samsung.android.sdk.accessory.a.f(Unknown Source:106)
at com.samsung.android.sdk.accessory.i$a.a(Unknown Source:10)
at com.samsung.android.sdk.accessory.i$a.call(Unknown Source:0)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.lang.Thread.run(Thread.java:923)
I’m not related to Samsung at all, but I have read somewhere about differences between debug and release builds: namely, when you build for release, ProGuard rules are coming into picture which obfuscates some required parts of the precompiled SAP libraries on the mobile app which then prevents them registering.
As far as I remember this was written somewhere in SAP documentation’s last chapter (like FAQ, or common problems, or something similar, but I’ve read this long time ago)
Thank you so much for the reply. I found the text you commented. I didn’t tested yet, but at least it’s a little of hope .
For anyone else who have interest about this, to find this document, on this page there´s a link for the programming guide, on page 74 there’s a section about Obfuscating The Application Using ProGuard.
Wow, thank you so much! The documentation for Tizen development is the worst I’ve ever seen.
If you are using proguard and can’t get your Tizen companion app to connect properly to your Android app (it probably works for debug builds but not release builds since you’re only using proguard for release builds), and you don’t want to download that 112 page PDF, here’s what you need to add to your proguard-rules.pro file:
-keepclassmembers class com.samsung.** { *; }
-keep class com.samsung.** { *; }
-dontwarn com.samsung.**
#add the lines below if you have a class that extends SAAgentV2
-keepclassmembers class <package name for class that extends SAAgentv2>.** { *; }
-keep class <package name for class that extends SAAgentv2>.** { *; }
So happy that Samsung is adopting Wear OS. The day I get to delete the code repository for our Tizen app will be among the happiest days of my life.