【问题标题】:Flutter app is crashing after 'flutter clean' and debugFlutter 应用程序在“flutter clean”和调试后崩溃
【发布时间】:2020-03-20 20:44:48
【问题描述】:

我不明白为什么在我进行“颤振清洁”后一切都无法正常工作。几乎在同一时间,我不小心按下了播放按钮附近的调试按钮。不知道是哪一个搞砸了。这是我在控制台中收到的消息:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
> No matching client found for package name 'com.example.activities'

【问题讨论】:

  • 我认为您新使用了诸如 firebase、FCM 等的 google-service。您必须将可以从 firebase 控制台获取的 google-services.json 添加到文件夹 android/app 中。
  • 检查这个。您的包裹名称可能不匹配。 stackoverflow.com/questions/34990479/…

标签: flutter


【解决方案1】:

我返回并从 Firebase 重新创建了 google-services.json 文件。我在点击添加 Android 应用后选择的 Android 包名称不正确。它与我制作应用时使用的不同。

我还必须在 app\build.gradle 文件的默认配置 {} 中添加 multiDexEnabled true。所以现在看起来像:

defaultConfig {
    applicationId "com.example.activities"
    minSdkVersion 16
    targetSdkVersion 28
    multiDexEnabled true
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

将 multiDexEnabled 添加到 true 似乎不是一个好主意,但它现在有效。

【讨论】:

    猜你喜欢
    • 2020-12-06
    • 2022-06-22
    • 2019-07-29
    • 2020-02-15
    • 2021-01-06
    • 1970-01-01
    • 2020-08-17
    • 2021-08-04
    • 2020-12-21
    相关资源
    最近更新 更多