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

Cannot Build App Swift Error #16

Open
l-k22 opened this issue Feb 27, 2019 · 9 comments
Open

Cannot Build App Swift Error #16

l-k22 opened this issue Feb 27, 2019 · 9 comments

Comments

@l-k22
Copy link

l-k22 commented Feb 27, 2019

I'm using 'flutter_pdf_viewer' to view downloaded pdfs on android devices for ios I have a device check and open pdfs using 'flutter_full_pdf_viewer'. When I try to build the app it fails and the VSC terminal returns the following errors

Launching lib/main.dart on IT’s iPhone in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: xxxxxxx
Xcode build done.                                           14.4s
Failed to build iOS app
Error output from Xcode build:
↳
 2019-02-27 10:01:42.908 xcodebuild[xxx:xxxx]  DTDeviceKit: deviceType from xxxxxxx was NULL
 ** BUILD FAILED **
Xcode's output:
↳
 === BUILD TARGET url_launcher OF PROJECT Pods WITH CONFIGURATION Debug ===
 /Users/xxx/Documents/Programming/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_pdf_viewer-0.2.0/ios/Classes/SwiftFlutterPdfViewerPlugin.swift:1:1: error: unknown type name 'import'
 import Flutter
 ^
 /Users/xxx/Documents/Programming/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_pdf_viewer-0.2.0/ios/Classes/SwiftFlutterPdfViewerPlugin.swift:1:15: error: expected ';' after top level declarator
 import Flutter
               ^
               ;
 2 errors generated.
Could not build the precompiled application for the device.
Error launching application on IT’s iPhone.
Exited (sigterm)
 pod install
Analyzing dependencies
Fetching podspec for `Flutter` from `.symlinks/flutter/ios`
Fetching podspec for `device_info` from `.symlinks/plugins/device_info/ios`
Fetching podspec for `flutter_full_pdf_viewer` from `.symlinks/plugins/flutter_full_pdf_viewer/ios`
Fetching podspec for `flutter_pdf_viewer` from `.symlinks/plugins/flutter_pdf_viewer/ios`
Fetching podspec for `onesignal` from `.symlinks/plugins/onesignal/ios`
Fetching podspec for `open_file` from `.symlinks/plugins/open_file/ios`
Fetching podspec for `package_info` from `.symlinks/plugins/package_info/ios`
Fetching podspec for `path_provider` from `.symlinks/plugins/path_provider/ios`
Fetching podspec for `sqflite` from `.symlinks/plugins/sqflite/ios`
Fetching podspec for `url_launcher` from `.symlinks/plugins/url_launcher/ios`
Downloading dependencies
Using FMDB (2.7.5)
Using Flutter (1.0.0)
Using OneSignal (2.9.5)
Using device_info (0.0.1)
Using flutter_full_pdf_viewer (1.0.1)
Using flutter_pdf_viewer (0.0.1)
Using onesignal (1.0.5)
Using open_file (0.0.1)
Using package_info (0.0.1)
Using path_provider (0.0.1)
Using sqflite (0.0.1)
Using url_launcher (0.0.1)
Generating Pods project
Integrating client project
Pod installation complete! There are 11 dependencies from the Podfile and 12 total pods installed.

[✓] Flutter (Channel dev, v1.2.1, on Mac OS X 10.14.2 18C54, locale en-GB)
    • Flutter version 1.2.1 at /Users/xxx/Documents/Programming/flutter
    • Framework revision 8661d8aecd (12 days ago), 2019-02-14 19:19:53 -0800
    • Engine revision 3757390fa4
    • Dart version 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/xxx/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.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-1248-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.1, Build version 10B61
    • ios-deploy 1.9.4
    • CocoaPods version 1.6.0

[✓] Android Studio (version 3.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 33.0.1
    • Dart plugin version 182.5215
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

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

[✓] Connected device (3 available)
    • ASUS X00TD        • xxxxxxxxxxxx                      • android-arm64 • Android 8.1.0 (API 27)
    • IT’s iPhone • xxxx-xxxxxxxxxx            • ios           • iOS 12.1.4
    • iPhone XR         • xxxx-xxxx-xxxx-xxxx-xxxx • ios           • iOS 12.1 (simulator)

• No issues found!
@devxpy
Copy link
Member

devxpy commented Feb 27, 2019

Sorry, we don't support IOS #2

@devxpy devxpy closed this as completed Feb 27, 2019
@l-k22
Copy link
Author

l-k22 commented Feb 27, 2019

Sorry, we don't support IOS #2

Yes I'm aware the package is not for iOS as you've stated before hence why I'm using a different pdf package for iOS, I wanted to know how I can still build my app if this package is included.

@devxpy devxpy reopened this Feb 27, 2019
@devxpy
Copy link
Member

devxpy commented Feb 27, 2019

Ah, I've not made any changes to the IOS side of things. I have no idea why it won't build :/

@l-k22
Copy link
Author

l-k22 commented Mar 5, 2019

Update: I did a git clean and upgraded cocoapods now I get

Failed to build iOS app
Error output from Xcode build:
↳
    2019-03-05 13:36:54.707 xcodebuild[50976:283671]  DTDeviceKit: deviceType from xxxx-xxxxx was NULL
    2019-03-05 13:36:54.889 xcodebuild[50976:283713]  DTDeviceKit: deviceType from xxxx-xxxxx was NULL
    ** BUILD FAILED **
Xcode's output:
↳
    /Users/xxx/Documents/Programming/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_pdf_viewer-0.2.1/ios/Classes/FlutterPdfViewerPlugin.m:2:9: fatal error: 'flutter_pdf_viewer/flutter_pdf_viewer-Swift.h' file not found
    #import <flutter_pdf_viewer/flutter_pdf_viewer-Swift.h>
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1 error generated.
Could not build the precompiled application for the device.
Error launching application on IT’s iPhone.

Error appears to come from FlutterPdfViewerPlugin.m

#import "FlutterPdfViewerPlugin.h"
#import <flutter_pdf_viewer/flutter_pdf_viewer-Swift.h> _**#<---THIS LINE THROWS THE EXCEPTION**_

@implementation FlutterPdfViewerPlugin
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
  [SwiftFlutterPdfViewerPlugin registerWithRegistrar:registrar];
}
@end

@l-k22
Copy link
Author

l-k22 commented May 3, 2019

Can anyone help me with my woes? :(

@devxpy
Copy link
Member

devxpy commented May 3, 2019

@l-k22 Sorry for no-response. My mac appears to have broken itself. Will push a fix so that it at least builds on ios as soon as I get it working.
Which one are you using for ios BTW?

@devxpy
Copy link
Member

devxpy commented Jun 14, 2019

@l-k22 Have you tried it recently? I just tried building the example app for iOS and it works fine.

@l-k22
Copy link
Author

l-k22 commented Jun 14, 2019

Unfortunately I couldn't get it to build so I gave up and used another package. It's strange though because I have the same Swift problem with the flutter_email_sender package but no other packages.

@l-k22
Copy link
Author

l-k22 commented Jun 14, 2019

here's my pubspec

  archive: ^2.0.9
  auto_size_text: ^1.1.2
  cupertino_icons: ^0.1.2
  device_info: ^0.4.0+2
  flutter_cupertino_settings: ^0.1.0
  # flutter_email_sender: ^2.0.2
      # git: 
      #   url: https://github.com/sidlatau/flutter_email_sender
  flutter_html: ^0.9.6
  flutter_launcher_icons: ^0.7.2
  html: ^0.13.3
  html2md: ^0.3.1
  markdown: ^2.0.3
  http: ^0.12.0+2
  image_picker: ^0.6.0+8
  intl: ^0.15.8
  json_annotation: ^2.4.0
  onesignalflutter: #^1.1.0
      git: 
        url: https://github.com/jmrobles/OneSignal-Flutter-SDK
  open_file: ^2.0.1+1
  package_info: ^0.4.0+3
  path_provider: ^1.1.0
  sqflite: ^1.1.5
  url_launcher: ^5.0.2
  # flutter_pdf_viewer: #^0.2.3
  #     git:
  #       url: https://github.com/pycampers/flutter_pdf_viewer
  flutter_pdfview: ^1.0.0+6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants