(Samsung Health SDK) Denied to access by Policy

Hi,

I’m trying to connect with Samsung Health SDK using a channel between my Flutter app and Kotlin.
I’m already approved in the SH Partner Service.

This is the log of my error:
I/flutter (17160): PlatformException(error, Denied to access by Policy: ch.swissanalytica.sentinela, null, java.lang.SecurityException: Denied to access by Policy: ch.swissanalytica.sentinela
I/flutter (17160): at android.os.Parcel.createExceptionOrNull(Parcel.java:3023)
I/flutter (17160): at android.os.Parcel.createException(Parcel.java:3007)
I/flutter (17160): at android.os.Parcel.readException(Parcel.java:2990)
I/flutter (17160): at android.os.Parcel.readException(Parcel.java:2932)
I/flutter (17160): at com.samsung.android.sdk.healthdata.v0.readData2(SourceFile:15)
I/flutter (17160): at com.samsung.android.sdk.healthdata.HealthDataResolver.read(SourceFile:12)
I/flutter (17160): at ch.swissanalytica.MainActivity.getStepData(MainActivity.kt:71)
I/flutter (17160): at ch.swissanalytica.MainActivity.configureFlutterEngine$lambda$0(MainActivity.kt:53)
I/flutter (17160): at ch.swissanalytica.MainActivity.$r8$lambda$ZNH9RG58dzKoDE_Kulc_vR98XgU(Unknown Source:0)
I/flutter (17160): at ch.swissanalytica.MainActivity$$ExternalSyntheticLambda1.onMethodCall(Unknown Source:2)
I/flutter (17160): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
I/flutter (17160): at io.flutter.embedding.engine.dart.D

Is there someone who has passed through this kind of error?

Thanks!

Hello,

Please report this issue to the Developer Support for 1-on-1 communication.
It will solve your problem faster.

Thanks
Shamima
Samsung Developer Program Team

Hi Shamima,

Unfortunately, they don’t.

I had to find the answers by myself understand how Flutter interacts with Kotlin.

Turns out that I had to create a Flutter Plugin to work with the Samsung Health Data SDK and then use this plugin in my project.

Hi @jorge.abdalla,

As per my knowledge, Flutter isn’t recommended for Wear OS, since the Framework is not optimized for Wearable devices.

Hi @enuasian_lynx
I wasn’t using for WearOS, but Data SDK for mobile.
Anyway, Flutter works fine here, except for the fact I don’t know wich package name and SHA256 Samsung will need to know for release mode.