wallpaper_manager icon indicating copy to clipboard operation
wallpaper_manager copied to clipboard

Cast Error thrown when applying wallpaper

Open houdayec opened this issue 4 years ago • 1 comments

Platform used: iOS 13.4.1

Error thrown:

Exception has occurred. _CastError (type 'String' is not a subtype of type 'int' in type cast)

Method throwing error:

setWallpaperFromFile()

Cause:

final int result = await _channel.invokeMethod('setWallpaperFromFile',...)

Result variable expects a int value, however, on iOS 13.4.1, the returned value is a String expression giving the current iOS version: "iOS 13.4.1".

I did a quick fix for my project by setting result variable to a simple non final var, however, the great fix might be on the iOS channel side.

Note I know iOS does not allow to set wallpapers from third parties. But it is a great option to catch this error if a developer is using this method on iOS for any reason!

Keep up the good work!

houdayec avatar Jun 01 '20 08:06 houdayec

I think this might explains it https://github.com/AdityaMulgundkar/wallpaper_manager#notes 😢

cristopher-rodrigues avatar May 06 '22 02:05 cristopher-rodrigues