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 compilation fails in Flutter app for XCode 9.2 #4125

Closed
camillo777 opened this issue Oct 19, 2019 · 2 comments
Closed

iOS compilation fails in Flutter app for XCode 9.2 #4125

camillo777 opened this issue Oct 19, 2019 · 2 comments

Comments

@camillo777
Copy link

camillo777 commented Oct 19, 2019

  • Xcode version: Version 9.2 (9C40b)
  • Firebase SDK version: 7.6.1
  • Firebase Component: _____ (Auth, Core, Database, Firestore, Messaging, Storage, etc)
  • Component version: _____
  • Mac OSX Sierra 10.12.6 (16G2128)
  • Flutter flutter version v1.9.1+hotfix.5

Describe the problem:
I am trying to build my really Flutter simple app for iOS (Flutter init app).
Android is ok.
I cannot update OSX so I am stuck with XCode 9.2.
On iPhone6 and Simulator iPhoneX build fails with the attached error message.

Here it says it is a Firebase iOS SDK problem:
flutter/flutter#40527

Installing new DeviceSupport files did not help as well:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/
10.0/          10.3/          11.2 (15C107)/ 13.2/          8.2/           9.0/           9.3/           
10.1/          11.0/          12.4 (16G73)/  8.0/           8.3/           9.1/           
10.2/          11.1/          13.1/          8.1/           8.4/           9.2/     

Visual Studio Code errors:

Launching lib/main.dart on iPhone X in debug mode...
Xcode build done.                                            3.8s
Failed to build iOS app
Error output from Xcode build:
↳
    2019-10-19 21:28:06.684 xcodebuild[21473:184514]  DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-13756/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/BuildSystem/Runtime/PBXTargetBuildContext.mm:757
    Details:  unexpected successful exit code from cancelled command <C0003:'CpResource roots.pem':P8>
    Object:   <PBXTargetBuildContext: 0x7fb83187dde0>
    Method:   -createCommandInvocationRecordFromInvocation:
    Thread:   <NSThread: 0x7fb833a35750>{number = 17, name = (null)}
    Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
    ** BUILD FAILED **
Xcode's output:
↳
    === BUILD TARGET leveldb-library OF PROJECT Pods WITH CONFIGURATION Debug ===
    /Users/camillo/MyCamillo/Development/flutter/camillo_flutter/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTLibrary/GDTStorage.m:118:41: error: no known class method for selector 'archivedDataWithRootObject:requiringSecureCoding:error:'
            NSData *data = [NSKeyedArchiver archivedDataWithRootObject:self
                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/camillo/MyCamillo/Development/flutter/camillo_flutter/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTLibrary/GDTStorage.m:215:24: error: no known class method for selector 'unarchivedObjectOfClass:fromData:error:'
        [NSKeyedUnarchiver unarchivedObjectOfClass:[GDTStorage class] fromData:data error:nil];
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/camillo/MyCamillo/Development/flutter/camillo_flutter/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTLibrary/GDTStorage.m:227:39: error: no known class method for selector 'archivedDataWithRootObject:requiringSecureCoding:error:'
          NSData *data = [NSKeyedArchiver archivedDataWithRootObject:self
                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/camillo/MyCamillo/Development/flutter/camillo_flutter/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTLibrary/GDTStorage.m:255: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.
@google-oss-bot

This comment has been minimized.

@paulb777
Copy link
Member

@camillo777 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

@firebase firebase locked and limited conversation to collaborators Nov 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants