I'm creating an android live wallpaper using Kotlin. This requires a class that extends WallpaperService, which contains an inner class that extends WallpaperService.Engine.
So I've written this:
import android.service.wallpaper.WallpaperService
import android.service.wallpaper.WallpaperService.Engine
public class MyWallpaperService : WallpaperService() {
override fun onCreateEngine(): Engine = MyEngine()
private inner class MyEngine : Engine() {
}
}
The problem is that I'm getting the following 2 errors at compile time:
Error:java.lang.RuntimeException: Error generating constructors of class MyEngine with kind IMPLEMENTATION
Error:java.lang.UnsupportedOperationException: Don't know how to generate outer expression for lazy class MyWallpaperService
I cant figure out why this is happening so any help would be greatly appreciated.