kineapps / flutter_archive

Flutter plugin for creating and extracting ZIP files.
https://pub.dev/packages/flutter_archive
BSD 3-Clause "New" or "Revised" License
57 stars 43 forks source link

Android build not working (Kotlin syntax update) #54

Closed BrendenFraser closed 2 years ago

BrendenFraser commented 2 years ago

Hi, I believe I've found an issue with flutter_archive on Android. I'm not sure if I'm using an older or newer version of Kotlin from what the plugin was built to use but I believe that's the issue.

e: /Users/me/.pub-cache/hosted/pub.dartlang.org/flutter_archive-4.2.0/android/src/main/kotlin/com/kineapps/flutterarchive/FlutterArchivePlugin.kt: (455, 58): Object is not abstract and does not implement abstract member public abstract fun error(p0: String, p1: String?, p2: Any?): Unit defined in io.flutter.plugin.common.MethodChannel.Result
e: /Users/me/.pub-cache/hosted/pub.dartlang.org/flutter_archive-4.2.0/android/src/main/kotlin/com/kineapps/flutterarchive/FlutterArchivePlugin.kt: (472, 17): 'error' overrides nothing

The fix is fairly simple, on line 472 in FlutterArchivePlugin.kt, the first ? needs to be removed: override fun error(code: String, msg: String?, details: Any?) {

If I'm using an old version of Kotlin and just need to upgrade, I can close this issue.

kinex commented 2 years ago

I think this is a duplicate of https://github.com/kineapps/flutter_archive/issues/52 (fixed in master).