【问题标题】:Why is awsconfiguration.json file missing?为什么缺少 awsconfiguration.json 文件?
【发布时间】:2021-08-23 10:57:59
【问题描述】:

我最近开始在 Flutter 项目中使用 AWS Amplify 并完成了项目的初始设置,但是当我在运行应用程序时配置 Amplify 时收到以下错误消息:

AnalyticsException(message: Unable to read appId or region from the amplify configuration json., recoverySuggestion: Make sure amplifyconfiguration.json is a valid json object in expected format. Please take a look at the documentation for expected format of amplifyconfiguration.json., underlyingException: org.json.JSONException: No value for pinpointAnalytics)

发生此错误后,我研究了 awsconfiguration.json 文件,发现我的 android 根目录中的 './app/src/main/res' 中没有应包含此文件的原始文件夹。根据 Amplify 文档,我已经运行了 amplify init,添加了多个插件并使用了 amplify push,但是我仍然看不到这个文件,我认为应该在安装过程中自动创建该文件。如有任何帮助,我将不胜感激。

谢谢!

【问题讨论】:

    标签: flutter aws-amplify aws-amplify-cli


    【解决方案1】:

    这可能是由于在 pubspec.yml 中有 amplify_analytics_pinpoint: ^0.2.0 但没有通过运行 amplify add analytics 添加分析类别

    【讨论】:

      【解决方案2】:

      尝试在我的颤振项目中设置 Amplify 几次后,Amplify 似乎配置正确,但我不确定项目中发生了什么变化。在我跟随下面的 YouTube 视频后,它似乎工作了,所以如果你有同样的问题,可能值得一试。

      链接-https://www.youtube.com/watch?v=1seFk3Fkuis

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-10-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-12-12
        • 1970-01-01
        相关资源
        最近更新 更多