mintware-de / flutter_barcode_reader

A flutter plugin for reading 2D barcodes and QR codes.
MIT License
628 stars 462 forks source link

After upgrading Flutter to 1.7 it is failing to compile iOS #136

Closed gondaimgano closed 4 years ago

gondaimgano commented 5 years ago

I am failing to compile using the barcode_scan plugin on iOS. Please see below error While building module 'barcode_scan' imported from /Users/gondaimgano/Documents/work/ios/squareUniversalIOS/ios/Runner/GeneratedPluginRegistrant.m:6: In file included from :1: In file included from /Users/gondaimgano/Documents/work/ios/squareUniversalIOS/build/ios/Release-iphoneos/barcode_scan/barcode_scan.framework/Headers/barcode_scan-umbrella.h:15: /Users/gondaimgano/Documents/work/ios/squareUniversalIOS/build/ios/Release-iphoneos/barcode_scan/barcode_scan.framework/Headers/BarcodeScanPlugin.h:12:1: warning: retain'ed block property does not copy the block - use copy attribute instead [-Wobjc-noncopy-retain-block-property] @property(nonatomic, retain) FlutterResult result; ^ 1 warning generated. 1 warning generated.

renatopastor1 commented 5 years ago

I am having a similar problem here, any fix yet? @gondaimgano your help is much appreciated

gondaimgano commented 5 years ago

Hi @renatopastor1 this what I finally did I hope it will help you:

  1. Create completely a new flutter project
  2. Build project for ios first (flutter build ios)
  3. Paste yaml plugins from old flutter project
  4. Run the flutter pub get command
  5. Paste assets if any(do a 'flutter clean' after that and 'flutter build ios' command after)
  6. Paste dart files in /lib directory
  7. Build and compile archive in xcode

These are the steps I made to make my app work. What I so is it could be related to some changes on the Podfiles in 1.7

masseelch commented 5 years ago

I did try your steps @gondaimgano but they did not work for me. Downgrading to flutter 1.5 does not work either.

gondaimgano commented 5 years ago

These are my current settings which finally worked for me:

Take note of my cocoapods its on 1.6.1

[✓] Flutter (Channel stable, v1.7.8+hotfix.4, on Mac OS X 10.14.5 18F132, locale en-GB) • Flutter version 1.7.8+hotfix.4 at /src/stuff/.. • Framework revision 20e59316b8 (3 weeks ago), 2019-07-18 20:04:33 -0700 • Engine revision fee001c93f • Dart version 2.4.0

[✓] Xcode - develop for iOS and macOS (Xcode 10.3) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 10.3, Build version 10G8 • CocoaPods version 1.6.1

[✓] iOS tools - develop for iOS devices • ios-deploy 1.9.4

[✓] Android Studio (version 3.4) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin version 37.1.1 • Dart plugin version 183.6270 • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[!] IntelliJ IDEA Ultimate Edition (version 2018.3.2) • IntelliJ at /Applications/IntelliJ IDEA.app ✗ Flutter plugin not installed; this adds Flutter specific functionality. ✗ Dart plugin not installed; this adds Dart specific functionality. • For information about installing plugins, see https://flutter.dev/intellij-setup/#installing-the-plugins

[✓] Connected device (1 available) • Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)

gondaimgano commented 5 years ago

I did try your steps @gondaimgano but they did not work for me. Downgrading to flutter 1.5 does not work either.

@masseelch you might have to do a clean flutter installation.

masseelch commented 5 years ago

I have an old iMac of 2010, can not upgrade to Mojave and still have to use XCode 9. That is the only difference i have to your setup.

Screw Apple :-(

gondaimgano commented 5 years ago

Its a frustration for sure @masseelch these guys at Apple I not a fan of Flutter especially when they have their own declarative UI language on the pipes too (Swift UI). Not sure how this war will go

renatopastor1 commented 5 years ago

@gondaimgano Thank you for your help! It worked very well.

gondaimgano commented 5 years ago

@renatopastor1 I am glad it worked!