JideGuru / epub_viewer

An epub reader for Flutter. Wrapped around Folioreader.(WIP)
https://pub.dev/packages/epub_viewer
Apache License 2.0
146 stars 80 forks source link

iOS build failure. #93

Closed dewbambs closed 3 years ago

dewbambs commented 3 years ago

Issue - Since the new version (v0.2.0) is released. I'm unable to build my application for iOS.

pod --version - 1.10.1

flutter doctor -v

[✓] Flutter (Channel stable, 2.0.6, on macOS 11.3 20E232 darwin-x64, locale en-IN)
    • Flutter version 2.0.6 at /Users/mac/Documents/flutter
    • Framework revision 1d9032c7e1 (12 days ago), 2021-04-29 17:37:58 -0700
    • Engine revision 05e680e202
    • Dart version 2.12.3

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/mac/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5, Build version 12E262
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)

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

[✓] Connected device (2 available)
    • iPhone 12 Pro Max (mobile) • 3B0D7732-BA7B-4C56-91EA-002AA63A72BA • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
    • Chrome (web)               • chrome                               • web-javascript • Google Chrome 90.0.4430.93

Platform (iOS) - Crash / Error -

Xcode's output:
↳
    /Users/mac/.pub-cache/hosted/pub.dartlang.org/image_picker-0.7.5/ios/Classes/FLTImagePickerPlugin.m:193:20: warning: 'UIAlertView' is deprecated:
    first deprecated in iOS 9.0 - UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead
    [-Wdeprecated-declarations]
        [[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error", nil)
                       ^
    In module 'UIKit' imported from /Users/mac/aqdar-build-shivam/aqtar_read_and_writes/ios/Pods/Target Support
    Files/image_picker/image_picker-prefix.pch:2:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/UIKit.
    framework/Headers/UIAlertView.h:27:12: note: 'UIAlertView' has been explicitly marked deprecated here
    @interface UIAlertView : UIView
               ^
    1 warning generated.
    /Users/mac/.pub-cache/hosted/pub.dartlang.org/image_picker-0.7.5/ios/Classes/FLTImagePickerPhotoAssetUtil.m:17:44: warning:
    'UIImagePickerControllerReferenceURL' is deprecated: first deprecated in iOS 11.0 - Will be removed in a future release, use PHPicker.
    [-Wdeprecated-declarations]
      NSURL *referenceURL = [info objectForKey:UIImagePickerControllerReferenceURL];
                                               ^
    In module 'UIKit' imported from /Users/mac/aqdar-build-shivam/aqtar_read_and_writes/ios/Pods/Target Support
    Files/image_picker/image_picker-prefix.pch:2:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/UIKit.
    framework/Headers/UIImagePickerController.h:62:51: note: 'UIImagePickerControllerReferenceURL' has been explicitly marked deprecated here
    UIKIT_EXTERN UIImagePickerControllerInfoKey const UIImagePickerControllerReferenceURL API_DEPRECATED("Will be removed in a future release, use
    PHPicker.", ios(4.1, 11.0)) API_UNAVAILABLE(tvos); // an NSURL that references an asset in the AssetsLibrary framework
                                                      ^
    /Users/mac/.pub-cache/hosted/pub.dartlang.org/image_picker-0.7.5/ios/Classes/FLTImagePickerPhotoAssetUtil.m:21:47: warning:
    'fetchAssetsWithALAssetURLs:options:' is deprecated: first deprecated in iOS 11 - Will be removed in a future release [-Wdeprecated-declarations]
      PHFetchResult<PHAsset *> *result = [PHAsset fetchAssetsWithALAssetURLs:@[ referenceURL ]
                                                  ^
    In module 'Photos' imported from /Users/mac/.pub-cache/hosted/pub.dartlang.org/image_picker-0.7.5/ios/Classes/FLTImagePickerPhotoAssetUtil.h:6:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/Photos
    .framework/Headers/PHAsset.h:74:1: note: 'fetchAssetsWithALAssetURLs:options:' has been explicitly marked deprecated here
    + (PHFetchResult<PHAsset *> *)fetchAssetsWithALAssetURLs:(NSArray<NSURL *> *)assetURLs options:(nullable PHFetchOptions *)options
    API_DEPRECATED("Will be removed in a future release", ios(8, 11), tvos(8, 11)) API_UNAVAILABLE(macos);
    ^
    2 warnings generated.
    /Users/mac/aqdar-build-shivam/aqtar_read_and_writes/ios/Pods/Reachability/Reachability.m:465:63: warning: cast to smaller integer type 'unsigned int'
    from 'Reachability *' [-Wpointer-to-int-cast]
                                 NSStringFromClass([self class]), (unsigned int) self, [self currentReachabilityFlags]];
                                                                  ^~~~~~~~~~~~~~~~~~~
    1 warning generated.
    /Users/mac/aqdar-build-shivam/aqtar_read_and_writes/ios/Pods/RealmSwift/RealmSwift/Combine.swift:38:40: error: 'Identifiable' is only available in
    application extensions for iOS 13 or newer
    public protocol ObjectKeyIdentifiable: Identifiable, Object {
                                           ^
    /Users/mac/aqdar-build-shivam/aqtar_read_and_writes/ios/Pods/RealmSwift/RealmSwift/Combine.swift:38:17: note: add @available attribute to enclosing
    protocol
    public protocol ObjectKeyIdentifiable: Identifiable, Object {
                    ^
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Analyzing workspace
    note: Constructing build description
    note: Build preparation complete
    /Users/mac/aqdar-build-shivam/aqtar_read_and_writes/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target
    'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target
    'ZFDragableModalTransition' from project 'Pods')
    /Users/mac/aqdar-build-shivam/aqtar_read_and_writes/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target
    'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'Toast' from project
    'Pods')
    /Users/mac/aqdar-build-shivam/aqtar_read_and_writes/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target
    'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'Reachability' from
    project 'Pods')
    /Users/mac/aqdar-build-shivam/aqtar_read_and_writes/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target
    'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'FontBlaster' from
    project 'Pods')
    /Users/mac/aqdar-build-shivam/aqtar_read_and_writes/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target
    'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'FMDB' from project
    'Pods')
    /Users/mac/aqdar-build-shivam/aqtar_read_and_writes/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target
    'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'MenuItemKit' from
    project 'Pods')
    /Users/mac/aqdar-build-shivam/aqtar_read_and_writes/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target
    'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'AppAuth' from
    project 'Pods')
    /Users/mac/aqdar-build-shivam/aqtar_read_and_writes/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target
    'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'Flutter' from
    project 'Pods')
    /Users/mac/aqdar-build-shivam/aqtar_read_and_writes/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target
    'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'GoogleSignIn' from
    project 'Pods')

Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.

Keeping the warnings aside, the real issue here is cause by swiftRealm. Once I comment epub_viewer from my pubspec.yaml the build completes successfully. So the main issue is.

/Users/mac/aqdar-build-shivam/aqtar_read_and_writes/ios/Pods/RealmSwift/RealmSwift/Combine.swift:38:40: error: 'Identifiable' is only available in application extensions for iOS 13 or newer

Steps to reproduce / Describe in detail -

I did the following steps before running the application.

flutter clean rm -rf ios/Pods rm -rf ios/.symlinks rm -rf ios/Flutter/Flutter.framework rm -rf ios/Flutter/Flutter.podspec rm ios/Podfile flutter run

I have also tried shifting the iOS version to 13 and 13.2. As the error suggests but it was not helpful.

vamsijanaki commented 3 years ago

Try flutter clean, flutter pub get, flutter precache, pod deintegrate and pod install.

And use Xcode 12.2, This issue is a real bug in Realm.

bkoznov commented 3 years ago

It looks like the issue with Realm may have been fixed? Any chance of an update soon @JideGuru ? Thanks!

bkoznov commented 3 years ago

PR is up for depending on new version of Realm here

bkoznov commented 3 years ago

@JideGuru Once you push the updated EpubViewerKit to cocoapods, I can make a PR for epub_viewer to use the updated one. Thanks!

JideGuru commented 3 years ago

@bkoznov The version is out https://cocoapods.org/pods/EpubViewerKit. I'll be expecting your PR. Thanks!