Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running app second time, cannot configure amplify (User-Agent is configured internally during Amplify configuration. This method should not be called externally) #143

Closed
deimantasa opened this issue Oct 9, 2020 · 4 comments

Comments

@deimantasa
Copy link

deimantasa commented Oct 9, 2020

Describe the bug
Running app second time, it throws exception

To Reproduce

  1. Launch the app first time - error received here AmplifyException, Error casting configuration map, Unsupported value: org.json.JSONException: No value for pinpointAnalytics, null #142
  2. Launch app second time - another error is visible
E/flutter ( 8525): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: PlatformException(AmplifyException, User-Agent was already configured successfully., {cause: null, recoverySuggestion: User-Agent is configured internally during Amplify configuration. This method should not be called externally.}, null)
E/flutter ( 8525): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:582:7)
E/flutter ( 8525): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:159:18)
E/flutter ( 8525): <asynchronous suspension>
E/flutter ( 8525): #2      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:332:12)
E/flutter ( 8525): #3      MethodChannelAmplifyCore.configure (package:amplify_core_plugin_interface/method_channel_amplify.dart:25:21)
E/flutter ( 8525): #4      Amplify.configure (package:amplify_core/amplify_core.dart:71:35)
E/flutter ( 8525): #5      AwsAmplifyService.init (package:fluid/services/aws_amplify_service.dart:23:19)
E/flutter ( 8525): #6      _FluidAppState._initServices (package:fluid/main/main.dart:84:47)
E/flutter ( 8525): <asynchronous suspension>
E/flutter ( 8525): #7      _FluidAppState.initState (package:fluid/main/main.dart:51:5)
E/flutter ( 8525): #8      StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4812:57)
E/flutter ( 8525): #9      ComponentElement.mount (package:flutter/src/widgets/framework.dart:4649:5)
E/flutter ( 8525): #10     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3615:14)
E/flutter ( 8525): #11     Element.updateChild (package:flutter/src/widgets/framework.dart:3380:18)
E/flutter ( 8525): #12     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4700:16)
E/flutter ( 8525): #13     Element.rebuild (package:flutter/src/widgets/framework.dart:4369:5)
E/flutter ( 8525): #14     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4654:5)
E/flutter ( 8525): #15     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4649:5)
E/flutter ( 8525): #16     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3615:14)
E/flutter ( 8525): #17     Element.updateChild (package:flutter/src/widgets/framework.dart:3377:20)
E/flutter ( 8525): #18     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4700:16)
E/flutter ( 8525): #19     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4847:11)
E/flutter ( 8525): #20     Element.rebuild (package:flutter/src/widgets/framework.dart:4369:5)
E/flutter ( 8525): #21     BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2777:33)
E/flutter ( 8525): #22     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:906:21)
E/flutter ( 8525): #23     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:309:5)
E/flutter ( 8525): #24     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1117:15)
E/flutter ( 8525): #25     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1055:9)
E/flutter ( 8525): #26     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:971:5)
E/flutter ( 8525): #27     _rootRun (dart:async/zone.dart:1190:13)
E/flutter ( 8525): #28     _CustomZone.run (dart:async/zone.dart:1093:19)
E/flutter ( 8525): #29     _CustomZone.runGuarded (dart:async/zone.dart:997:7)
E/flutter ( 8525): #30     _invoke (dart:ui/hooks.dart:251:10)
E/flutter ( 8525): #31     _drawFrame (dart:ui/hooks.dart:209:3)

Expected behavior
App should be launched without any issues

Screenshots
If applicable, add screenshots to help explain your problem.

Platform
Amplify Flutter current supports iOS and Android. This issue is reproducible in (check all that apply):
[x] Android
[] iOS

Smartphone (please complete the following information):
OnePlus6

Additional context
It should be possible to check, if AWS is already configured by a public variable. Currently, _isConfigured in Amplify() is private.

@FirdousNath
Copy link

How you resolved it ?

@deimantasa
Copy link
Author

Hi @FirdousNath , we've decided to drop amplify due to too many issues at that point. But I heard now it should be much more stable. As when we had a chance to play with it, it was still in very early stage of development.

@fjnoyp
Copy link
Contributor

fjnoyp commented Feb 23, 2021

Hey @deimantasa we're sorry to hear that. We had our GA release last Monday so the current version is much more stable.

@FirdousNath could you explain your issue in a separate Git issue so we can help you?

@deimantasa
Copy link
Author

@fjnoyp , no worries mate! Nothing can be perfect. Especially at that early stage. I was happy to read that recently you guys released much higher and more stable version. Keep up great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants