samsung – Android(Oreo) 8.1.0 Set DeviceOwer app causes “Workspace has been locked”

I’ve been using my app as a deviceOwner App since lollipop.
I have a new device here which I want to be DeviceOwner too.

It is a Samsung galaxy Tab A 10.5(2018) SM-T590.

I am currently running this Version of the rom: T590XXU2ASC1.

I am not using NFC method.
I usualy create the /data/system/device_owner.xml file by myself.
But since it is not working I tryed this method:

  1. Factory reset the tablet in recovery mode

  2. Pass through the annoying startup menus

  3. Set lock screen to none

  4. Enable Usb Debugging

  5. Install my app adb install MyApplicaton.apk

  6. adb shell dpm set-device-owner com.example.myapplication/.MyApplicationReceiver
    It always says success when i execute the command.

  7. Start my app, i can pin/unpin my app without problem.

  8. Reboot, and then the famous message appears everytime:
    Workspace has been locked
    Unauthorized software has been installed on your device.Workspace has been
    locked to prevent any unauthorized access. Contact your admin.

Then if i press on the FACTORY DATA RESET button the workspace app crashes then pops back.

I tryed the kioskModeDemo app and the androidDeviceOwner sample app and they all do the same problem.

Anybody have any hints of why this is not working anymore on Android 8(oreo)?

Thanksenter image description here