AccessorySDK_Sample_v2.6.4 stopped working on my S10 after Android 11 update

Hello,

I had successfully built and run the AccessorySDK_Sample_v2.6.4 in my S10 (SM-G973F) back in December 2020, under the following configuration:

  • Android(Cosumer) / HelloAccessory / SAAgentV2
  • Tizen(Provider) / HelloAccessory

However, my S10 got updated to Android 11 (SW Release - AP: G973FXXU9EUA4, CP: G973FXXU9EUA4, CSC: G973FOWO9EUA4) a few days ago, and now the Android(Consumer) / HelloAccessory / SAAgentV2 that I had built in December is failing the SA initialization with the following error messages:

2021-02-03 18:28:41.465 12557-12557/com.samsung.android.sdk.accessory.example.consumer E/[SA_SDK]SASdkConfig: Accessory Framework Not installed
2021-02-03 18:28:41.466 12557-12557/com.samsung.android.sdk.accessory.example.consumer E/[SA_SDK]RegisterUponInstallReceiver: SDK config initialization failed.com.samsung.android.sdk.accessory.d: Accessory Framework Not installed
2021-02-03 18:28:41.491 12557-14111/com.samsung.android.sdk.accessory.example.consumer I/[SA_SDK]SAAdapter: getDefaultAdapter: About start waiting
2021-02-03 18:28:41.531 12557-12557/com.samsung.android.sdk.accessory.example.consumer I/ViewRootImpl@dcb2cb6[ConsumerActivity]: Relayout returned: old=(0,0,1080,2280) new=(0,0,1080,2280) req=(0,0)8 dur=12 res=0x1 s={false 0} ch=false fn=-1
2021-02-03 18:28:41.619 12557-12557/com.samsung.android.sdk.accessory.example.consumer I/[SA_SDK]SAAdapter: Received Client ID:1774985580
2021-02-03 18:28:41.619 12557-14111/com.samsung.android.sdk.accessory.example.consumer I/[SA_SDK]SAAdapter: Application is now connected to Accessory Framework!
2021-02-03 18:28:41.622 12557-14111/com.samsung.android.sdk.accessory.example.consumer I/[SA_SDK]ServiceXmlReader: Service description(s) file Location:/res/xml/accessoryservices.xml
2021-02-03 18:28:41.667 12557-14111/com.samsung.android.sdk.accessory.example.consumer I/[SA_SDK]SARegistrationTask: Services Registered successfully!

(Here I click on “ACCESSORY” button)

2021-02-03 18:31:12.812 12557-12557/com.samsung.android.sdk.accessory.example.consumer I/ViewRootImpl@a61ba03[AccessoryActivity]: setView = com.android.internal.policy.DecorView@1336ea1 TM=true
2021-02-03 18:31:12.831 12557-12557/com.samsung.android.sdk.accessory.example.consumer I/ViewRootImpl@a61ba03[AccessoryActivity]: Relayout returned: old=(0,0,1080,2280) new=(0,0,1080,2280) req=(1080,2280)0 dur=5 res=0x7 s={true 504441308832} ch=true fn=-1
2021-02-03 18:31:12.835 12557-12557/com.samsung.android.sdk.accessory.example.consumer I/ViewRootImpl@a61ba03[AccessoryActivity]: [DP] dp(1) 1 android.view.ViewRootImpl.reportNextDraw:10751 android.view.ViewRootImpl.performTraversals:3733 android.view.ViewRootImpl.doTraversal:2519
2021-02-03 18:31:12.835 12557-12557/com.samsung.android.sdk.accessory.example.consumer I/ViewRootImpl@a61ba03[AccessoryActivity]: [DP] pd() Asnyc report
2021-02-03 18:31:12.885 12557-12557/com.samsung.android.sdk.accessory.example.consumer I/ViewRootImpl@a61ba03[AccessoryActivity]: [DP] pdf(0) 1 android.view.ViewRootImpl.lambda$performDraw$1$ViewRootImpl:4554 android.view.-$$Lambda$ViewRootImpl$DJd0VUYJgsebcnSohO6h8zc_ONI.run:6 android.os.Handler.handleCallback:938
2021-02-03 18:31:12.885 12557-12557/com.samsung.android.sdk.accessory.example.consumer I/ViewRootImpl@a61ba03[AccessoryActivity]: [DP] rdf()
2021-02-03 18:31:12.886 12557-12557/com.samsung.android.sdk.accessory.example.consumer E/[SA_SDK]SASdkConfig: Accessory Framework Not installed
2021-02-03 18:31:12.886 12557-12557/com.samsung.android.sdk.accessory.example.consumer W/System.err: com.samsung.android.sdk.accessory.d: Accessory Framework Not installed
2021-02-03 18:31:12.886 12557-12557/com.samsung.android.sdk.accessory.example.consumer W/System.err: at com.samsung.android.sdk.accessory.k.(Unknown Source:108)
2021-02-03 18:31:12.886 12557-12557/com.samsung.android.sdk.accessory.example.consumer W/System.err: at com.samsung.android.sdk.accessory.SAAgentV2.f(Unknown Source:6)
2021-02-03 18:31:12.887 12557-12557/com.samsung.android.sdk.accessory.example.consumer W/System.err: at com.samsung.android.sdk.accessory.SAAgentV2.(Unknown Source:85)
2021-02-03 18:31:12.887 12557-12557/com.samsung.android.sdk.accessory.example.consumer W/System.err: at com.samsung.android.sdk.accessory.example.consumer.AccessoryConsumer.(AccessoryConsumer.java:44)
2021-02-03 18:31:12.887 12557-12557/com.samsung.android.sdk.accessory.example.consumer W/System.err: at java.lang.reflect.Constructor.newInstance0(Native Method)
2021-02-03 18:31:12.887 12557-12557/com.samsung.android.sdk.accessory.example.consumer W/System.err: at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
2021-02-03 18:31:12.887 12557-12557/com.samsung.android.sdk.accessory.example.consumer W/System.err: at com.samsung.android.sdk.accessory.SAAgentV2$e.handleMessage(Unknown Source:165)
2021-02-03 18:31:12.887 12557-12557/com.samsung.android.sdk.accessory.example.consumer W/System.err: at android.os.Handler.dispatchMessage(Handler.java:106)
2021-02-03 18:31:12.887 12557-12557/com.samsung.android.sdk.accessory.example.consumer W/System.err: at android.os.Looper.loop(Looper.java:246)
2021-02-03 18:31:12.887 12557-12557/com.samsung.android.sdk.accessory.example.consumer W/System.err: at android.app.ActivityThread.main(ActivityThread.java:8425)
2021-02-03 18:31:12.887 12557-12557/com.samsung.android.sdk.accessory.example.consumer W/System.err: at java.lang.reflect.Method.invoke(Native Method)
2021-02-03 18:31:12.887 12557-12557/com.samsung.android.sdk.accessory.example.consumer W/System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:596)
2021-02-03 18:31:12.887 12557-12557/com.samsung.android.sdk.accessory.example.consumer W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
2021-02-03 18:31:12.889 12557-12557/com.samsung.android.sdk.accessory.example.consumer E/[SA_SDK]SASdkConfig: Accessory Framework Not installed
2021-02-03 18:31:12.889 12557-12557/com.samsung.android.sdk.accessory.example.consumer E/[SA_SDK]SAAgentV2: SDK initialization failed!

I tried uninstalling and then reinstalling Samsung Wear (which is supposed to have the Samsung Accessory Framework in it), but the same error persists.

I also tried to look for “Samsung Accessory” in Play Store, but then only the Samsung Wear (already installed) is listed.

Does anybody know why this error started to happen, eventhough I’m just trying to run the same apk that was working about a month ago? Any clue on how I can get it working again?

Thank you

Hi,
Welcome to the community.
Please follow instruction first-
→ Upgrade your Android Gradle plugin to version 4.1
→ Set your app’s targetSdkVersion to 30
→ Include below code in your manifest

  • manifest package=“com.your.app.package”
  • queries
  • package android:name=“com.samsung.accessory”
  • queries
  • ...
    
  • manifest

For more details check this link

Thank you, the solution worked.

However, I believe the AccessorySDK and AccessorySDK_Sample need to be updated with this critical information, especially because the package name “com.samsung.accessory” to be added in the ‘queries’ statement is not easy for developers to figure out themselves (I had previously attempted “com.samsung.android.sdk.accessory”, and it failed).