簡體   English   中英

嘗試在 android studio 中構建我的顫振項目時遇到錯誤

[英]I am getting errors while trying to build my flutter project in android studio

當我嘗試運行我的顫振應用程序時,我收到以下錯誤。 可能是什么原因? ..................................................... ..................................................... ..................................................... ..................................................... ..................................................... ..................................................... ..................................................... ..................................................... ……

我正在使用qr_code_scanner: ^0.5.2

      Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
Parameter format not correct -
e: C:\src\flutter\flutter\.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: C:\src\flutter\flutter\.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: C:\src\flutter\flutter\.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: C:\src\flutter\flutter\.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: C:\src\flutter\flutter\.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: C:\src\flutter\flutter\.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 51s
Exception: Gradle task assembleDebug failed with exit code 1

我的 pubspec.yaml

name: StarMe
description: A Social Media Project.
publish_to: "none"
version: 1.0.0+1

environment:
  sdk: ">=2.12.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^1.0.3
  google_fonts: ^2.1.0
  flutter_icons_nullsafty: ^1.0.0
  http: ^0.13.3
  cached_network_image: ^3.1.0
  encrypt: ^5.0.1
  flutter_svg: ^0.22.0
  qr_flutter: ^4.0.0
  clipboard: ^0.1.3
  share: ^2.0.4
  qr_code_scanner: ^0.7.0
  fluro: ^2.0.3
  url_launcher: ^6.0.10
  image_picker: ^0.8.4
  country_code_picker: ^2.0.2
  introduction_screen: ^2.1.0
  pin_code_fields: ^7.3.0
  provider: ^6.0.0
  hive: ^2.0.4
  hive_flutter: ^1.1.0
  flutter_secure_storage: ^4.2.1
  local_auth: ^1.1.7
  permission_handler: ^8.1.4+2
  fl_chart: ^0.40.0
  carousel_slider: ^4.0.0
  web3dart: ^2.3.1
  device_info_plus: ^2.1.0
  package_info_plus: ^1.3.0
  intl: ^0.17.0
  flutter_paystack:
    git:
      url: https://github.com/definitelyme/flutter_paystack.git
      ref: a4a33c3dd0a12f46d655a2e63d11e9f20ba82d01

  flutter_braintree: ^2.0.0+1
  loading_overlay: ^0.3.0
  lazy_load_scrollview: ^1.3.0
  shimmer: ^2.0.0
  in_app_review: ^2.0.3
  image_cropper: ^1.5.0
  ntp: ^2.0.0
  uuid: ^3.0.4
  cron: ^0.3.2
  dotted_border: ^2.0.0+1
  translator: ^0.1.7

  firebase_core: ^1.6.0
  
  firebase_messaging: ^10.0.9
  firebase_analytics: ^8.3.4
  firebase_dynamic_links: ^3.0.1

  easy_localization_loader: ^1.0.0
  
  sentry_flutter: ^6.0.1
  twilio_phone_verify: ^2.0.0
  flutter_local_notifications: ^9.0.1
  flutter_dotenv: ^5.0.2


  flutter_localizations:
    sdk: flutter

dev_dependencies:
  flutter_test:
    sdk: flutter

使用替代mobile_scanner 這個庫在 Flutter 3.0 中不起作用。 否則,如果您想使用 qr_code_scanner 庫,那不是官方的創建者存儲庫,但您可以使用它。

dependency_overrides:
    qr_code_scanner:
        git:
            url: https://github.com/X-SLAYER/qr_code_scanner.git
            ref: flutter-beta

而不是給qr_code_scanner: ^0.5.2嘗試qr_code_scanner: any 這只是一種解決方法。 它將自動獲取相關版本的 QR 掃描儀。 如果它不起作用,請嘗試flutter clean然后flutter run

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM