Skip to content

No known class method for selector 'archivedDataWithRootObject:requiringSecureCoding:error:' #40527

Closed

Description

@yerzhant
$ flutter run
Launching lib/main.dart on iPhone X in debug mode...
Running Xcode build...                                                  
                                                   
Xcode build done.                                            7.9s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    /Users/yerzhantulepov/dev/askimam/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTLibrary/GDTStorage.m:122:41: error: no known class method for selector
    'archivedDataWithRootObject:requiringSecureCoding:error:'
            NSData *data = [NSKeyedArchiver archivedDataWithRootObject:self
                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/yerzhantulepov/dev/askimam/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTLibrary/GDTStorage.m:219:24: error: no known class method for selector
    'unarchivedObjectOfClass:fromData:error:'
        [NSKeyedUnarchiver unarchivedObjectOfClass:[GDTStorage class] fromData:data error:nil];
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/yerzhantulepov/dev/askimam/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTLibrary/GDTStorage.m:231:39: error: no known class method for selector
    'archivedDataWithRootObject:requiringSecureCoding:error:'
          NSData *data = [NSKeyedArchiver archivedDataWithRootObject:self
                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/yerzhantulepov/dev/askimam/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTLibrary/GDTStorage.m:259:37: error: no known class method for selector
    'archivedDataWithRootObject:requiringSecureCoding:error:'
        NSData *data = [NSKeyedArchiver archivedDataWithRootObject:self
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    4 errors generated.

Could not build the application for the simulator.
Error launching application on iPhone X.
$ flutter analyze
Analyzing askimam...                                                    
No issues found! (ran in 4.8s)
$ flutter doctor -v
[✓] Flutter (Channel stable, v1.9.1+hotfix.2, on Mac OS X 10.12.6 16G2128, locale en-KZ)
    • Flutter version 1.9.1+hotfix.2 at /Users/yerzhantulepov/dev/flutter
    • Framework revision 2d2a1ffec9 (9 days ago), 2019-09-06 18:39:49 -0700
    • Engine revision b863200c37
    • Dart version 2.5.0

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/yerzhantulepov/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 9.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.2, Build version 9C40b
    • CocoaPods version 1.7.5

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 39.0.3
    • Dart plugin version 191.8423
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] VS Code (version 1.38.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.4.1

[✓] Connected device (1 available)
    • iPhone X • 3AEB7F43-8F7B-40AA-8DE8-DF760A63A41B • ios • iOS 11.2 (simulator)

• No issues found!

Activity

  1. yerzhant commented on Sep 15, 2019

    @yerzhant
    Author

    One must say that the application excellently builds for android.

  2. BondarenkoStas commented on Sep 15, 2019

    @BondarenkoStas

    @yerzhant Please provide a small self-contained app that demonstrates the problem. You can include small examples inline if they're enclosed by backticks, or just provide a public link to a github "gist" - https://gist.github.com/.

  3. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    platform-iosiOS applications specifically
    on Sep 15, 2019
  4. yerzhant commented on Sep 15, 2019

    @yerzhant
    Author
  5. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Sep 15, 2019
  6. The-Redhat commented on Sep 15, 2019

    @The-Redhat
    Contributor

    I'm experiencing the same issue. Therefore I cannot update my app.

  7. ykaito21 commented on Sep 16, 2019

    @ykaito21

    I had the same issue, but after upgrade my Xcode to 10.3 from 9.4, it seems to be working.

  8. jmagman commented on Sep 16, 2019

    @jmagman
    Member

    This is an iOS 11 @availability issue in firebase-ios-sdk CocoaPod, not in Flutter. Please file an issue there (I don't have permission to transfer).

  9. yasinarik commented on Sep 17, 2019

    @yasinarik

    I had the same issue, but after upgrading my Xcode to 10.3 from 9.4, it seems to be working.

    @jmagman I'm still using High Sierra 10.13.2 and I can't update to Mojave. So I'm stuck with XCode v. 9.4.1 (9F2000). I've been having a very hard time for days because of the same issue.

    So you say that it resolves after updating XCode to v10.3?

  10. yerzhant commented on Sep 17, 2019

    @yerzhant
    Author
  11. ykaito21 commented on Sep 17, 2019

    @ykaito21

    I had the same issue, but after upgrading my Xcode to 10.3 from 9.4, it seems to be working.

    @jmagman I'm still using High Sierra 10.13.2 and I can't update to Mojave. So I'm stuck with XCode v. 9.4.1 (9F2000). I've been having a very hard time for days because of the same issue.

    So you say that it resolves after updating XCode to v10.3?

    yea. it works fine now. as @yerzhant said, maybe the best and easiest way is to install Xcode 10.1 or higher? In my case, I didn't want to install another Xcode so just upgraded to Mojave and Xcode 10.3. Hope you can find a solution.

  12. jmagman commented on Sep 17, 2019

    @jmagman
    Member

    I had the same issue, but after upgrading my Xcode to 10.3 from 9.4, it seems to be working.

    @jmagman I'm still using High Sierra 10.13.2 and I can't update to Mojave. So I'm stuck with XCode v. 9.4.1 (9F2000). I've been having a very hard time for days because of the same issue.

    So you say that it resolves after updating XCode to v10.3?

    I believe that API was introduced in iOS 11, so if you can get that SDK into whatever version of Xcode you're on, I bet it will work.
    However, this isn't a Flutter issue, it is an issue in https://github.com/firebase/firebase-ios-sdk. I would ask your questions over there.

  13. camillo777 commented on Oct 20, 2019

    @camillo777

    Official Firebase answer:

    Xcode 10.1 is currently the earliest supported Xcode version.
    Apple requires at least Xcode 10 for app store submissions and will require Xcode 11 starting in April 2020.
    A workaround for you could be to comment out/or delete the erroring code so the old API in the else statement below is always executed.
    However, no guarantees that there might not be other issues using Xcode 9.x

  14. github-actions commented on Aug 26, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  15. locked as resolved and limited conversation to collaborators on Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform-iosiOS applications specifically

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions