Have you asked permission?
Yes , Read and Write
@Pankaj_Developer You need all these permissions
android.permission.SET_WALLPAPER
android.permission.READ_EXTERNAL_STORAGE
android.permission.WRITE_SETTINGS
android.permission.WRITE_EXTERNAL_STORAGE
Remove it and. Try again
I guess you are doing it in companion please try compiling and using in apk
I have tried in apk also.