SDK initialization failed! Accessory Framework Not installed

Hi everyone,

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:

<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="com.samsung.accessory.permission.ACCESSORY_FRAMEWORK" />
<uses-permission android:name="com.samsung.android.providers.context.permission.WRITE_USE_APP_FEATURE_SURVEY" />
<uses-permission android:name="com.samsung.wmanager.ENABLE_NOTIFICATION" />
<uses-permission android:name="com.samsung.WATCH_APP_TYPE.Companion"/>

I already checked these libraries: accessory-v2.6.1.jar and sdk-v1.0.0.jar. They are already included in the project:

The code works perfectly on all of my Samsung phones (real devices), it’s just not working on non-Samsung device like my emulator.

My question is: Will Samsung Accessory SDK work with non-Samsung devices? Can you please help me to figure out what’s the problem?

Thanks in advance.

I am stuck on it. Please help me!

Hi, I think you will get solution by using Tech support: https://developer.samsung.com/support

1 Like

You have to install Samsung Accessory Plugin https://play.google.com/store/apps/details?id=com.samsung.accessory

2 Likes

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.

Thanks,
Iqbal

2 Likes

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.

Thanks in advance.

Yes on Samsung phones, it comes with Samsung Wearable (Gear Manager) app.

1 Like

Thank you! I understand now.