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

Problem building on fresh MacOS install #17504

Closed
sbesnard opened this issue May 11, 2018 · 3 comments
Closed

Problem building on fresh MacOS install #17504

sbesnard opened this issue May 11, 2018 · 3 comments

Comments

@sbesnard
Copy link

sbesnard commented May 11, 2018

this is a copy of a stackoverflow post

similar to issue #17457

This concerns firebase-auth plugin for flutter.
I have the same code running on two mac computers.
I just did a fresh install on the latter, and get a build error on FirebaseAuthPlugin.m : Incompatible block pointer

/Users/sergebesnard/Development/flutter/.pub-cache/hosted/pub.dartlang.org/
firebase_auth-0.5.9/ios/Classes/FirebaseAuthPlugin.m:69:53:
Incompatible block pointer types sending 'void (^)(FIRUser *__strong, NSError *__strong)' to parameter of type 'FIRAuthDataResultCallback _Nullable' (aka 'void (^)(FIRAuthDataResult * _Nullable __strong, NSError * _Nullable __strong)')

On my MacBook, the code builds smoothly, the only difference being the beta version, which is 0.3.1 and that the android toolchain is installed (EDIT installed in the meantime, no effect confirmed)

On the iMac (failing) :

flutter doctor -v
[✓] Flutter (Channel beta, v0.3.2, on Mac OS X 10.13.4 17E202, locale fr-BE)
    • Flutter version 0.3.2 at /Users/sergebesnard/Development/flutter
    • Framework revision 44b7e7d3f4 (3 weeks ago), 2018-04-20 01:02:44 -0700
    • Engine revision 09d05a3891
    • Dart version 2.0.0-dev.48.0.flutter-fe606f890b

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.io/setup/#android-setup for detailed instructions).
      If Android SDK has been installed to a custom location, set $ANDROID_HOME to that location.

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

[✗] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.io/setup/#android-setup for detailed instructions).

[✓] VS Code (version 1.23.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Dart Code extension version 2.12.1

[✓] Connected devices (1 available)
    • iPhone X • 780C4B10-21A6-41E0-9A05-A6175FC20FA0 • ios • iOS 11.3 (simulator)

! Doctor found issues in 2 categories.

on the macbook (working):

[✓] Flutter (Channel beta, v0.3.1, on Mac OS X 10.13.4 17E199, locale fr-BE)
    • Flutter version 0.3.1 at /Users/sergebesnard/flutter
    • Framework revision 12bbaba9ae (3 weeks ago), 2018-04-19 23:36:15 -0700
    • Engine revision 09d05a3891
    • Dart version 2.0.0-dev.48.0.flutter-fe606f890b

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

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

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

[✓] IntelliJ IDEA Community Edition (version 2017.3.4)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 23.2.2
    • Dart plugin version 173.4700

[✓] VS Code (version 1.23.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Dart Code extension version 2.12.0

[✓] Connected devices (1 available)
    • iPhone X • 03F5FA6E-7332-46A2-9BF8-A1CACE723CC8 • ios • iOS 11.3 (simulator)

• No issues found!

the Podfile is the same :

# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

def parse_KV_file(file, separator='=')
  file_abs_path = File.expand_path(file)
  if !File.exists? file_abs_path
    return [];
  end
  pods_ary = []
  skip_line_start_symbols = ["#", "/"]
  File.foreach(file_abs_path) { |line|
      next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
      plugin = line.split(pattern=separator)
      if plugin.length == 2
        podname = plugin[0].strip()
        path = plugin[1].strip()
        podpath = File.expand_path("#{path}", file_abs_path)
        pods_ary.push({:name => podname, :path => podpath});
      else
        puts "Invalid plugin specification: #{line}"
      end
  }
  return pods_ary
end

target 'Runner' do
  use_frameworks!
  # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
  # referring to absolute paths on developers' machines.
  system('rm -rf Pods/.symlinks')
  system('mkdir -p Pods/.symlinks/plugins')

  # Flutter Pods
  generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
  if generated_xcode_build_settings.empty?
    puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
  end
  generated_xcode_build_settings.map { |p|
    if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
      symlink = File.join('Pods', '.symlinks', 'flutter')
      File.symlink(File.dirname(p[:path]), symlink)
      pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
    end
  }

  # Plugin Pods
  plugin_pods = parse_KV_file('../.flutter-plugins')
  plugin_pods.map { |p|
    symlink = File.join('Pods', '.symlinks', 'plugins', p[:name])
    File.symlink(p[:path], symlink)
    pod p[:name], :path => File.join(symlink, 'ios')
  }
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

The pod version is 1.5.0 in both cases.

Pubspec.yaml :

dependencies:
  flutter:
    sdk: flutter
  google_sign_in: "^3.0.2"
  firebase_analytics: "^0.3.3"
  firebase_auth: "^0.5.5"
  firebase_database: "^0.4.6"
  firebase_storage: "^0.2.6"
  cloud_firestore: "^0.6.3"

  simple_permissions: "^0.1.2"

  diff_match_patch : 0.2.1
  path_provider: "^0.4.0"
  intl: "^0.15.6"
  #timeago: 1.2.0
  #side_header_list_view: "^0.0.2"
  uuid: "^1.0.0"

  robyn_nlp:
    path: ../robyn-nlp

  async_message_queue_controller:
    path: ../AsyncMessageQueueProcessor

  oscillo_wave_painter:
    path: ../oscillo-wave-painter
  
  voice_recorder:
    path: ../voice_recorder

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.0

dev_dependencies:
  flutter_test:
    sdk: flutter


# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  assets:
  - assets/logo-solo.png
  - assets/banner.png

I frankly would prefer not to test upgrading the flutter sdk on my working setup, I still need to work on that stuff...

I don't know if this is helpful, but during setup, I ran into a problem on the installation of flutter on XCODE, because XCODE was not fully setup when at the time.
flutter doctor did ask me to install the package six, and had problem because of a conflict in python@2 versions, so I force uninstalled via brew python@2 and reinstalled it, then could install via pip install six

If this is the cause, I will have to reinstall XCODE & Flutter. Hopefully not the case.

Thanks
Serge

@sbesnard
Copy link
Author

This answer along with updating the pubspec.yaml to latest versions solved the problem for me.

@hengsoheak
Copy link

If i know flutter too much error i will not com

@github-actions
Copy link

github-actions bot commented Aug 9, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants