由于上述问题,无法构建插件firebase_messaging

时间:2020-03-02 06:33:07

标签: flutter flutter-dependencies

在这里我遇到了以上错误。在这里,当我尝试运行flutter build apk时,它将显示上述错误。我已经将firebase用于我的项目简单推送通知。但是当我尝试构建apk时,会导致Firebase出现问题

   FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':device_info:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed
     C:\Users\rutvi\.gradle\caches\transforms-2\files-2.1\02e40ce8e8ac3f0fe1e2835a9dad7bf0\core-1.0.1\res\values\values.xml:57:5-88:25: AAPT: error: resource android:attr/fontVariationSettings not found.

     C:\Users\rutvi\.gradle\caches\transforms-2\files-2.1\02e40ce8e8ac3f0fe1e2835a9dad7bf0\core-1.0.1\res\values\values.xml:57:5-88:25: AAPT: error: resource android:attr/ttcIndex not found.


* 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 41s

这是我在项目中使用过的软件包。您可以在这里看到,没有Connectivity_macos软件包

dependencies:
  flutter:
    sdk: flutter
  flutter_bloc: ^0.20.0
  equatable: ^0.4.0
  font_awesome_flutter:
  loader_search_bar: ^1.0.3+3
  image_picker:
  curved_navigation_bar: ^0.1.26
  flutter_speed_dial: ^1.2.1
  dynamic_theme: ^1.0.1
  flutter_redux: ^0.5.3
  redux: ^3.0.0
  redux_persist_flutter: ^0.8.2
  redux_logging: ^0.3.0
  graphql_flutter: ^2.1.1-beta.5
  device_info: ^0.2.1
  flutter_masked_text: ^0.8.0
  rflutter_alert: ^1.0.2
  shared_preferences: ^0.5.3+4
  datetime_picker_formfield:
  flutter_form_builder:
  pin_code_text_field: ^1.2.1
  pin_code_fields: ^1.1.1
  google_map_location_picker: ^2.1.0
  flutter_localizations:
    sdk: flutter
  intl:
  intl_translation:
  http_parser: ^3.1.3
  cached_network_image: 2.0.0-rc
  dio: ^3.0.4
  sqflite: ^1.1.7+2
  path_provider: ^1.4.0
  argon_buttons_flutter: ^1.0.2
  keyboard_actions: ^3.0.0
  progress_dialog: ^1.2.0
  barcode_scan: ^1.0.0
  awesome_dialog: ^0.1.0
  table_calendar: ^2.2.2
  flutter_multiselect: ^0.4.0
  firebase_messaging: ^6.0.9

dev_dependencies:
  flutter_test:
    sdk: flutter

2 个答案:

答案 0 :(得分:0)

我对软件包firebase_message有相同的问题,我将版本编辑为:firebase_messaging: 1.0.2

答案 1 :(得分:0)

您应尝试执行以下步骤。它可以解决您的问题。

解决方法步骤:

在Android Studio(打开项目)中,右键单击android文件夹,然后单击“ Flutter”->“在Android Studio中打开Android模块”。选择“在新窗口中打开”

在新窗口中,展开“ Gradle Scripts”

找到“ build.gradle(模块:device_info)”。

在gradle脚本中,从27-> 28修改compileSdkVersion。