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

iOS Amplify Configuration Crash On Startup #539

Closed
bwhiteTP opened this issue Apr 23, 2021 · 17 comments
Closed

iOS Amplify Configuration Crash On Startup #539

bwhiteTP opened this issue Apr 23, 2021 · 17 comments
Labels
pending-close-response-required The issue will be closed if details necessary to reproduce the issue are not provided within 7 days.

Comments

@bwhiteTP
Copy link

Describe the bug
Our release build is suddenly crashing on startup on iOS. We've narrowed it down to an issue with amplify configuration. It was working fine until one build it suddenly wasn't working and we haven't made any configuration or amplify changes. Here is the crash log:

Crashed: com.apple.main-thread
0  AWSPluginsCore                 0x1032be260 @objc AmplifyAWSServiceConfiguration.init(region:endpoint:credentialsProvider:localTestingEnabled:) + 11 (AmplifyAWSServiceConfiguration.swift:11)
1  AWSPluginsCore                 0x1032bdf94 AmplifyAWSServiceConfiguration.init(region:) + 42 (AmplifyAWSServiceConfiguration.swift:42)
2  AmplifyPlugins                 0x1037825a4 specialized AWSCognitoAuthPlugin.userPoolServiceConfiguration(from:) + 152 (<compiler-generated>:152)
3  AmplifyPlugins                 0x103780b6c AWSCognitoAuthPlugin.awsMobileClientAdapter(from:) + 70 (AWSCognitoAuthPlugin+Configure.swift:70)
4  AmplifyPlugins                 0x10378043c AWSCognitoAuthPlugin.configure(using:) + 38 (AWSCognitoAuthPlugin+Configure.swift:38)
5  AmplifyPlugins                 0x103780d64 protocol witness for Plugin.configure(using:) in conformance AWSCognitoAuthPlugin + 20 (<compiler-generated>:20)
6  Amplify                        0x10338a1ec static Amplify.configure(plugins:using:) + 162 (AmplifyConfiguration.swift:162)
7  Amplify                        0x1033a23e8 AuthCategory.configure(using:) + 21 (AuthCategory+CategoryConfigurable.swift:21)
8  Amplify                        0x1033a25a8 protocol witness for CategoryConfigurable.configure(using:) in conformance AuthCategory + 27 (AuthCategory+CategoryConfigurable.swift:27)
9  Amplify                        0x1033892c8 static Amplify.configure(_:) + 152 (AmplifyConfiguration.swift:152)
10 amplify_flutter                0x1043bf8fc specialized SwiftAmplify.onConfigure(result:version:configuration:) + 48 (SwiftAmplify.swift:48)
11 amplify_flutter                0x1043c02d0 specialized SwiftAmplify.handle(_:result:) + 548 (<compiler-generated>:548)
12 amplify_flutter                0x1043be6b4 @objc SwiftAmplify.handle(_:result:) + 72 (<compiler-generated>:72)
13 Flutter                        0x104dd4e60 (Missing)
14 Flutter                        0x10484c0d8 (Missing)
15 Flutter                        0x104b48f8c (Missing)
16 Flutter                        0x104ae9d94 (Missing)
17 Flutter                        0x104aebbf4 (Missing)
18 CoreFoundation                 0x182cd5fa0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 32
19 CoreFoundation                 0x182cd5ba0 __CFRunLoopDoTimer + 1064
20 CoreFoundation                 0x182cd4ffc __CFRunLoopDoTimers + 328
21 CoreFoundation                 0x182cceee4 __CFRunLoopRun + 1936
22 CoreFoundation                 0x182cce21c CFRunLoopRunSpecific + 600
23 GraphicsServices               0x19a898784 GSEventRunModal + 164
24 UIKitCore                      0x18570eee8 -[UIApplication _run] + 1072
25 UIKitCore                      0x18571475c UIApplicationMain + 168
26 Runner                         0x102a491e0 main + 5 (AppDelegate.swift:5)
27 libdyld.dylib                  0x18298e6b0 start + 4

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

Output of flutter doctor -v
  • Framework revision adc687823a (7 days ago), 2021-04-16 09:40:20 -0700
  • Engine revision b09f014e96
  • Dart version 2.12.3
@rmargolinross
Copy link

I had this issue as well. It seems that there are new Pods being grabbed that are causing the issue. It works fine with the stuff I have here, but I don't want to commit my Podfile.lock
Screen Shot 2021-04-23 at 5 13 45 PM

@kjones
Copy link

kjones commented Apr 24, 2021

Looks like a change to the underlying iOS SDK in 2.23.4 breaks AmplifyAWSServiceConfiguration

@lawmicha
Copy link
Member

lawmicha commented Apr 24, 2021

attempting to reproduce this from an iOS app using AWSAuthCognitoAuthPugin,

AWSPluginsCore/AmplifyAWSServiceConfiguration.swift: 11: 14: Fatal error: Use of unimplemented initializer 'init(region:endpoint:credentialsProvider:localTestingEnabled:)' for class 'AWSPluginsCore.AmplifyAWSServiceConfiguration'
2021-04-23 19:04:06.697190-0700 flutter539[42762:388757] AWSPluginsCore/AmplifyAWSServiceConfiguration.swift: 11: 14: Fatal error: Use of unimplemented initializer 'init(region:endpoint:credentialsProvider:localTestingEnabled:)' for class 'AWSPluginsCore.AmplifyAWSServiceConfiguration'

Fatal error: Use of unimplemented initializer 'init(region:endpoint:credentialsProvider:localTestingEnabled:)

related: https://github.com/aws-amplify/aws-sdk-ios/pull/3544/files#diff-e277b4a4831ffefecbf79b2881410af909eef61de49df280d6fee8d976a88100

@lawmicha
Copy link
Member

PR that should fix the problem aws-amplify/amplify-swift#1182

@lawmicha
Copy link
Member

is there a workaround for now?

On iOS, we updated the SDK dependency to 2.23.0 and released 1.6.1. So any version from 1.6.1 and up will pull in SDK 2.23.4 and break the app

How does flutter decide which Amplify iOS version to use?

@Ashish-Nanda
Copy link
Contributor

Thanks @lawmicha for the PR.

Currently Amplify Flutter uses the latest version of Amplify iOS which is 1.8.1. This version also contains the changes to fix the hot restart issue. I think the only way to workaround this would be to pin the transitive dependency for the iOS SDK to a version before 2.23.4. I believe this should be possible in the Podfile.lock?

I assume Amplify iOS customers are also impacted by this issue. What workaround would you recommend until a new version with the fix can be released?

@lawmicha
Copy link
Member

Yes I think that’s correct, Podfile.lock could be manually modified to pin it to 2.23.3. From an iOS app using a Podfile, a developer will also see this issue and could pin it this way

// Podfile
pod 'AWSCore', '2.23.3'

@haverchuck
Copy link
Contributor

@lawmicha I was unable to get the podfile workaround to work; however, I was able to resolve the problem by replacing instances of 2.23.4 with 2.23.3 in the Podfile.lock.

@Ashish-Nanda
Copy link
Contributor

Ashish-Nanda commented Apr 24, 2021

Thanks for verifying @haverchuck. After checking with the Amplify iOS team, its not recommended to modify the generated Podfile.lock.
They are working on releasing a new version of the library right now. Will update the thread once its done.

@Ashish-Nanda Ashish-Nanda added the requires-ios-fix This issue is the result of an underlying Amplify iOS issue that needs to be fixed. label Apr 24, 2021
@lawmicha
Copy link
Member

SDK 2.23.5 is in progress of being released, which should fix the issue, I see a few have been pushed to cocoapods already, please upgrade any dependency on the SDK to 2.23.5. I’ll be doing verification myself but if anyone is blocked on this and have time to try it out, please upgrade to 2.23.5 and let us know if it is fixed for you

@lawmicha
Copy link
Member

I've verified that this issue is no longer a problem with the latest 2.23.5 release. Please let us know if you see any issues.

@haverchuck
Copy link
Contributor

Worked for me after running pod update.

@Ashish-Nanda
Copy link
Contributor

Thanks @lawmicha for releasing this on priority and @haverchuck for verifying the fix.

@bwhiteTP @rmargolinross could you run a pod update and confirm version 2.23.5 works for you. Would like to close out this issue once you verify.

@Ashish-Nanda Ashish-Nanda added pending-close-response-required The issue will be closed if details necessary to reproduce the issue are not provided within 7 days. and removed requires-ios-fix This issue is the result of an underlying Amplify iOS issue that needs to be fixed. labels Apr 25, 2021
@brunovsiqueira
Copy link

I had same crash before running pod update. After running it, the crash stopped. Thank you!

@Ashish-Nanda
Copy link
Contributor

Thanks for confirming @brunovsiqueira. Closing the issue as its resolved and verified.

@drkhannah
Copy link

drkhannah commented Dec 26, 2021

Im seeing this same crash with 2.26.6, just started happening last week

`PODS:

  • Amplify (1.15.6):
    • Amplify/Default (= 1.15.6)
  • Amplify/Default (1.15.6)
  • amplify_api (0.0.1):
    • Amplify (~> 1.15.5)
    • amplify_core
    • AmplifyPlugins/AWSAPIPlugin (~> 1.15.5)
    • Flutter
  • amplify_auth_cognito (0.0.1):
    • Amplify (~> 1.15.5)
    • amplify_core
    • AmplifyPlugins/AWSCognitoAuthPlugin (~> 1.15.5)
    • Flutter
    • ObjectMapper
  • amplify_core (0.0.1):
    • Flutter
  • amplify_flutter (0.0.1):
    • Amplify (~> 1.15.5)
    • amplify_core
    • AmplifyPlugins/AWSCognitoAuthPlugin (~> 1.15.5)
    • AWSPluginsCore (~> 1.15.5)
    • Flutter
  • amplify_storage_s3 (0.0.1):
    • Amplify (~> 1.15.5)
    • amplify_core
    • AmplifyPlugins/AWSS3StoragePlugin (~> 1.15.5)
    • Flutter
  • AmplifyPlugins/AWSAPIPlugin (1.15.6):
    • AppSyncRealTimeClient (~> 1.4)
    • AWSCore (~> 2.26.1)
    • AWSPluginsCore (= 1.15.6)
  • AmplifyPlugins/AWSCognitoAuthPlugin (1.15.6):
    • AWSAuthCore (~> 2.26.1)
    • AWSCognitoIdentityProvider (~> 2.26.1)
    • AWSCognitoIdentityProviderASF (~> 2.26.1)
    • AWSCore (~> 2.26.1)
    • AWSMobileClient (~> 2.26.1)
    • AWSPluginsCore (= 1.15.6)
  • AmplifyPlugins/AWSS3StoragePlugin (1.15.6):
    • AWSCore (~> 2.26.1)
    • AWSPluginsCore (= 1.15.6)
    • AWSS3 (~> 2.26.1)
  • AppSyncRealTimeClient (1.6.0):
    • Starscream (~> 3.1.1)
  • AWSAuthCore (2.26.6):
    • AWSCore (= 2.26.6)
  • AWSCognitoIdentityProvider (2.26.6):
    • AWSCognitoIdentityProviderASF (= 2.26.6)
    • AWSCore (= 2.26.6)
  • AWSCognitoIdentityProviderASF (2.26.6):
    • AWSCore (= 2.26.6)
  • AWSCore (2.26.6)
  • AWSMobileClient (2.26.6):
    • AWSAuthCore (= 2.26.6)
    • AWSCognitoIdentityProvider (= 2.26.6)
    • AWSCognitoIdentityProviderASF (= 2.26.6)
    • AWSCore (= 2.26.6)
  • AWSPluginsCore (1.15.6):
    • Amplify (= 1.15.6)
    • AWSCore (~> 2.26.1)
  • AWSS3 (2.26.6):
    • AWSCore (= 2.26.6)`
  amplify_auth_cognito: ^0.2.10
  amplify_flutter: ^0.2.10
  amplify_storage_s3: ^0.2.10```

@drkhannah
Copy link

not experiencing this when i manually lock these files in podlock

    - AWSCore (= 2.26.5)
  - AWSCognitoIdentityProvider (2.26.5):
    - AWSCognitoIdentityProviderASF (= 2.26.5)
    - AWSCore (= 2.26.5)
  - AWSCognitoIdentityProviderASF (2.26.5)
  - AWSCore (2.26.5)
  - AWSMobileClient (2.26.5):
    - AWSAuthCore (= 2.26.5)
    - AWSCognitoIdentityProvider (= 2.26.5)
    - AWSCognitoIdentityProviderASF (= 2.26.5)
    - AWSCore (= 2.26.5)
  - AWSPluginsCore (1.15.6):
    - Amplify (= 1.15.6)
    - AWSCore (~> 2.26.1)
  - AWSS3 (2.26.5):
    - AWSCore (= 2.26.5)```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-close-response-required The issue will be closed if details necessary to reproduce the issue are not provided within 7 days.
Projects
None yet
Development

No branches or pull requests

8 participants