Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Broken Swift project with plugins #15121

Closed
@mogol

Description

@mogol

Cocoapods has bug CocoaPods/CocoaPods#7463
If pod uses :path with symlink, spec.public_header_files doesn't work.

It causes that Swift projects couldn't register plugins. E.g. I met it in my plugin juliansteenbakker/flutter_secure_storage#3

The same issue exists for firebase storage plugin.

Steps to reproduce:

  1. Create new Flutter project with Swift in IDEA.
  2. Add package firebase_database: 0.3.6
  3. Run on iOS Simulator

Could be caused by
#14748

Logs

Running "flutter packages get" in demo_security...
Launching lib/main.dart on iPhone X in debug mode...
Running pod install...
Running Xcode clean...
Starting Xcode build...
Xcode build done
Could not build the application for the simulator.
Failed to build iOS app
Error launching application on iPhone X.
Error output from Xcode build:
↳
    ** BUILD FAILED **
    
Xcode's output:
↳
    === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
    The use of Swift 3 @objc inference in Swift 4 mode is deprecated. Please address deprecated @objc inference warnings, test your code with “Use of deprecated Swift 3 @objc inference” logging enabled, and then disable inference by changing the "Swift 3 @objc Inference" build setting to "Default" for the "Runner" target.
    === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
    /Users/german/Projects/nomads/test/demo_security/ios/Runner/GeneratedPluginRegistrant.m:6:9: fatal error: 'flutter_secure_storage/FlutterSecureStoragePlugin.h' file not found
    #import <flutter_secure_storage/FlutterSecureStoragePlugin.h>
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.
Launching lib/main.dart on iPhone X in debug mode...
Running Xcode clean...
Starting Xcode build...
Xcode build done
Failed to build iOS app
Could not build the application for the simulator.
Error output from Xcode build:
↳
Error launching application on iPhone X.
    ** BUILD FAILED **
    
Xcode's output:
↳
    === BUILD TARGET firebase_database OF PROJECT Pods WITH CONFIGURATION Debug ===
    ld: warning: -undefined dynamic_lookup is deprecated on iOS
    === BUILD TARGET firebase_database OF PROJECT Pods WITH CONFIGURATION Debug ===
    ld: warning: -undefined dynamic_lookup is deprecated on iOS
    === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
    The use of Swift 3 @objc inference in Swift 4 mode is deprecated. Please address deprecated @objc inference warnings, test your code with “Use of deprecated Swift 3 @objc inference” logging enabled, and then disable inference by changing the "Swift 3 @objc Inference" build setting to "Default" for the "Runner" target.
    === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
    /Users/german/Projects/nomads/test/demo_security/ios/Runner/GeneratedPluginRegistrant.m:6:9: fatal error: 'firebase_core/FirebaseCorePlugin.h' file not found
    #import <firebase_core/FirebaseCorePlugin.h>
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.

Flutter Doctor

[✓] Flutter (Channel beta, v0.1.5, on Mac OS X 10.13.3 17D102, locale en-SG)
    • Flutter version 0.1.5 at /Users/german/Projects/github/flutter
    • Framework revision 3ea4d06340 (9 days ago), 2018-02-22 11:12:39 -0800
    • Engine revision ead227f118
    • Dart version 2.0.0-dev.28.0.flutter-0b4f01f759

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /Users/german/Library/Android/sdk
    • Android NDK at /Users/german/Library/Android/sdk/ndk-bundle
    • Platform android-27, build-tools 27.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)

[✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.2, Build version 9C40b
    • ios-deploy 1.9.2
    • CocoaPods version 1.4.0

[✓] Android Studio (version 3.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)

[✓] IntelliJ IDEA Community Edition (version 2017.3.4)
    • Flutter plugin version 22.2.2
    • Dart plugin version 173.4548.30

[✓] Connected devices (1 available)
    • iPhone X • 47F7777A-ED9B-4761-89F0-BEAC583DD438 • ios • iOS 11.2 (simulator)

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions