theyakka/qr.flutter

Not able to compile for Android for new Flutter v3.0.0

Opened this issue · 1 comments

Describe the bug
Not able to compile for Android for new Flutter v3.0.0.

To Reproduce
Steps to reproduce the behavior:

  1. Upgrade to Flutter version 3.0.0
  2. flutter run

Expected behavior
App builds and runs

Additional context
Build failure logs:

Launching lib/main.dart on sdk gphone64 x86 64 in debug mode...
e: /home/praharsh/.pub-cache/hosted/pub.dartlang.org/qr_code_scanner-0.7.0/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt: (23, 1): Class 'QRView' is not abstract and does not implement abstract member public abstract fun onRequestPermissionsResult(p0: Int, p1: Array<(out) String!>, p2: IntArray): Boolean defined in io.flutter.plugin.common.PluginRegistry.RequestPermissionsResultListener
e: /home/praharsh/.pub-cache/hosted/pub.dartlang.org/qr_code_scanner-0.7.0/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt: (216, 26): Null can not be a value of a non-null type String
e: /home/praharsh/.pub-cache/hosted/pub.dartlang.org/qr_code_scanner-0.7.0/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt: (247, 26): Null can not be a value of a non-null type String
e: /home/praharsh/.pub-cache/hosted/pub.dartlang.org/qr_code_scanner-0.7.0/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt: (310, 5): 'onRequestPermissionsResult' overrides nothing
e: /home/praharsh/.pub-cache/hosted/pub.dartlang.org/qr_code_scanner-0.7.0/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRViewFactory.kt: (10, 1): Class 'QRViewFactory' is not abstract and does not implement abstract base class member public abstract fun create(p0: Context?, p1: Int, p2: Any?): PlatformView defined in io.flutter.plugin.platform.PlatformViewFactory
e: /home/praharsh/.pub-cache/hosted/pub.dartlang.org/qr_code_scanner-0.7.0/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRViewFactory.kt: (13, 5): 'create' overrides nothing


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':qr_code_scanner:compileDebugKotlin'.
> Compilation error. See log for more details
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 2s
Exception: Gradle task assembleDebug failed with exit code 1
Exited

flutter --version
Flutter 3.0.0 • channel stable • https://github.com/flutter/flutter.git Framework • revision ee4e09cce0 (12 days ago) • 2022-05-09 16:45:18 -0700 Engine • revision d1b9a6938a Tools • Dart 2.17.0 • DevTools 2.12.2

Kotlin version used in the project
ext.kotlin_version = '1.5.31'

@praharshbhatt as the maintainer seems inactive, I have fixed the issue in my PR: #204

And uploaded a new version of the package (4.1.0): https://pub.dev/packages/qr_widget

You can report issues with the package in my new repo: https://github.com/vanyasem/qr.widget