Repository navigation
No known class method for selector 'archivedDataWithRootObject:requiringSecureCoding:error:' #40527
Copy link
Copy link
Closed
Labels
platform-iosiOS applications specificallyiOS applications specifically
Description
$ 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!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
platform-iosiOS applications specificallyiOS applications specifically
Activity
yerzhant commentedon Sep 15, 2019
One must say that the application excellently builds for android.
BondarenkoStas commentedon Sep 15, 2019
@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/.
yerzhant commentedon Sep 15, 2019
@BondarenkoStas
https://github.com/yerzhant/askimam
The-Redhat commentedon Sep 15, 2019
I'm experiencing the same issue. Therefore I cannot update my app.
ykaito21 commentedon Sep 16, 2019
I had the same issue, but after upgrade my Xcode to 10.3 from 9.4, it seems to be working.
jmagman commentedon Sep 16, 2019
This is an iOS 11
@availabilityissue in firebase-ios-sdk CocoaPod, not in Flutter. Please file an issue there (I don't have permission to transfer).yasinarik commentedon Sep 17, 2019
@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?
yerzhant commentedon Sep 17, 2019
ykaito21 commentedon Sep 17, 2019
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.
jmagman commentedon Sep 17, 2019
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.
camillo777 commentedon Oct 20, 2019
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
github-actions commentedon Aug 26, 2021
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 -vand a minimal reproduction of the issue.